onnxruntime/test/providers/cpu/tensor/upsample_op_test.cc
// Disable TensorRT on some of the tests because TensorRT only supports "nearest" mode Upsample and limited data types
Disable TensorRT on some of the tests because TensorRT only supports "nearest" mode Upsample and limited data types
Disable TensorRT on some of the tests because TensorRT only supports " nearest " mode Upsample and limited data types
TEST(UpsampleOpTest, UpsampleOpNearestTest) {
  OpTester test("Upsample");
  std::vector<float> scales{1.0f, 1.0f, 2.0f, 3.0f};
  test.AddAttribute("mode", "nearest");
  test.AddAttribute("scales", scales);
  const int64_t N = 1, C = 2, H = 2, W = 2;
  std::vector<float> X = {1.0f, 3.0f,
                          3.0f, 5.0f,
                          3.0f, 5.0f,
                          7.0f, 9.0f};
  test.AddInput<float>("X", {N, C, H, W}, X);
  std::vector<float> Y = {
      1.0f, 1.0f, 1.0f, 3.0f, 3.0f, 3.0f,
      1.0f, 1.0f, 1.0f, 3.0f, 3.0f, 3.0f,
      3.0f, 3.0f, 3.0f, 5.0f, 5.0f, 5.0f,
      3.0f, 3.0f, 3.0f, 5.0f, 5.0f, 5.0f,
      3.0f, 3.0f, 3.0f, 5.0f, 5.0f, 5.0f,
      3.0f, 3.0f, 3.0f, 5.0f, 5.0f, 5.0f,
      7.0f, 7.0f, 7.0f, 9.0f, 9.0f, 9.0f,
      7.0f, 7.0f, 7.0f, 9.0f, 9.0f, 9.0f};
  test.AddOutput<float>("Y", {N, C, (int64_t)(H * scales[2]), (int64_t)(W * scales[3])}, Y);
  test.Run();
}
TEST ( UpsampleOpTest , UpsampleOpNearestTest ) { OpTester test ( " " ) ; std :: vector < float > scales { 1.0f , 1.0f , 2.0f , 3.0f } ; test . AddAttribute ( " " , " " ) ; test . AddAttribute ( " " , scales ) ; const int64_t N = 1 , C = 2 , H = 2 , W = 2 ; std :: vector < float > X = { 1.0f , 3.0f , 3.0f , 5.0f , 3.0f , 5.0f , 7.0f , 9.0f } ; test . AddInput < float > ( " " , { N , C , H , W } , X ) ; std :: vector < float > Y = { 1.0f , 1.0f , 1.0f , 3.0f , 3.0f , 3.0f , 1.0f , 1.0f , 1.0f , 3.0f , 3.0f , 3.0f , 3.0f , 3.0f , 3.0f , 5.0f , 5.0f , 5.0f , 3.0f , 3.0f , 3.0f , 5.0f , 5.0f , 5.0f , 3.0f , 3.0f , 3.0f , 5.0f , 5.0f , 5.0f , 3.0f , 3.0f , 3.0f , 5.0f , 5.0f , 5.0f , 7.0f , 7.0f , 7.0f , 9.0f , 9.0f , 9.0f , 7.0f , 7.0f , 7.0f , 9.0f , 9.0f , 9.0f } ; test . AddOutput < float > ( " " , { N , C , ( int64_t ) ( H * scales [ 2 ] ) , ( int64_t ) ( W * scales [ 3 ] ) } , Y ) ; test . Run ( ) ; }
Disable TensorRT on some of the tests because TensorRT only supports "nearest" mode Upsample and limited data types
Disable TensorRT on some of the tests because TensorRT only supports " nearest " mode Upsample and limited data types