From 27a5c0cff68e0064fdfdd79610bf06e4cb3bc2df Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Wed, 20 Jan 2021 14:53:17 +0800 Subject: [PATCH] fix layers train eval bug (#30580) * delete empty line of pybing.cc, test=develop * fix layers train eval bug, test=develop --- python/paddle/fluid/dygraph/layers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/dygraph/layers.py b/python/paddle/fluid/dygraph/layers.py index 9da12a91168..b9a43cbbe1a 100644 --- a/python/paddle/fluid/dygraph/layers.py +++ b/python/paddle/fluid/dygraph/layers.py @@ -152,7 +152,7 @@ class Layer(core.Layer): # Layer-level setting self.training = True for layer in self.sublayers(): - layer.train() + layer.training = True def eval(self): """ @@ -193,7 +193,7 @@ class Layer(core.Layer): # Layer-level setting self.training = False for layer in self.sublayers(): - layer.eval() + layer.training = False def apply(self, fn): """ -- GitLab