[enco] Remove CanonicalAxisIndex (#1468)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 12 Sep 2018 07:43:22 +0000 (16:43 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 12 Sep 2018 07:43:22 +0000 (16:43 +0900)
CanonicalAxisIndex is currently just a wrapper of ShapeQuery.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/frontend/caffe/src/ConvolutionSpec.cpp

index c06678c..ae38ed5 100644 (file)
@@ -3,36 +3,6 @@
 
 #include <cassert>
 
-namespace
-{
-
-/**
- * @breif Infer (positive) channel axis from channel axis specifier (which may be negative)
- *
- * NOTE This implementation SHOULD be aligned with CanonicalAxisIndex method in ::caffe::Blob
- */
-class CanonicalChannelAxis
-{
-public:
-  CanonicalChannelAxis(int32_t axis) : _axis{axis}
-  {
-    // DO NOTHING
-  }
-
-public:
-  uint32_t eval(const nncc::core::ADT::tensor::Shape &ifm) const
-  {
-    return query_on(ifm).axis(axis_specifier(_axis));
-  }
-
-private:
-  int32_t _axis;
-};
-
-CanonicalChannelAxis canonical_channel_axis(int32_t axis) { return CanonicalChannelAxis{axis}; }
-
-} // namespace
-
 ConvolutionSpec::ConvolutionSpec(const ::caffe::ConvolutionParameter &param) : _param(param)
 {
   // NOTE Dilation is not supported, yet
@@ -46,7 +16,7 @@ ConvolutionSpec::ConvolutionSpec(const ::caffe::ConvolutionParameter &param) : _
 
 uint32_t ConvolutionSpec::channel_axis(void) const
 {
-  return canonical_channel_axis(_param.axis()).eval(ifm_shape());
+  return query_on(ifm_shape()).axis(axis_specifier(_param.axis()));
 }
 
 uint32_t ConvolutionSpec::pad(uint32_t spatial_axis) const