44TEST(ShapeInferenceTest, ReshapeAutoDimension)
48 Shape input_shape{10, 2, 5};
49 Shape expected_shape{10, 1, 10};
58TEST(ShapeInferenceTest, ResizeWithShape)
62 Shape result_shape{2, 10, 10, 3};
68 ops::ResizeOp::ResizeMethod::nearestNeighbor, result_shape);
73TEST(ShapeInferenceTest, ResizeWithScale)
77 Shape result_shape{1, 30, 10, 3};
83 g.create<
ops::ResizeOp>(input->getOutput(0), ops::ResizeOp::ResizeMethod::nearestNeighbor,
84 std::vector<float>{1, 6, 2, 1});
89TEST(ShapeInferenceTest, ReduceChangeRank)
93 Shape resultShape{10, 10};
98 auto n = g.create<
ops::ReduceMeanOp>(input->getOutput(0), std::vector<int32_t>{1, 3},
false);
117TEST(ShapeInferenceTest, ReshapeAutoDimensionExpand)
121 Shape input_shape{10, 2, 10};
122 Shape result_shape_expand{5, 10, 2, 2};
131TEST(ShapeInferenceTest, ReshapeAutoDimensionUnsqueeze)
135 Shape input_shape{10, 2, 10};
136 Shape result_shape_expand{1, 10, 2, 1, 10, 1};
140 auto op = g.create<
ops::ReshapeOp>(input->getOutput(0),
Shape{1, Shape::autoDim, 2, 1, 10, 1});
159TEST(ShapeInferenceTest, ElementwiseBC)
163 Shape input_shape{1, 10, 10, 1};
164 Shape input2_shape{1, 1, 10, 10};
174 ASSERT_EQ(add->getOutputShape(0),
Shape({1, 10, 10, 10}));