diff --git a/python/paddle/incubate/autograd/functional.py b/python/paddle/incubate/autograd/functional.py index 3be95c88d12e798550cc0e88cb4a9a25eff50296..79ba7d33097107404ed1327a9b9dfc4aaed59527 100644 --- a/python/paddle/incubate/autograd/functional.py +++ b/python/paddle/incubate/autograd/functional.py @@ -633,7 +633,7 @@ def _single_separate(x): if x is None: # x maybe none because grad input's v defaults to none. return x if not x.stop_gradient: - return paddle.clone(x) + return paddle.assign(x) else: # use detach to share memory when no need gradients. x = x.detach() x.stop_gradient = False