Skip to content

Commit cc21c42

Browse files
committed
rename unpool2d to unpool, test=develop
1 parent e2d04e9 commit cc21c42

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

paddle/fluid/operators/unpool_op.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ class UnpoolOpGrad : public framework::OperatorWithKernel {
167167
} // namespace paddle
168168

169169
namespace ops = paddle::operators;
170-
REGISTER_OPERATOR(unpool2d, ops::UnpoolOp, ops::Unpool2dOpMaker,
170+
REGISTER_OPERATOR(unpool, ops::UnpoolOp, ops::Unpool2dOpMaker,
171171
ops::UnpoolOpGradMaker<paddle::framework::OpDesc>,
172172
ops::UnpoolOpGradMaker<paddle::imperative::OpBase>);
173173

174-
REGISTER_OPERATOR(unpool2d_grad, ops::UnpoolOpGrad);
174+
REGISTER_OPERATOR(unpool_grad, ops::UnpoolOpGrad);
175175
REGISTER_OP_CPU_KERNEL(
176-
unpool2d, ops::UnpoolKernel<paddle::platform::CPUDeviceContext, float>,
176+
unpool, ops::UnpoolKernel<paddle::platform::CPUDeviceContext, float>,
177177
ops::UnpoolKernel<paddle::platform::CPUDeviceContext, double>);
178178
REGISTER_OP_CPU_KERNEL(
179-
unpool2d_grad,
179+
unpool_grad,
180180
ops::UnpoolGradKernel<paddle::platform::CPUDeviceContext, float>,
181181
ops::UnpoolGradKernel<paddle::platform::CPUDeviceContext, double>);

python/paddle/fluid/tests/unittests/test_unpool_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def unpool2dmax_forward_naive(input, indices, ksize, strides, paddings,
5555

5656
class TestUnpoolOp(OpTest):
5757
def setUp(self):
58-
self.op_type = "unpool2d"
58+
self.op_type = "unpool"
5959
self.init_test_case()
6060
input = np.random.randint(0, 100, self.shape)
6161
nsize, csize, hsize, wsize = input.shape

python/paddle/nn/functional/pooling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,13 +743,13 @@ def max_unpool2d(x,
743743
output_size)
744744

745745
if in_dygraph_mode():
746-
output = _C_ops.unpool2d(x, indices, 'unpooling_type', 'max', 'ksize',
747-
kernel_size, 'strides', stride, 'paddings',
748-
padding, "output_size", output_size,
749-
"data_format", data_format)
746+
output = _C_ops.unpool(x, indices, 'unpooling_type', 'max', 'ksize',
747+
kernel_size, 'strides', stride, 'paddings',
748+
padding, "output_size", output_size,
749+
"data_format", data_format)
750750
return output
751751

752-
op_type = "unpool2d"
752+
op_type = "unpool"
753753
helper = LayerHelper(op_type, **locals())
754754
dtype = helper.input_dtype(input_param_name="x")
755755
unpool_out = helper.create_variable_for_type_inference(dtype)

0 commit comments

Comments
 (0)