diff --git a/python/paddle/fluid/dygraph/nn.py b/python/paddle/fluid/dygraph/nn.py index 7dbdc492d4d3777fd2445a39e1f7f5be8b506517..f64ced83b3fad9dee716c171497905ba0e11f6d4 100644 --- a/python/paddle/fluid/dygraph/nn.py +++ b/python/paddle/fluid/dygraph/nn.py @@ -1133,6 +1133,7 @@ class BatchNorm(layers.Layer): self._variance.stop_gradient = True self._in_place = in_place + self._data_layout = data_layout self._momentum = momentum self._epsilon = epsilon self._is_test = is_test @@ -1177,6 +1178,7 @@ class BatchNorm(layers.Layer): "momentum": self._momentum, "epsilon": self._epsilon, "is_test": self._is_test, + "data_layout": self._data_layout, "use_mkldnn": False, "fuse_with_relu": self._fuse_with_relu, "use_global_stats": self._use_global_stats,