From 555c3463dc29d9293a8a252c1b35ed78e42bcc4f Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Wed, 9 Jun 2021 19:01:59 +0800 Subject: [PATCH] [Dy2Stat] fix unittest failed (#33438) --- .../paddle/fluid/dygraph/dygraph_to_static/partial_program.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py b/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py index f2c91809869..7910e7a3855 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py @@ -256,6 +256,7 @@ class PartialProgramLayer(layers.Layer): place=framework._current_expected_place(), zero_copy=True) elif isinstance(value, core.VarBase): + value.name = self._inputs[i].desc.name() if value.stop_gradient: # NOTE(Aurelius84): If var is on CPUPlace, it will be transformed multi times # into CUDAPlace when it's as input of multi Ops. so we move it in advance @@ -265,9 +266,9 @@ class PartialProgramLayer(layers.Layer): dtype=value.dtype, place=framework._current_expected_place(), stop_gradient=True) + var.name = value.name else: var = value - var.name = self._inputs[i].desc.name() else: continue input_vars.append(var) -- GitLab