diff --git a/include/tim/vx/ops/unmaxpool2d.h b/include/tim/vx/ops/maxunpool2d.h similarity index 88% rename from include/tim/vx/ops/unmaxpool2d.h rename to include/tim/vx/ops/maxunpool2d.h index a65b9d7..943985c 100644 --- a/include/tim/vx/ops/unmaxpool2d.h +++ b/include/tim/vx/ops/maxunpool2d.h @@ -21,8 +21,8 @@ * DEALINGS IN THE SOFTWARE. * *****************************************************************************/ -#ifndef TIM_VX_OPS_UNMAXPOOL2D_H_ -#define TIM_VX_OPS_UNMAXPOOL2D_H_ +#ifndef TIM_VX_OPS_MAXUNPOOL2D_H_ +#define TIM_VX_OPS_MAXUNPOOL2D_H_ #include @@ -34,7 +34,7 @@ namespace vx { namespace ops { /** - * ## UnMaxpool2d + * ## MaxUnpool2d * * Performs an 2-D Max pooling operation upsample * @@ -42,9 +42,9 @@ namespace ops { * - ksize : filter size. */ -class UnMaxpool2d : public Operation { +class MaxUnpool2d : public Operation { public: - UnMaxpool2d(Graph* graph, const std::array& ksize, + MaxUnpool2d(Graph* graph, const std::array& ksize, const std::array& stride, DataLayout layout = DataLayout::WHCN); protected: @@ -56,4 +56,4 @@ class UnMaxpool2d : public Operation { } // namespace vx } // namespace tim -#endif /* TIM_VX_OPS_UNMAXPOOL2D_H_ */ +#endif /* TIM_VX_OPS_MAXUNPOOL2D_H_ */ diff --git a/src/tim/vx/ops/README.md b/src/tim/vx/ops/README.md index c91b8b2..0e3afee 100644 --- a/src/tim/vx/ops/README.md +++ b/src/tim/vx/ops/README.md @@ -18,7 +18,7 @@ DeConv2d|DECONVOLUTION|Mapped|[tf.nn.conv2d_transpose](https://tensorflow.google Reshape|RESHAPE|Mapped|[tf.reshape](https://tensorflow.google.cn/api_docs/python/tf/reshape) Transpose|PERMUTE|Mapped|[tf.transpose](https://tensorflow.google.cn/api_docs/python/tf/transpose) Prelu|PRELU|Mapped|[tf.keras.layers.PReLU](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/PReLU) -UnMaxpool2d|UPSAMPLE|Mapped| Recover pixel from the outputs of MaxpoolWithArgmax. +MaxUnpool2d|UPSAMPLE|Mapped| Recover pixel from the outputs of MaxpoolWithArgmax. Relu|RELU|Mapped|[tf.nn.relu](https://tensorflow.google.cn/api_docs/python/tf/nn/relu) ||RELUN|Deprecated|[tf.keras.layers.ReLU(max_value=N)](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/ReLU) Reorg|REORG|Mapped|[darknet.reorg](https://github.com/pjreddie/darknet/blob/master/src/reorg_layer.c) diff --git a/src/tim/vx/ops/unmaxpool2d.cc b/src/tim/vx/ops/maxunpool2d.cc similarity index 95% rename from src/tim/vx/ops/unmaxpool2d.cc rename to src/tim/vx/ops/maxunpool2d.cc index 9da4166..a50e198 100644 --- a/src/tim/vx/ops/unmaxpool2d.cc +++ b/src/tim/vx/ops/maxunpool2d.cc @@ -21,7 +21,7 @@ * DEALINGS IN THE SOFTWARE. * *****************************************************************************/ -#include "tim/vx/ops/unmaxpool2d.h" +#include "tim/vx/ops/maxunpool2d.h" #include "operation_private.h" #include "type_utils.h" @@ -31,7 +31,7 @@ namespace tim { namespace vx { namespace ops { -UnMaxpool2d::UnMaxpool2d(Graph* graph, const std::array& ksize, +MaxUnpool2d::MaxUnpool2d(Graph* graph, const std::array& ksize, const std::array& stride, DataLayout layout) : Operation(graph, VSI_NN_OP_UPSAMPLE, 2, 1, layout), ksize_(ksize), stride_(stride) { diff --git a/src/tim/vx/ops/unmaxpool2d_test.cc b/src/tim/vx/ops/maxunpool2d_test.cc similarity index 94% rename from src/tim/vx/ops/unmaxpool2d_test.cc rename to src/tim/vx/ops/maxunpool2d_test.cc index 61e3b45..4704ec0 100644 --- a/src/tim/vx/ops/unmaxpool2d_test.cc +++ b/src/tim/vx/ops/maxunpool2d_test.cc @@ -23,11 +23,11 @@ *****************************************************************************/ #include "tim/vx/context.h" #include "tim/vx/graph.h" -#include "tim/vx/ops/unmaxpool2d.h" +#include "tim/vx/ops/maxunpool2d.h" #include "gtest/gtest.h" -TEST(UnMaxpool2d, shape_2_2_1_fp32_kernel_2_stride_2) { +TEST(MaxUnpool2d, shape_2_2_1_fp32_kernel_2_stride_2) { auto ctx = tim::vx::Context::Create(); auto graph = ctx->CreateGraph(); @@ -59,7 +59,7 @@ TEST(UnMaxpool2d, shape_2_2_1_fp32_kernel_2_stride_2) { EXPECT_TRUE(indices_tensor->CopyDataToTensor(indices.data(), indices.size()*4)); std::array ksize = {2, 2}; std::array stride = {2, 2}; - auto op = graph->CreateOperation(ksize, stride); + auto op = graph->CreateOperation(ksize, stride); (*op).BindInputs({values_tensor, indices_tensor}).BindOutputs({output_tensor}); EXPECT_TRUE(graph->Compile()); @@ -70,7 +70,7 @@ TEST(UnMaxpool2d, shape_2_2_1_fp32_kernel_2_stride_2) { EXPECT_EQ(golden, output); } -TEST(UnMaxpool2d, shape_2_2_1_uint8_kernel_2_stride_2) { +TEST(MaxUnpool2d, shape_2_2_1_uint8_kernel_2_stride_2) { auto ctx = tim::vx::Context::Create(); auto graph = ctx->CreateGraph(); @@ -104,7 +104,7 @@ TEST(UnMaxpool2d, shape_2_2_1_uint8_kernel_2_stride_2) { EXPECT_TRUE(indices_tensor->CopyDataToTensor(indices.data(), indices.size())); std::array ksize = {2, 2}; std::array stride = {2, 2}; - auto op = graph->CreateOperation(ksize, stride); + auto op = graph->CreateOperation(ksize, stride); (*op).BindInputs({values_tensor, indices_tensor}).BindOutputs({output_tensor}); EXPECT_TRUE(graph->Compile());