未验证 提交 653686c7 编写于 作者: G Guo Sheng 提交者: GitHub

Merge pull request #11828 from guoshengCS/cherry-pick-log-relu

[cherry-pick] Fix python api of log and relu layers
......@@ -4941,9 +4941,9 @@ def log(x):
output = fluid.layers.log(x)
"""
helper = LayerHelper('log', **locals())
dtype = helper.input_dtype()
dtype = helper.input_dtype(input_param_name='x')
out = helper.create_tmp_variable(dtype)
helper.append_op(type="log", inputs={"X": input}, outputs={"Out": out})
helper.append_op(type="log", inputs={"X": x}, outputs={"Out": out})
return out
......@@ -4970,9 +4970,9 @@ def relu(x):
output = fluid.layers.relu(x)
"""
helper = LayerHelper('relu', **locals())
dtype = helper.input_dtype()
dtype = helper.input_dtype(input_param_name='x')
out = helper.create_tmp_variable(dtype)
helper.append_op(type="relu", inputs={"X": input}, outputs={"Out": out})
helper.append_op(type="relu", inputs={"X": x}, outputs={"Out": out})
return out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册