From eaea2beed3624518dc5290431bf76c35f15c4eb3 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Fri, 2 Sep 2022 20:42:42 +0800 Subject: [PATCH] [Eager, Performance optimization] fix assign interface under eager mode (#45688) --- python/paddle/fluid/layers/tensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/paddle/fluid/layers/tensor.py b/python/paddle/fluid/layers/tensor.py index b62df9c1024..8affa851b00 100644 --- a/python/paddle/fluid/layers/tensor.py +++ b/python/paddle/fluid/layers/tensor.py @@ -634,6 +634,8 @@ def assign(input, output=None): if _non_static_mode(): if in_dygraph_mode() and output is None: output = _C_ops.assign(input) + elif in_dygraph_mode() and output is not None: + _C_ops.assign_out_(input, output) else: if output is None: if _in_legacy_dygraph(): -- GitLab