From 8bc405ca9dd6bc9cc18ca606c5675072e316c86d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 24 Jun 2019 09:07:11 +0900 Subject: [PATCH] [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 --- .../tf/src/Annotations/ShapeInferenceData.test.cpp | 44 ++++++---------------- 1 file changed, 12 insertions(+), 32 deletions(-) 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) -- 2.7.4