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

revert-21172-masked_select_api
hong 5 years ago committed by GitHub
parent 5fdfbe3413
commit 835119c777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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",

Loading…
Cancel
Save