onnxruntime/test/contrib_ops/quantize_linear_test.cc
TEST(DequantizeLinearOpTest, DequantizeLinear_5) {
  OpTester test("DequantizeLinear", 1, onnxruntime::kMSDomain);
  std::vector<int64_t> dims{3, 4};
  test.AddInput<uint8_t>("X", dims,
                         {0, 1, 2, 3,
                          0, 1, 2, 3,
                          0, 10, 20, 30});
  test.AddAttribute<int64_t>("axis", -2);
  test.AddInput<float>("scale", {3},
                       {1.0f,
                        2.0f,
                        4.0f});
  test.AddInput<uint8_t>("zero_point", {3},
                         {0,
                          0,
                          0});
  test.AddOutput<float>("Y", dims,
                        {0, 1, 2, 3,
                         0, 2, 4, 6,
                         0, 40, 80, 120});
  test.Run();
}
// 1d zero & scale with uint8 broadcast axis -2 (-2 resolves to axis 0)
1d zero & scale with uint8 broadcast axis -2 (-2 resolves to axis 0)
1d zero & scale with uint8 broadcast axis - 2 ( - 2 resolves to axis 0 )
TEST(DequantizeLinearOpTest, DequantizeLinear_5) {
  OpTester test("DequantizeLinear", 1, onnxruntime::kMSDomain);
  std::vector<int64_t> dims{3, 4};
  test.AddInput<uint8_t>("X", dims,
                         {0, 1, 2, 3,
                          0, 1, 2, 3,
                          0, 10, 20, 30});
  test.AddAttribute<int64_t>("axis", -2);
  test.AddInput<float>("scale", {3},
                       {1.0f,
                        2.0f,
                        4.0f});
  test.AddInput<uint8_t>("zero_point", {3},
                         {0,
                          0,
                          0});
  test.AddOutput<float>("Y", dims,
                        {0, 1, 2, 3,
                         0, 2, 4, 6,
                         0, 40, 80, 120});
  test.Run();
}
TEST ( DequantizeLinearOpTest , DequantizeLinear_5 ) { OpTester test ( " " , 1 , onnxruntime :: kMSDomain ) ; std :: vector < int64_t > dims { 3 , 4 } ; test . AddInput < uint8_t > ( " " , dims , { 0 , 1 , 2 , 3 , 0 , 1 , 2 , 3 , 0 , 10 , 20 , 30 } ) ; test . AddAttribute < int64_t > ( " " , -2 ) ; test . AddInput < float > ( " " , { 3 } , { 1.0f , 2.0f , 4.0f } ) ; test . AddInput < uint8_t > ( " " , { 3 } , { 0 , 0 , 0 } ) ; test . AddOutput < float > ( " " , dims , { 0 , 1 , 2 , 3 , 0 , 2 , 4 , 6 , 0 , 40 , 80 , 120 } ) ; test . Run ( ) ; }
1d zero & scale with uint8 broadcast axis -2 (-2 resolves to axis 0)
1d zero & scale with uint8 broadcast axis - 2 ( - 2 resolves to axis 0 )