From b4182950aa20a7bbf65f5c57b2b7d73bb93ccb03 Mon Sep 17 00:00:00 2001 From: Ashwini Khade Date: Wed, 17 Apr 2019 20:11:51 -0700 Subject: [PATCH] add node tests for quantized ops (#1944) * add node tests for quantized ops * cosmetic changes * more cosmetic changes * typecheck error fixes * update docs * add node tests for qlinearconv --- docs/Operators.md | 230 ++++++++++++++++ docs/TestCoverage.md | 250 ++++++++++++++++-- onnx/backend/test/case/node/convinteger.py | 40 +++ .../test/case/node/dequantizelinear.py | 27 ++ onnx/backend/test/case/node/matmulinteger.py | 39 +++ onnx/backend/test/case/node/qlinearconv.py | 48 ++++ onnx/backend/test/case/node/qlinearmatmul.py | 74 ++++++ onnx/backend/test/case/node/quantizelinear.py | 26 ++ .../node/test_basic_convinteger/model.onnx | 27 ++ .../test_data_set_0/input_0.pb | 1 + .../test_data_set_0/input_1.pb | 1 + .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/output_0.pb | Bin 0 -> 31 bytes .../test_convinteger_with_padding/model.onnx | 28 ++ .../test_data_set_0/input_0.pb | 1 + .../test_data_set_0/input_1.pb | 1 + .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/output_0.pb | Bin 0 -> 79 bytes .../node/test_dequantizelinear/model.onnx | 21 ++ .../test_data_set_0/input_0.pb | Bin 0 -> 13 bytes .../test_data_set_0/input_1.pb | Bin 0 -> 19 bytes .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/output_0.pb | Bin 0 -> 25 bytes .../data/node/test_matmulinteger/model.onnx | 26 ++ .../test_data_set_0/input_0.pb | Bin 0 -> 23 bytes .../test_data_set_0/input_1.pb | 1 + .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/input_3.pb | Bin 0 -> 21 bytes .../test_data_set_0/output_0.pb | 1 + .../data/node/test_qlinearconv/model.onnx | 52 ++++ .../test_data_set_0/input_0.pb | Bin 0 -> 64 bytes .../test_data_set_0/input_1.pb | 1 + .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/input_3.pb | Bin 0 -> 16 bytes .../test_data_set_0/input_4.pb | 1 + .../test_data_set_0/input_5.pb | 1 + .../test_data_set_0/input_6.pb | 1 + .../test_data_set_0/input_7.pb | 1 + .../test_data_set_0/output_0.pb | Bin 0 -> 64 bytes .../node/test_qlinearmatmul_2D/model.onnx | 46 ++++ .../test_data_set_0/input_0.pb | Bin 0 -> 19 bytes .../test_data_set_0/input_1.pb | 1 + .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/input_3.pb | Bin 0 -> 23 bytes .../test_data_set_0/input_4.pb | 1 + .../test_data_set_0/input_5.pb | 1 + .../test_data_set_0/input_6.pb | 1 + .../test_data_set_0/input_7.pb | 1 + .../test_data_set_0/output_0.pb | 1 + .../node/test_qlinearmatmul_3D/model.onnx | 49 ++++ .../test_data_set_0/input_0.pb | Bin 0 -> 29 bytes .../test_data_set_0/input_1.pb | 1 + .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/input_3.pb | Bin 0 -> 37 bytes .../test_data_set_0/input_4.pb | 1 + .../test_data_set_0/input_5.pb | 1 + .../test_data_set_0/input_6.pb | 1 + .../test_data_set_0/input_7.pb | 1 + .../test_data_set_0/output_0.pb | 1 + .../data/node/test_quantizelinear/model.onnx | 21 ++ .../test_data_set_0/input_0.pb | Bin 0 -> 33 bytes .../test_data_set_0/input_1.pb | Bin 0 -> 19 bytes .../test_data_set_0/input_2.pb | 1 + .../test_data_set_0/output_0.pb | Bin 0 -> 15 bytes 64 files changed, 1016 insertions(+), 19 deletions(-) create mode 100644 onnx/backend/test/case/node/convinteger.py create mode 100644 onnx/backend/test/case/node/dequantizelinear.py create mode 100644 onnx/backend/test/case/node/matmulinteger.py create mode 100644 onnx/backend/test/case/node/qlinearconv.py create mode 100644 onnx/backend/test/case/node/qlinearmatmul.py create mode 100644 onnx/backend/test/case/node/quantizelinear.py create mode 100644 onnx/backend/test/data/node/test_basic_convinteger/model.onnx create mode 100644 onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_convinteger_with_padding/model.onnx create mode 100644 onnx/backend/test/data/node/test_convinteger_with_padding/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_convinteger_with_padding/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_convinteger_with_padding/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_convinteger_with_padding/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_dequantizelinear/model.onnx create mode 100644 onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_matmulinteger/model.onnx create mode 100644 onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/input_3.pb create mode 100644 onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/model.onnx create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_3.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_4.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_5.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_6.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_7.pb create mode 100644 onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/model.onnx create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_3.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_4.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_5.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_6.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_7.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/model.onnx create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_3.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_4.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_5.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_6.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_7.pb create mode 100644 onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/output_0.pb create mode 100644 onnx/backend/test/data/node/test_quantizelinear/model.onnx create mode 100644 onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_0.pb create mode 100644 onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_1.pb create mode 100644 onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_2.pb create mode 100644 onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/output_0.pb diff --git a/docs/Operators.md b/docs/Operators.md index 47acf23822c..27096fcef0c 100644 --- a/docs/Operators.md +++ b/docs/Operators.md @@ -2492,6 +2492,42 @@ This version of the operator has been available since version 10 of the default +#### Examples + +
+convinteger + +```python + +x = np.array([2, 3, 4, 5, 6, 7, 8, 9, 10]).astype(np.uint8).reshape((1, 1, 3, 3)) +x_zero_point = np.array([1]).astype(np.uint8) +w = np.array([1, 1, 1, 1]).astype(np.uint8).reshape((1, 1, 2, 2)) + +y = np.array([12, 16, 24, 28]).astype(np.int32).reshape(1, 1, 2, 2) + +# ConvInteger without padding +convinteger_node = onnx.helper.make_node('ConvInteger', + inputs=['x', 'w', 'x_zero_point'], + outputs=['y']) + +expect(convinteger_node, inputs=[x, w, x_zero_point], outputs=[y], + name='test_basic_convinteger') + +# ConvInteger with padding +y_with_padding = np.array([1, 3, 5, 3, 5, 12, 16, 9, 11, 24, 28, 15, 7, 15, 17, 9]).astype(np.int32).reshape((1, 1, 4, 4)) + +convinteger_node_with_padding = onnx.helper.make_node('ConvInteger', + inputs=['x', 'w', 'x_zero_point'], + outputs=['y'], + pads=[1, 1, 1, 1],) + +expect(convinteger_node_with_padding, inputs=[x, w, x_zero_point], outputs=[y_with_padding], + name='test_convinteger_with_padding') +``` + +
+ + ### **ConvTranspose** The convolution transpose operator consumes an input tensor and a filter, @@ -3105,6 +3141,29 @@ This version of the operator has been available since version 10 of the default +#### Examples + +
+dequantizelinear + +```python +node = onnx.helper.make_node('DequantizeLinear', + inputs=['x', 'x_scale', 'x_zero_point'], + outputs=['y'],) + +# scalar zero point and scale +x = np.array([0, 3, 128, 255]).astype(np.uint8) +x_scale = np.array([2], dtype=np.float32) +x_zero_point = np.array([128], dtype=np.uint8) +y = np.array([-256, -250, 0, 254], dtype=np.float32) + +expect(node, inputs=[x, x_scale, x_zero_point], outputs=[y], + name='test_dequantizelinear') +``` + +
+ + ### **Div** Performs element-wise binary division (with Numpy-style broadcasting support). @@ -6319,6 +6378,41 @@ This version of the operator has been available since version 10 of the default +#### Examples + +
+matmulinteger + +```python +node = onnx.helper.make_node('MatMulInteger', + inputs=['A', 'B', 'a_zero_point', 'b_zero_point'], + outputs=['Y'],) + +A = np.array([[11, 7, 3], + [10, 6, 2], + [9, 5, 1], + [8, 4, 0], ], dtype=np.uint8) + +a_zero_point = np.array([12], dtype=np.uint8) + +B = np.array([[1, 4], + [2, 5], + [3, 6], ], dtype=np.uint8) + +b_zero_point = np.array([0], dtype=np.uint8) + +output = np.array([[-38, -83], + [-44, -98], + [-50, -113], + [-56, -128], ], dtype=np.int32) + +expect(node, inputs=[A, B, a_zero_point, b_zero_point], outputs=[output], + name='test_matmulinteger') +``` + +
+ + ### **Max** Element-wise max of each of the input tensors (with Numpy-style broadcasting support). @@ -8222,6 +8316,50 @@ This version of the operator has been available since version 10 of the default +#### Examples + +
+qlinearconv + +```python +node = onnx.helper.make_node('QLinearConv', + inputs=['x', 'x_scale', 'x_zero_point', 'w', 'w_scale', 'w_zero_point', 'y_scale', 'y_zero_point'], + outputs=['y'],) + +x = np.array([[255, 174, 162, 25, 203, 168, 58], + [15, 59, 237, 95, 129, 0, 64], + [56, 242, 153, 221, 168, 12, 166], + [232, 178, 186, 195, 237, 162, 237], + [188, 39, 124, 77, 80, 102, 43], + [127, 230, 21, 83, 41, 40, 134], + [255, 154, 92, 141, 42, 148, 247], ], dtype=np.uint8).reshape((1, 1, 7, 7)) + +x_scale = np.array([0.00369204697], dtype=np.float32) +x_zero_point = np.array([132], dtype=np.uint8) + +w = np.array([0], dtype=np.uint8).reshape((1, 1, 1, 1)) + +w_scale = np.array([0.00172794575], dtype=np.float32) +w_zero_point = np.array([255], dtype=np.uint8) + +y_scale = np.array([0.00162681262], dtype=np.float32) +y_zero_point = np.array([123], dtype=np.uint8) + +output = np.array([[0, 81, 93, 230, 52, 87, 197], + [240, 196, 18, 160, 126, 255, 191], + [199, 13, 102, 34, 87, 243, 89], + [23, 77, 69, 60, 18, 93, 18], + [67, 216, 131, 178, 175, 153, 212], + [128, 25, 234, 172, 214, 215, 121], + [0, 101, 163, 114, 213, 107, 8], ], dtype=np.uint8).reshape((1, 1, 7, 7)) + +expect(node, inputs=[x, x_scale, x_zero_point, w, w_scale, w_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearconv') +``` + +
+ + ### **QLinearMatMul** Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html. @@ -8277,6 +8415,76 @@ This version of the operator has been available since version 10 of the default +#### Examples + +
+qlinearmatmul + +```python +node = onnx.helper.make_node('QLinearMatMul', + inputs=['a', 'a_scale', 'a_zero_point', 'b', 'b_scale', 'b_zero_point', 'y_scale', 'y_zero_point'], + outputs=['y'],) + +#2D +a = np.array([[208, 236, 0, 238], + [3, 214, 255, 29], ], dtype=np.uint8) + +a_scale = np.array([0.0066], dtype=np.float32) +a_zero_point = np.array([113], dtype=np.uint8) + +b = np.array([[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]], dtype=np.uint8) + +b_scale = np.array([0.00705], dtype=np.float32) +b_zero_point = np.array([114], dtype=np.uint8) + +y_scale = np.array([0.0107], dtype=np.float32) +y_zero_point = np.array([118], dtype=np.uint8) + +output = np.array([[168, 115, 255], + [1, 66, 151], ], dtype=np.uint8) + +expect(node, inputs=[a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearmatmul_2D') + +#3D +a = np.array([[[208, 236, 0, 238], + [3, 214, 255, 29]], + [[208, 236, 0, 238], + [3, 214, 255, 29]]], dtype=np.uint8) + +a_scale = np.array([0.0066], dtype=np.float32) +a_zero_point = np.array([113], dtype=np.uint8) + +b = np.array([[[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]], + [[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]]], dtype=np.uint8) + +b_scale = np.array([0.00705], dtype=np.float32) +b_zero_point = np.array([114], dtype=np.uint8) + +y_scale = np.array([0.0107], dtype=np.float32) +y_zero_point = np.array([118], dtype=np.uint8) + +output = np.array([[[168, 115, 255], + [1, 66, 151]], + [[168, 115, 255], + [1, 66, 151]]], dtype=np.uint8) + +expect(node, inputs=[a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearmatmul_3D') +``` + +
+ + ### **QuantizeLinear** The linear per-tensor/layer quantization operator. It consumes a high precision tensor, a scale, a zero point to compute the low precision / quantized tensor. @@ -8315,6 +8523,28 @@ This version of the operator has been available since version 10 of the default +#### Examples + +
+quantizelinear + +```python +node = onnx.helper.make_node('QuantizeLinear', + inputs=['x', 'y_scale', 'y_zero_point'], + outputs=['y'],) + +x = np.array([0, 2, 3, 1000, -254, -1000]).astype(np.float32) +y_scale = np.array([2], dtype=np.float32) +y_zero_point = np.array([128], dtype=np.uint8) +y = np.array([128, 129, 130, 255, 1, 0]).astype(np.uint8) + +expect(node, inputs=[x, y_scale, y_zero_point], outputs=[y], + name='test_quantizelinear') +``` + +
+ + ### **RNN** Computes an one-layer simple RNN. This operator is usually supported diff --git a/docs/TestCoverage.md b/docs/TestCoverage.md index 365d40d2c3b..b95aa62c0de 100644 --- a/docs/TestCoverage.md +++ b/docs/TestCoverage.md @@ -5,7 +5,7 @@ * [Overall Test Coverage](#overall-test-coverage) # Node Test Coverage ## Summary -Node tests have covered 115/128 (89.84%, 5 generators excluded) common operators. +Node tests have covered 121/128 (94.53%, 5 generators excluded) common operators. Node tests have covered 0/0 (N/A) experimental operators. @@ -1379,6 +1379,42 @@ expect(node_with_asymmetric_padding, inputs=[x, W], outputs=[y_with_asymmetric_p +### ConvInteger +There are 1 test cases, listed as following: +
+convinteger + +```python + +x = np.array([2, 3, 4, 5, 6, 7, 8, 9, 10]).astype(np.uint8).reshape((1, 1, 3, 3)) +x_zero_point = np.array([1]).astype(np.uint8) +w = np.array([1, 1, 1, 1]).astype(np.uint8).reshape((1, 1, 2, 2)) + +y = np.array([12, 16, 24, 28]).astype(np.int32).reshape(1, 1, 2, 2) + +# ConvInteger without padding +convinteger_node = onnx.helper.make_node('ConvInteger', + inputs=['x', 'w', 'x_zero_point'], + outputs=['y']) + +expect(convinteger_node, inputs=[x, w, x_zero_point], outputs=[y], + name='test_basic_convinteger') + +# ConvInteger with padding +y_with_padding = np.array([1, 3, 5, 3, 5, 12, 16, 9, 11, 24, 28, 15, 7, 15, 17, 9]).astype(np.int32).reshape((1, 1, 4, 4)) + +convinteger_node_with_padding = onnx.helper.make_node('ConvInteger', + inputs=['x', 'w', 'x_zero_point'], + outputs=['y'], + pads=[1, 1, 1, 1],) + +expect(convinteger_node_with_padding, inputs=[x, w, x_zero_point], outputs=[y_with_padding], + name='test_convinteger_with_padding') +``` + +
+ + ### ConvTranspose There are 6 test cases, listed as following:
@@ -1775,6 +1811,29 @@ expect(node, inputs=[x], outputs=[y],
+### DequantizeLinear +There are 1 test cases, listed as following: +
+dequantizelinear + +```python +node = onnx.helper.make_node('DequantizeLinear', + inputs=['x', 'x_scale', 'x_zero_point'], + outputs=['y'],) + +# scalar zero point and scale +x = np.array([0, 3, 128, 255]).astype(np.uint8) +x_scale = np.array([2], dtype=np.float32) +x_zero_point = np.array([128], dtype=np.uint8) +y = np.array([-256, -250, 0, 254], dtype=np.float32) + +expect(node, inputs=[x, x_scale, x_zero_point], outputs=[y], + name='test_dequantizelinear') +``` + +
+ + ### Div There are 2 test cases, listed as following:
@@ -3156,6 +3215,41 @@ expect(node, inputs=[a, b], outputs=[c],
+### MatMulInteger +There are 1 test cases, listed as following: +
+matmulinteger + +```python +node = onnx.helper.make_node('MatMulInteger', + inputs=['A', 'B', 'a_zero_point', 'b_zero_point'], + outputs=['Y'],) + +A = np.array([[11, 7, 3], + [10, 6, 2], + [9, 5, 1], + [8, 4, 0], ], dtype=np.uint8) + +a_zero_point = np.array([12], dtype=np.uint8) + +B = np.array([[1, 4], + [2, 5], + [3, 6], ], dtype=np.uint8) + +b_zero_point = np.array([0], dtype=np.uint8) + +output = np.array([[-38, -83], + [-44, -98], + [-50, -113], + [-56, -128], ], dtype=np.int32) + +expect(node, inputs=[A, B, a_zero_point, b_zero_point], outputs=[output], + name='test_matmulinteger') +``` + +
+ + ### Max There are 1 test cases, listed as following:
@@ -4208,6 +4302,142 @@ expect(node, inputs=[x, y], outputs=[z],
+### QLinearConv +There are 1 test cases, listed as following: +
+qlinearconv + +```python +node = onnx.helper.make_node('QLinearConv', + inputs=['x', 'x_scale', 'x_zero_point', 'w', 'w_scale', 'w_zero_point', 'y_scale', 'y_zero_point'], + outputs=['y'],) + +x = np.array([[255, 174, 162, 25, 203, 168, 58], + [15, 59, 237, 95, 129, 0, 64], + [56, 242, 153, 221, 168, 12, 166], + [232, 178, 186, 195, 237, 162, 237], + [188, 39, 124, 77, 80, 102, 43], + [127, 230, 21, 83, 41, 40, 134], + [255, 154, 92, 141, 42, 148, 247], ], dtype=np.uint8).reshape((1, 1, 7, 7)) + +x_scale = np.array([0.00369204697], dtype=np.float32) +x_zero_point = np.array([132], dtype=np.uint8) + +w = np.array([0], dtype=np.uint8).reshape((1, 1, 1, 1)) + +w_scale = np.array([0.00172794575], dtype=np.float32) +w_zero_point = np.array([255], dtype=np.uint8) + +y_scale = np.array([0.00162681262], dtype=np.float32) +y_zero_point = np.array([123], dtype=np.uint8) + +output = np.array([[0, 81, 93, 230, 52, 87, 197], + [240, 196, 18, 160, 126, 255, 191], + [199, 13, 102, 34, 87, 243, 89], + [23, 77, 69, 60, 18, 93, 18], + [67, 216, 131, 178, 175, 153, 212], + [128, 25, 234, 172, 214, 215, 121], + [0, 101, 163, 114, 213, 107, 8], ], dtype=np.uint8).reshape((1, 1, 7, 7)) + +expect(node, inputs=[x, x_scale, x_zero_point, w, w_scale, w_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearconv') +``` + +
+ + +### QLinearMatMul +There are 1 test cases, listed as following: +
+qlinearmatmul + +```python +node = onnx.helper.make_node('QLinearMatMul', + inputs=['a', 'a_scale', 'a_zero_point', 'b', 'b_scale', 'b_zero_point', 'y_scale', 'y_zero_point'], + outputs=['y'],) + +#2D +a = np.array([[208, 236, 0, 238], + [3, 214, 255, 29], ], dtype=np.uint8) + +a_scale = np.array([0.0066], dtype=np.float32) +a_zero_point = np.array([113], dtype=np.uint8) + +b = np.array([[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]], dtype=np.uint8) + +b_scale = np.array([0.00705], dtype=np.float32) +b_zero_point = np.array([114], dtype=np.uint8) + +y_scale = np.array([0.0107], dtype=np.float32) +y_zero_point = np.array([118], dtype=np.uint8) + +output = np.array([[168, 115, 255], + [1, 66, 151], ], dtype=np.uint8) + +expect(node, inputs=[a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearmatmul_2D') + +#3D +a = np.array([[[208, 236, 0, 238], + [3, 214, 255, 29]], + [[208, 236, 0, 238], + [3, 214, 255, 29]]], dtype=np.uint8) + +a_scale = np.array([0.0066], dtype=np.float32) +a_zero_point = np.array([113], dtype=np.uint8) + +b = np.array([[[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]], + [[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]]], dtype=np.uint8) + +b_scale = np.array([0.00705], dtype=np.float32) +b_zero_point = np.array([114], dtype=np.uint8) + +y_scale = np.array([0.0107], dtype=np.float32) +y_zero_point = np.array([118], dtype=np.uint8) + +output = np.array([[[168, 115, 255], + [1, 66, 151]], + [[168, 115, 255], + [1, 66, 151]]], dtype=np.uint8) + +expect(node, inputs=[a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearmatmul_3D') +``` + +
+ + +### QuantizeLinear +There are 1 test cases, listed as following: +
+quantizelinear + +```python +node = onnx.helper.make_node('QuantizeLinear', + inputs=['x', 'y_scale', 'y_zero_point'], + outputs=['y'],) + +x = np.array([0, 2, 3, 1000, -254, -1000]).astype(np.float32) +y_scale = np.array([2], dtype=np.float32) +y_zero_point = np.array([128], dtype=np.uint8) +y = np.array([128, 129, 130, 255, 1, 0]).astype(np.uint8) + +expect(node, inputs=[x, y_scale, y_zero_point], outputs=[y], + name='test_quantizelinear') +``` + +
+ + ### RNN There are 3 test cases, listed as following:
@@ -7115,12 +7345,6 @@ expect(node, inputs=[x, y], outputs=[z],
## 💔No Cover Common Operators -### ConvInteger (call for test cases) - - -### DequantizeLinear (call for test cases) - - ### GlobalLpPool (call for test cases) @@ -7136,24 +7360,12 @@ expect(node, inputs=[x, y], outputs=[z], ### LpPool (call for test cases) -### MatMulInteger (call for test cases) - - ### MaxRoiPool (call for test cases) ### Multinomial (random generator operator) -### QLinearConv (call for test cases) - - -### QLinearMatMul (call for test cases) - - -### QuantizeLinear (call for test cases) - - ### RandomNormal (random generator operator) diff --git a/onnx/backend/test/case/node/convinteger.py b/onnx/backend/test/case/node/convinteger.py new file mode 100644 index 00000000000..58985abbbe0 --- /dev/null +++ b/onnx/backend/test/case/node/convinteger.py @@ -0,0 +1,40 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import numpy as np # type: ignore +import onnx +from ..base import Base +from . import expect + + +class ConvInteger(Base): + + @staticmethod + def export(): # type: () -> None + + x = np.array([2, 3, 4, 5, 6, 7, 8, 9, 10]).astype(np.uint8).reshape((1, 1, 3, 3)) + x_zero_point = np.array([1]).astype(np.uint8) + w = np.array([1, 1, 1, 1]).astype(np.uint8).reshape((1, 1, 2, 2)) + + y = np.array([12, 16, 24, 28]).astype(np.int32).reshape(1, 1, 2, 2) + + # ConvInteger without padding + convinteger_node = onnx.helper.make_node('ConvInteger', + inputs=['x', 'w', 'x_zero_point'], + outputs=['y']) + + expect(convinteger_node, inputs=[x, w, x_zero_point], outputs=[y], + name='test_basic_convinteger') + + # ConvInteger with padding + y_with_padding = np.array([1, 3, 5, 3, 5, 12, 16, 9, 11, 24, 28, 15, 7, 15, 17, 9]).astype(np.int32).reshape((1, 1, 4, 4)) + + convinteger_node_with_padding = onnx.helper.make_node('ConvInteger', + inputs=['x', 'w', 'x_zero_point'], + outputs=['y'], + pads=[1, 1, 1, 1],) + + expect(convinteger_node_with_padding, inputs=[x, w, x_zero_point], outputs=[y_with_padding], + name='test_convinteger_with_padding') diff --git a/onnx/backend/test/case/node/dequantizelinear.py b/onnx/backend/test/case/node/dequantizelinear.py new file mode 100644 index 00000000000..4dde6362e0c --- /dev/null +++ b/onnx/backend/test/case/node/dequantizelinear.py @@ -0,0 +1,27 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import numpy as np # type: ignore +import onnx +from ..base import Base +from . import expect + + +class DequantizeLinear(Base): + + @staticmethod + def export(): # type: () -> None + node = onnx.helper.make_node('DequantizeLinear', + inputs=['x', 'x_scale', 'x_zero_point'], + outputs=['y'],) + + # scalar zero point and scale + x = np.array([0, 3, 128, 255]).astype(np.uint8) + x_scale = np.array([2], dtype=np.float32) + x_zero_point = np.array([128], dtype=np.uint8) + y = np.array([-256, -250, 0, 254], dtype=np.float32) + + expect(node, inputs=[x, x_scale, x_zero_point], outputs=[y], + name='test_dequantizelinear') diff --git a/onnx/backend/test/case/node/matmulinteger.py b/onnx/backend/test/case/node/matmulinteger.py new file mode 100644 index 00000000000..99b8b20e844 --- /dev/null +++ b/onnx/backend/test/case/node/matmulinteger.py @@ -0,0 +1,39 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import numpy as np # type: ignore +import onnx +from ..base import Base +from . import expect + + +class MatMulInteger(Base): + + @staticmethod + def export(): # type: () -> None + node = onnx.helper.make_node('MatMulInteger', + inputs=['A', 'B', 'a_zero_point', 'b_zero_point'], + outputs=['Y'],) + + A = np.array([[11, 7, 3], + [10, 6, 2], + [9, 5, 1], + [8, 4, 0], ], dtype=np.uint8) + + a_zero_point = np.array([12], dtype=np.uint8) + + B = np.array([[1, 4], + [2, 5], + [3, 6], ], dtype=np.uint8) + + b_zero_point = np.array([0], dtype=np.uint8) + + output = np.array([[-38, -83], + [-44, -98], + [-50, -113], + [-56, -128], ], dtype=np.int32) + + expect(node, inputs=[A, B, a_zero_point, b_zero_point], outputs=[output], + name='test_matmulinteger') diff --git a/onnx/backend/test/case/node/qlinearconv.py b/onnx/backend/test/case/node/qlinearconv.py new file mode 100644 index 00000000000..e860e50cfb7 --- /dev/null +++ b/onnx/backend/test/case/node/qlinearconv.py @@ -0,0 +1,48 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import numpy as np # type: ignore +import onnx +from ..base import Base +from . import expect + + +class QLinearConv(Base): + + @staticmethod + def export(): # type: () -> None + node = onnx.helper.make_node('QLinearConv', + inputs=['x', 'x_scale', 'x_zero_point', 'w', 'w_scale', 'w_zero_point', 'y_scale', 'y_zero_point'], + outputs=['y'],) + + x = np.array([[255, 174, 162, 25, 203, 168, 58], + [15, 59, 237, 95, 129, 0, 64], + [56, 242, 153, 221, 168, 12, 166], + [232, 178, 186, 195, 237, 162, 237], + [188, 39, 124, 77, 80, 102, 43], + [127, 230, 21, 83, 41, 40, 134], + [255, 154, 92, 141, 42, 148, 247], ], dtype=np.uint8).reshape((1, 1, 7, 7)) + + x_scale = np.array([0.00369204697], dtype=np.float32) + x_zero_point = np.array([132], dtype=np.uint8) + + w = np.array([0], dtype=np.uint8).reshape((1, 1, 1, 1)) + + w_scale = np.array([0.00172794575], dtype=np.float32) + w_zero_point = np.array([255], dtype=np.uint8) + + y_scale = np.array([0.00162681262], dtype=np.float32) + y_zero_point = np.array([123], dtype=np.uint8) + + output = np.array([[0, 81, 93, 230, 52, 87, 197], + [240, 196, 18, 160, 126, 255, 191], + [199, 13, 102, 34, 87, 243, 89], + [23, 77, 69, 60, 18, 93, 18], + [67, 216, 131, 178, 175, 153, 212], + [128, 25, 234, 172, 214, 215, 121], + [0, 101, 163, 114, 213, 107, 8], ], dtype=np.uint8).reshape((1, 1, 7, 7)) + + expect(node, inputs=[x, x_scale, x_zero_point, w, w_scale, w_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearconv') diff --git a/onnx/backend/test/case/node/qlinearmatmul.py b/onnx/backend/test/case/node/qlinearmatmul.py new file mode 100644 index 00000000000..b58418c7da1 --- /dev/null +++ b/onnx/backend/test/case/node/qlinearmatmul.py @@ -0,0 +1,74 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import numpy as np # type: ignore +import onnx +from ..base import Base +from . import expect + + +class QLinearMatMul(Base): + + @staticmethod + def export(): # type: () -> None + node = onnx.helper.make_node('QLinearMatMul', + inputs=['a', 'a_scale', 'a_zero_point', 'b', 'b_scale', 'b_zero_point', 'y_scale', 'y_zero_point'], + outputs=['y'],) + + #2D + a = np.array([[208, 236, 0, 238], + [3, 214, 255, 29], ], dtype=np.uint8) + + a_scale = np.array([0.0066], dtype=np.float32) + a_zero_point = np.array([113], dtype=np.uint8) + + b = np.array([[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]], dtype=np.uint8) + + b_scale = np.array([0.00705], dtype=np.float32) + b_zero_point = np.array([114], dtype=np.uint8) + + y_scale = np.array([0.0107], dtype=np.float32) + y_zero_point = np.array([118], dtype=np.uint8) + + output = np.array([[168, 115, 255], + [1, 66, 151], ], dtype=np.uint8) + + expect(node, inputs=[a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearmatmul_2D') + + #3D + a = np.array([[[208, 236, 0, 238], + [3, 214, 255, 29]], + [[208, 236, 0, 238], + [3, 214, 255, 29]]], dtype=np.uint8) + + a_scale = np.array([0.0066], dtype=np.float32) + a_zero_point = np.array([113], dtype=np.uint8) + + b = np.array([[[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]], + [[152, 51, 244], + [60, 26, 255], + [0, 127, 246], + [127, 254, 247]]], dtype=np.uint8) + + b_scale = np.array([0.00705], dtype=np.float32) + b_zero_point = np.array([114], dtype=np.uint8) + + y_scale = np.array([0.0107], dtype=np.float32) + y_zero_point = np.array([118], dtype=np.uint8) + + output = np.array([[[168, 115, 255], + [1, 66, 151]], + [[168, 115, 255], + [1, 66, 151]]], dtype=np.uint8) + + expect(node, inputs=[a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point], outputs=[output], + name='test_qlinearmatmul_3D') diff --git a/onnx/backend/test/case/node/quantizelinear.py b/onnx/backend/test/case/node/quantizelinear.py new file mode 100644 index 00000000000..8fdfdc0e357 --- /dev/null +++ b/onnx/backend/test/case/node/quantizelinear.py @@ -0,0 +1,26 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import numpy as np # type: ignore +import onnx +from ..base import Base +from . import expect + + +class QuantizeLinear(Base): + + @staticmethod + def export(): # type: () -> None + node = onnx.helper.make_node('QuantizeLinear', + inputs=['x', 'y_scale', 'y_zero_point'], + outputs=['y'],) + + x = np.array([0, 2, 3, 1000, -254, -1000]).astype(np.float32) + y_scale = np.array([2], dtype=np.float32) + y_zero_point = np.array([128], dtype=np.uint8) + y = np.array([128, 129, 130, 255, 1, 0]).astype(np.uint8) + + expect(node, inputs=[x, y_scale, y_zero_point], outputs=[y], + name='test_quantizelinear') diff --git a/onnx/backend/test/data/node/test_basic_convinteger/model.onnx b/onnx/backend/test/data/node/test_basic_convinteger/model.onnx new file mode 100644 index 00000000000..aa2dc867604 --- /dev/null +++ b/onnx/backend/test/data/node/test_basic_convinteger/model.onnx @@ -0,0 +1,27 @@ + backend-test: +$ +x +w + x_zero_pointy" ConvIntegertest_basic_convintegerZ +x + + + + +Z +w + + + + +Z + x_zero_point + + +b +y + + + + +B diff --git a/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_0.pb new file mode 100644 index 00000000000..33cea026337 --- /dev/null +++ b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_0.pb @@ -0,0 +1 @@ +BxJ  diff --git a/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_1.pb b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_1.pb new file mode 100644 index 00000000000..53980d95daf --- /dev/null +++ b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_1.pb @@ -0,0 +1 @@ +BwJ \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_2.pb b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_2.pb new file mode 100644 index 00000000000..2ecc7658422 --- /dev/null +++ b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/input_2.pb @@ -0,0 +1 @@ +B x_zero_pointJ \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_basic_convinteger/test_data_set_0/output_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..f81e5d710a91899b37606a98aa72430f9294db0b GIT binary patch literal 31 hcmd;JuZS;BPRvR5VqsulZ~y=$6a&!! literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/input_2.pb b/onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/input_2.pb new file mode 100644 index 00000000000..dcfed4bc8f3 --- /dev/null +++ b/onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/input_2.pb @@ -0,0 +1 @@ +B x_zero_pointJ \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_dequantizelinear/test_data_set_0/output_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..f248d253c539a7a1a7f9a95d20cca2fdbacc0bf6 GIT binary patch literal 25 ccmd;J5nyy;tn?CKU}!kZz)%ImAW-KF05wSjbpQYW literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_matmulinteger/model.onnx b/onnx/backend/test/data/node/test_matmulinteger/model.onnx new file mode 100644 index 00000000000..227661bbb82 --- /dev/null +++ b/onnx/backend/test/data/node/test_matmulinteger/model.onnx @@ -0,0 +1,26 @@ + backend-test: +4 +A +B + a_zero_point + b_zero_pointY" MatMulIntegertest_matmulintegerZ +A +  + +Z +B +  + +Z + a_zero_point + + +Z + b_zero_point + + +b +Y +  + +B diff --git a/onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..abf965a2060ab6958cec23382e2e551d146b3f4e GIT binary patch literal 23 ecmd;J;b0bEa$VzW@LL literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/output_0.pb new file mode 100644 index 00000000000..ad39e94c6cb --- /dev/null +++ b/onnx/backend/test/data/node/test_matmulinteger/test_data_set_0/output_0.pb @@ -0,0 +1 @@ +BYJ \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearconv/model.onnx b/onnx/backend/test/data/node/test_qlinearconv/model.onnx new file mode 100644 index 00000000000..029cab53684 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearconv/model.onnx @@ -0,0 +1,52 @@ + backend-test: +[ +x +x_scale + x_zero_point +w +w_scale + w_zero_point +y_scale + y_zero_pointy" QLinearConvtest_qlinearconvZ +x + + + + +Z +x_scale + + +Z + x_zero_point + + +Z +w + + + + +Z +w_scale + + +Z + w_zero_point + + +Z +y_scale + + +Z + y_zero_point + + +b +y + + + + +B diff --git a/onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_qlinearconv/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..8e5c824a88ddfc7944562764090124fc4b6b3085 GIT binary patch literal 64 zcmV-G0KfkT0SEyI2M7lc0zv_JN-_Vgq8ZDmIuASTUx5HXIP#g@s0^m)vbw|VqV2pV Wd`(bhD}Uw{Qzs8SMymHO+`EsT@pjs WgR-xg)PNc4tk&0g0A-_c)oTckfEefi literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_2D/model.onnx b/onnx/backend/test/data/node/test_qlinearmatmul_2D/model.onnx new file mode 100644 index 00000000000..61abcb4abc8 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_2D/model.onnx @@ -0,0 +1,46 @@ + backend-test: +] +a +a_scale + a_zero_point +b +b_scale + b_zero_point +y_scale + y_zero_pointy" QLinearMatMultest_qlinearmatmul_2DZ +a +  + +Z +a_scale + + +Z + a_zero_point + + +Z +b +  + +Z +b_scale + + +Z + b_zero_point + + +Z +y_scale + + +Z + y_zero_point + + +b +y +  + +B diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..eb9265d86e91ae7953b15572d8dc688ea9f4379f GIT binary patch literal 19 acmd;J;$RVAa$-#M;<)gJ;T`j}|FQrhqXoVI literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_1.pb b/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_1.pb new file mode 100644 index 00000000000..53c894041c8 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_1.pb @@ -0,0 +1 @@ +Ba_scaleJD; \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_2.pb b/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_2.pb new file mode 100644 index 00000000000..9cc71b95752 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_2.pb @@ -0,0 +1 @@ +B a_zero_pointJq \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_3.pb b/onnx/backend/test/data/node/test_qlinearmatmul_2D/test_data_set_0/input_3.pb new file mode 100644 index 0000000000000000000000000000000000000000..ea04e209a075a526be8ad795948fb95c7d2fb018 GIT binary patch literal 23 ecmd;J;b0bEa$-#K;+bLm#YXBsL;bhO!AVLVf@8L>OVvMxB7qIk=X#nZx1y9 literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_4.pb b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_4.pb new file mode 100644 index 00000000000..e5f59fb92a7 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_4.pb @@ -0,0 +1 @@ +Bb_scaleJ; \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_5.pb b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_5.pb new file mode 100644 index 00000000000..db93763b2d4 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_5.pb @@ -0,0 +1 @@ +B b_zero_pointJr \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_6.pb b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_6.pb new file mode 100644 index 00000000000..3128ded3d7b --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_6.pb @@ -0,0 +1 @@ +By_scaleJO/< \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_7.pb b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_7.pb new file mode 100644 index 00000000000..521faf834e0 --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/input_7.pb @@ -0,0 +1 @@ +B y_zero_pointJv \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/output_0.pb new file mode 100644 index 00000000000..e69395115ec --- /dev/null +++ b/onnx/backend/test/data/node/test_qlinearmatmul_3D/test_data_set_0/output_0.pb @@ -0,0 +1 @@ +ByJ sBsB \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_quantizelinear/model.onnx b/onnx/backend/test/data/node/test_quantizelinear/model.onnx new file mode 100644 index 00000000000..a601e9fcdc9 --- /dev/null +++ b/onnx/backend/test/data/node/test_quantizelinear/model.onnx @@ -0,0 +1,21 @@ + backend-test: +- +x +y_scale + y_zero_pointy"QuantizeLineartest_quantizelinearZ +x + + +Z +y_scale + + +Z + y_zero_point + + +b +y + + +B diff --git a/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_0.pb b/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..c1a28ac2dc128899da52b51a7e6856df3e5cedbf GIT binary patch literal 33 hcmd;J6JT^=tniXxfB**u1_vOna$#VoI}D_c002C+1v&r# literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_1.pb b/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_1.pb new file mode 100644 index 0000000000000000000000000000000000000000..aac5df2f0fa35977049aacea26125f88da76f9a0 GIT binary patch literal 19 acmd;J6kv2>uZ%BFPRvR5VqsulZ~y=$Ap_C? literal 0 HcmV?d00001 diff --git a/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_2.pb b/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_2.pb new file mode 100644 index 00000000000..b1fa5f9d3f4 --- /dev/null +++ b/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/input_2.pb @@ -0,0 +1 @@ +B y_zero_pointJ \ No newline at end of file diff --git a/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/output_0.pb b/onnx/backend/test/data/node/test_quantizelinear/test_data_set_0/output_0.pb new file mode 100644 index 0000000000000000000000000000000000000000..5703f727f490350be6b6521dd3adafb2cb0a2393 GIT binary patch literal 15 Wcmd;J6JT;;tn^}QXl(k=$N&Hp>I1L< literal 0 HcmV?d00001