Skip to content

Commit

Permalink
Fix the param of swish (#27824)
Browse files Browse the repository at this point in the history
  • Loading branch information
hong19860320 authored Oct 12, 2020
1 parent 070ac95 commit f3e2580
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_activation_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -2175,7 +2175,7 @@ def setUp(self):
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):
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/nn/functional/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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


Expand Down

0 comments on commit f3e2580

Please sign in to comment.