未验证 提交 835119c7 编写于 作者: H hong 提交者: GitHub

disable reshape inplace in dygraph model; test=develop (#21157)

上级 5fdfbe34
......@@ -5400,8 +5400,8 @@ def reshape(x, shape, actual_shape=None, act=None, inplace=False, name=None):
actual_shape.stop_gradient = True
inputs["Shape"] = actual_shape
out = x if inplace else helper.create_variable_for_type_inference(
dtype=x.dtype)
out = x if inplace and not in_dygraph_mode(
) else helper.create_variable_for_type_inference(dtype=x.dtype)
x_shape = helper.create_variable_for_type_inference(dtype=x.dtype)
helper.append_op(
type="reshape2",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册