Rename Unmaxpool2d to MaxUnpool2d
Signed-off-by: zhao.xia <zhao.xia@verisilicon.com> Signed-off-by: Kainan Cha <kainan.zha@verisilicon.com>
This commit is contained in:
parent
9c60671031
commit
26948d6646
|
|
@ -21,8 +21,8 @@
|
||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#ifndef TIM_VX_OPS_UNMAXPOOL2D_H_
|
#ifndef TIM_VX_OPS_MAXUNPOOL2D_H_
|
||||||
#define TIM_VX_OPS_UNMAXPOOL2D_H_
|
#define TIM_VX_OPS_MAXUNPOOL2D_H_
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace vx {
|
||||||
namespace ops {
|
namespace ops {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## UnMaxpool2d
|
* ## MaxUnpool2d
|
||||||
*
|
*
|
||||||
* Performs an 2-D Max pooling operation upsample
|
* Performs an 2-D Max pooling operation upsample
|
||||||
*
|
*
|
||||||
|
|
@ -42,9 +42,9 @@ namespace ops {
|
||||||
* - ksize : filter size.
|
* - ksize : filter size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class UnMaxpool2d : public Operation {
|
class MaxUnpool2d : public Operation {
|
||||||
public:
|
public:
|
||||||
UnMaxpool2d(Graph* graph, const std::array<uint32_t, 2>& ksize,
|
MaxUnpool2d(Graph* graph, const std::array<uint32_t, 2>& ksize,
|
||||||
const std::array<uint32_t, 2>& stride, DataLayout layout = DataLayout::WHCN);
|
const std::array<uint32_t, 2>& stride, DataLayout layout = DataLayout::WHCN);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -56,4 +56,4 @@ class UnMaxpool2d : public Operation {
|
||||||
} // namespace vx
|
} // namespace vx
|
||||||
} // namespace tim
|
} // namespace tim
|
||||||
|
|
||||||
#endif /* TIM_VX_OPS_UNMAXPOOL2D_H_ */
|
#endif /* TIM_VX_OPS_MAXUNPOOL2D_H_ */
|
||||||
|
|
@ -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)
|
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)
|
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)
|
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)
|
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)
|
||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)
|
Reorg|REORG|Mapped|[darknet.reorg](https://github.com/pjreddie/darknet/blob/master/src/reorg_layer.c)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include "tim/vx/ops/unmaxpool2d.h"
|
#include "tim/vx/ops/maxunpool2d.h"
|
||||||
|
|
||||||
#include "operation_private.h"
|
#include "operation_private.h"
|
||||||
#include "type_utils.h"
|
#include "type_utils.h"
|
||||||
|
|
@ -31,7 +31,7 @@ namespace tim {
|
||||||
namespace vx {
|
namespace vx {
|
||||||
namespace ops {
|
namespace ops {
|
||||||
|
|
||||||
UnMaxpool2d::UnMaxpool2d(Graph* graph, const std::array<uint32_t, 2>& ksize,
|
MaxUnpool2d::MaxUnpool2d(Graph* graph, const std::array<uint32_t, 2>& ksize,
|
||||||
const std::array<uint32_t, 2>& stride, DataLayout layout)
|
const std::array<uint32_t, 2>& stride, DataLayout layout)
|
||||||
: Operation(graph, VSI_NN_OP_UPSAMPLE, 2, 1, layout),
|
: Operation(graph, VSI_NN_OP_UPSAMPLE, 2, 1, layout),
|
||||||
ksize_(ksize), stride_(stride) {
|
ksize_(ksize), stride_(stride) {
|
||||||
|
|
@ -23,11 +23,11 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include "tim/vx/context.h"
|
#include "tim/vx/context.h"
|
||||||
#include "tim/vx/graph.h"
|
#include "tim/vx/graph.h"
|
||||||
#include "tim/vx/ops/unmaxpool2d.h"
|
#include "tim/vx/ops/maxunpool2d.h"
|
||||||
|
|
||||||
#include "gtest/gtest.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 ctx = tim::vx::Context::Create();
|
||||||
auto graph = ctx->CreateGraph();
|
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));
|
EXPECT_TRUE(indices_tensor->CopyDataToTensor(indices.data(), indices.size()*4));
|
||||||
std::array<uint32_t, 2> ksize = {2, 2};
|
std::array<uint32_t, 2> ksize = {2, 2};
|
||||||
std::array<uint32_t, 2> stride = {2, 2};
|
std::array<uint32_t, 2> stride = {2, 2};
|
||||||
auto op = graph->CreateOperation<tim::vx::ops::UnMaxpool2d>(ksize, stride);
|
auto op = graph->CreateOperation<tim::vx::ops::MaxUnpool2d>(ksize, stride);
|
||||||
(*op).BindInputs({values_tensor, indices_tensor}).BindOutputs({output_tensor});
|
(*op).BindInputs({values_tensor, indices_tensor}).BindOutputs({output_tensor});
|
||||||
|
|
||||||
EXPECT_TRUE(graph->Compile());
|
EXPECT_TRUE(graph->Compile());
|
||||||
|
|
@ -70,7 +70,7 @@ TEST(UnMaxpool2d, shape_2_2_1_fp32_kernel_2_stride_2) {
|
||||||
EXPECT_EQ(golden, output);
|
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 ctx = tim::vx::Context::Create();
|
||||||
auto graph = ctx->CreateGraph();
|
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()));
|
EXPECT_TRUE(indices_tensor->CopyDataToTensor(indices.data(), indices.size()));
|
||||||
std::array<uint32_t, 2> ksize = {2, 2};
|
std::array<uint32_t, 2> ksize = {2, 2};
|
||||||
std::array<uint32_t, 2> stride = {2, 2};
|
std::array<uint32_t, 2> stride = {2, 2};
|
||||||
auto op = graph->CreateOperation<tim::vx::ops::UnMaxpool2d>(ksize, stride);
|
auto op = graph->CreateOperation<tim::vx::ops::MaxUnpool2d>(ksize, stride);
|
||||||
(*op).BindInputs({values_tensor, indices_tensor}).BindOutputs({output_tensor});
|
(*op).BindInputs({values_tensor, indices_tensor}).BindOutputs({output_tensor});
|
||||||
|
|
||||||
EXPECT_TRUE(graph->Compile());
|
EXPECT_TRUE(graph->Compile());
|
||||||
Loading…
Reference in New Issue