From: 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Mon, 24 Jun 2019 00:07:11 +0000 (+0900) Subject: [moco/tf] revise test for shape inf feature (#3931) X-Git-Tag: nncc_backup~304 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bc405ca9dd6bc9cc18ca606c5675072e316c86d;p=platform%2Fcore%2Fml%2Fnnfw.git [moco/tf] revise test for shape inf feature (#3931) This will revise feature_shape accessors test in shape inference data to remove implementation detail and focus on interface testing Signed-off-by: SaeHie Park --- diff --git a/contrib/moco/lib/frontend/tf/src/Annotations/ShapeInferenceData.test.cpp b/contrib/moco/lib/frontend/tf/src/Annotations/ShapeInferenceData.test.cpp index 700a340..54c885b 100644 --- a/contrib/moco/lib/frontend/tf/src/Annotations/ShapeInferenceData.test.cpp +++ b/contrib/moco/lib/frontend/tf/src/Annotations/ShapeInferenceData.test.cpp @@ -37,45 +37,25 @@ TEST(TensorFlowFrontend, shapeinferencedata_tensor_get) ASSERT_EQ(tensor.dim(3), 4); } -TEST(TensorFlowFrontend, shapeinferencedata_feature_set) +TEST(TensorFlowFrontend, shapeinferencedata_feature) { - loco::FeatureShape feature; + loco::FeatureShape feature_s; - feature.count() = 1; - feature.height() = 2; - feature.width() = 3; - feature.depth() = 4; + feature_s.count() = 1; + feature_s.height() = 2; + feature_s.width() = 3; + feature_s.depth() = 4; moco::tf::ShapeInferenceData shapedata; - shapedata.feature_shape(feature); + shapedata.feature_shape(feature_s); - ASSERT_EQ(shapedata.rank(), 4); - ASSERT_EQ(shapedata.dim(0), 1); - ASSERT_EQ(shapedata.dim(1), 2); - ASSERT_EQ(shapedata.dim(2), 3); - ASSERT_EQ(shapedata.dim(3), 4); -} - -TEST(TensorFlowFrontend, shapeinferencedata_feature_get) -{ - moco::tf::ShapeInferenceData shapedata; - loco::FeatureShape dummy; - - shapedata.feature_shape(dummy); // this is to set domain to feature - - shapedata.rank(4); - shapedata.dim(0) = 1; - shapedata.dim(1) = 2; - shapedata.dim(2) = 3; - shapedata.dim(3) = 4; - - loco::FeatureShape feature = shapedata.feature_shape(); + loco::FeatureShape feature_g = shapedata.feature_shape(); - ASSERT_EQ(feature.count(), 1); - ASSERT_EQ(feature.height(), 2); - ASSERT_EQ(feature.width(), 3); - ASSERT_EQ(feature.depth(), 4); + ASSERT_EQ(feature_g.count(), 1); + ASSERT_EQ(feature_g.height(), 2); + ASSERT_EQ(feature_g.width(), 3); + ASSERT_EQ(feature_g.depth(), 4); } TEST(TensorFlowFrontend, shapeinferencedata_filter)