From de1c2ce9e0710f39464069d880fac7bb9ec24d1a Mon Sep 17 00:00:00 2001 From: James Ward Date: Tue, 31 Jan 2023 12:20:46 +0000 Subject: Create MI tests for Type Conversion: CAST Signed-off-by: James Ward Change-Id: I2faca325583245248e7043cf3359e696ececac19 --- .../cast_53_bf16_outi8/Conformance-result-0.json | 58 ++++++++++++++++++++++ .../cast/cast_53_bf16_outi8/desc.json | 23 +++++++++ .../cast/cast_53_bf16_outi8/input-0.json | 58 ++++++++++++++++++++++ .../cast/cast_53_bf16_outi8/test.json | 52 +++++++++++++++++++ 4 files changed, 191 insertions(+) create mode 100644 operators/type_conversion/cast/cast_53_bf16_outi8/Conformance-result-0.json create mode 100644 operators/type_conversion/cast/cast_53_bf16_outi8/desc.json create mode 100644 operators/type_conversion/cast/cast_53_bf16_outi8/input-0.json create mode 100644 operators/type_conversion/cast/cast_53_bf16_outi8/test.json (limited to 'operators/type_conversion/cast/cast_53_bf16_outi8') diff --git a/operators/type_conversion/cast/cast_53_bf16_outi8/Conformance-result-0.json b/operators/type_conversion/cast/cast_53_bf16_outi8/Conformance-result-0.json new file mode 100644 index 000000000..0197829d7 --- /dev/null +++ b/operators/type_conversion/cast/cast_53_bf16_outi8/Conformance-result-0.json @@ -0,0 +1,58 @@ +{ + "type": "int32", + "data": [ + -2, + 2, + 2, + 1, + -1, + 2, + 1, + 1, + 0, + -1, + -2, + 2, + 0, + -1, + -1, + 0, + -1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + -2, + 0, + -2, + 0, + -1, + -1, + -2, + 0, + -1, + 2, + 0, + -1, + 0, + -2, + 2, + 0, + 1, + -2, + 0, + 0, + 2, + 0, + 0, + -1, + -1, + 0, + 0, + -2, + 1 + ] +} \ No newline at end of file diff --git a/operators/type_conversion/cast/cast_53_bf16_outi8/desc.json b/operators/type_conversion/cast/cast_53_bf16_outi8/desc.json new file mode 100644 index 000000000..d418e4060 --- /dev/null +++ b/operators/type_conversion/cast/cast_53_bf16_outi8/desc.json @@ -0,0 +1,23 @@ +{ + "tosa_file": "test.json", + "ifm_name": [ + "input-0" + ], + "ifm_file": [ + "input-0.npy" + ], + "ofm_name": [ + "result-0" + ], + "ofm_file": [ + "result-0.npy" + ], + "expected_return_code": 0, + "expected_failure": false, + "expected_result_file": [ + "Conformance-result-0.npy" + ], + "profile": [ + "tosa-mi" + ] +} \ No newline at end of file diff --git a/operators/type_conversion/cast/cast_53_bf16_outi8/input-0.json b/operators/type_conversion/cast/cast_53_bf16_outi8/input-0.json new file mode 100644 index 000000000..c9dd234b1 --- /dev/null +++ b/operators/type_conversion/cast/cast_53_bf16_outi8/input-0.json @@ -0,0 +1,58 @@ +{ + "type": "float32", + "data": [ + -1.5234375, + 1.84375, + 1.6328125, + 0.796875, + -0.93359375, + 1.875, + 1.109375, + 0.8671875, + -0.2021484375, + -0.91015625, + -1.609375, + 1.609375, + -0.1767578125, + -1.1875, + -0.7734375, + 0.31640625, + -1.2890625, + 1.421875, + 1.03125, + 0.875, + -0.271484375, + 0.5078125, + 0.3359375, + 0.59765625, + -1.65625, + -0.3359375, + -1.828125, + -0.02392578125, + -0.6796875, + -1.421875, + -1.5859375, + 0.349609375, + -1.3125, + 1.6953125, + 0.32421875, + -0.609375, + 0.36328125, + -1.90625, + 1.828125, + -0.0703125, + 1.125, + -1.6640625, + -0.05322265625, + -0.037109375, + 1.75, + 0.28515625, + -0.10595703125, + -0.9296875, + -0.671875, + 0.08251953125, + -0.244140625, + -1.90625, + 1.3046875 + ] +} \ No newline at end of file diff --git a/operators/type_conversion/cast/cast_53_bf16_outi8/test.json b/operators/type_conversion/cast/cast_53_bf16_outi8/test.json new file mode 100644 index 000000000..e328c27c2 --- /dev/null +++ b/operators/type_conversion/cast/cast_53_bf16_outi8/test.json @@ -0,0 +1,52 @@ +{ + version: { + _major: 0, + _minor: 51, + _patch: 0, + _draft: true + }, + regions: [ + { + name: "main", + blocks: [ + { + name: "main", + operators: [ + { + op: "CAST", + attribute_type: "NONE", + inputs: [ + "input-0" + ], + outputs: [ + "result-0" + ] + } + ], + tensors: [ + { + name: "input-0", + shape: [ + 53 + ], + type: "BF16" + }, + { + name: "result-0", + shape: [ + 53 + ], + type: "INT8" + } + ], + inputs: [ + "input-0" + ], + outputs: [ + "result-0" + ] + } + ] + } + ] +} -- cgit v1.2.1