From 8037ef77f5423105b3a396ad71689115cc1a2b81 Mon Sep 17 00:00:00 2001 From: lilei Date: Fri, 15 Jan 2021 14:59:47 +0800 Subject: [PATCH] modify batch_normal --- mindspore/nn/layer/basic.py | 2 +- mindspore/nn/layer/normalization.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mindspore/nn/layer/basic.py b/mindspore/nn/layer/basic.py index b70f93bd9a..4c62f90cb6 100644 --- a/mindspore/nn/layer/basic.py +++ b/mindspore/nn/layer/basic.py @@ -161,7 +161,7 @@ class Dropout(Cell): return out def extend_repr(self): - return 'keep_prob={}, dtype={}'.format(self.keep_prob, self.dtype) + return 'keep_prob={}'.format(self.keep_prob) class Flatten(Cell): diff --git a/mindspore/nn/layer/normalization.py b/mindspore/nn/layer/normalization.py index bd90d0a7ea..2ca85c912f 100644 --- a/mindspore/nn/layer/normalization.py +++ b/mindspore/nn/layer/normalization.py @@ -109,7 +109,8 @@ class _BatchNorm(Cell): epsilon=self.eps, momentum=self.momentum) self.bn_infer = P.BatchNorm(is_training=False, epsilon=self.eps, data_format=self.format) - self.enable_global_sync = self.is_global and (self.is_ge_backend or (self.is_graph_mode and self.is_ascend)) + self.enable_global_sync = self.is_global and (self.is_ge_backend or\ + (self.is_graph_mode and self._target == "Ascend")) data_parallel_strategy = ((1,), (1,)) data_parallel_strategy_one = ((1,), ())