From f3e2580cf026a767e078c32ab9941ff8906bb1bd Mon Sep 17 00:00:00 2001 From: hong19860320 <9973393+hong19860320@users.noreply.github.com> Date: Mon, 12 Oct 2020 14:10:46 +0800 Subject: [PATCH] Fix the param of swish (#27824) --- python/paddle/fluid/tests/unittests/test_activation_op.py | 2 +- python/paddle/nn/functional/activation.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_activation_op.py b/python/paddle/fluid/tests/unittests/test_activation_op.py index ac3d0a3a785..4fed0c8552b 100755 --- a/python/paddle/fluid/tests/unittests/test_activation_op.py +++ b/python/paddle/fluid/tests/unittests/test_activation_op.py @@ -2175,7 +2175,7 @@ class TestSwish(TestActivation): x = np.random.uniform(-1, 1, [10, 12]).astype(self.dtype) out = ref_swish(x) self.inputs = {'X': x} - self.attrs = {'slope': 1.0} + self.attrs = {'beta': 1.0} self.outputs = {'Out': out} def test_check_grad(self): diff --git a/python/paddle/nn/functional/activation.py b/python/paddle/nn/functional/activation.py index 53fa9814e6e..6e09e25b1ab 100644 --- a/python/paddle/nn/functional/activation.py +++ b/python/paddle/nn/functional/activation.py @@ -1183,7 +1183,7 @@ def swish(x, name=None): """ if in_dygraph_mode(): - return core.ops.swish(x, 'slop', 1.0) + return core.ops.swish(x, 'beta', 1.0) check_variable_and_dtype(x, 'x', ['float16', 'float32', 'float64'], 'swish') helper = LayerHelper('swish', **locals()) @@ -1192,7 +1192,7 @@ def swish(x, name=None): type='swish', inputs={'X': x}, outputs={'Out': out}, - attrs={'slope': 1.0}) + attrs={'beta': 1.0}) return out -- GitLab