From e448bdb298aa8f32c398f9dfc2bd215e4fce6d56 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Thu, 24 Jan 2019 13:35:54 +0800 Subject: [PATCH] modified some comments test=develop --- paddle/fluid/operators/interpolate_op.cc | 4 ++-- python/paddle/fluid/layers/nn.py | 8 ++++---- .../fluid/tests/unittests/test_nearest_interp_op.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/operators/interpolate_op.cc b/paddle/fluid/operators/interpolate_op.cc index 13be33a39..83b2086bb 100644 --- a/paddle/fluid/operators/interpolate_op.cc +++ b/paddle/fluid/operators/interpolate_op.cc @@ -128,7 +128,7 @@ class InterpolateOpMaker : public framework::OpProtoAndCheckerMaker { Nearest neighbor interpolation: - case 1: + if: align_corners = False input : (N,C,H_in,W_in) @@ -137,7 +137,7 @@ class InterpolateOpMaker : public framework::OpProtoAndCheckerMaker { H_out = \left \lfloor {H_{in} * scale_{}factor}} \right \rfloor W_out = \left \lfloor {W_{in} * scale_{}factor}} \right \rfloor - case 2: + else: align_corners = True input : (N,C,H_in,W_in) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 765fa8565..4d40f2e7c 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -6570,7 +6570,7 @@ def image_resize(input, Nearest neighbor interpolation: - case 1: + if: align_corners = False input : (N,C,H_in,W_in) @@ -6579,7 +6579,7 @@ def image_resize(input, H_out = \left \lfloor {H_{in} * scale_{}factor}} \right \rfloor W_out = \left \lfloor {W_{in} * scale_{}factor}} \right \rfloor - case 2: + else: align_corners = True input : (N,C,H_in,W_in) @@ -6866,7 +6866,7 @@ def resize_nearest(input, Nearest neighbor interpolation: - case 1: + if: align_corners = False input : (N,C,H_in,W_in) @@ -6875,7 +6875,7 @@ def resize_nearest(input, H_out = \left \lfloor {H_{in} * scale_{}factor}} \right \rfloor W_out = \left \lfloor {W_{in} * scale_{}factor}} \right \rfloor - case 2: + else: align_corners = True input : (N,C,H_in,W_in) diff --git a/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py b/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py index c97aa886a..9984a793c 100644 --- a/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py +++ b/python/paddle/fluid/tests/unittests/test_nearest_interp_op.py @@ -208,7 +208,7 @@ class TestNearestNeighborInterpCase1Uint8(TestNearestInterpOpUint8): self.input_shape = [2, 3, 128, 64] self.out_h = 120 self.out_w = 50 - self.align_corners = False + self.align_corners = True class TestNearestNeighborInterpCase2Uint8(TestNearestInterpOpUint8): -- GitLab