From 52e280f36a078f634d9bd2c462d6e00ff154e055 Mon Sep 17 00:00:00 2001 From: jiangjinsheng Date: Thu, 9 Jul 2020 09:08:02 +0800 Subject: [PATCH] fix SequentialCell doc --- mindspore/nn/layer/container.py | 2 +- mindspore/nn/layer/normalization.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/nn/layer/container.py b/mindspore/nn/layer/container.py index 48871401bf..ed36a1dd5f 100644 --- a/mindspore/nn/layer/container.py +++ b/mindspore/nn/layer/container.py @@ -69,7 +69,7 @@ class SequentialCell(Cell): Alternatively, an ordered dict of cells can also be passed in. Args: - args (list, optional): List of subclass of Cell. + args (list, OrderedDict): List of subclass of Cell. Raises: TypeError: If arg is not of type list or OrderedDict. diff --git a/mindspore/nn/layer/normalization.py b/mindspore/nn/layer/normalization.py index d6c920b620..8e006576fa 100644 --- a/mindspore/nn/layer/normalization.py +++ b/mindspore/nn/layer/normalization.py @@ -587,7 +587,7 @@ class GroupNorm(Cell): """calculate groupnorm output""" batch, channel, height, width = self.shape(x) _channel_check(channel, self.num_channels) - x = self.reshape(x, (batch, self.num_groups, channel*height*width/self.num_groups)) + x = self.reshape(x, (batch, self.num_groups, -1)) mean = self.reduce_mean(x, 2) var = self.reduce_sum(self.square(x - mean), 2) / (channel * height * width / self.num_groups - 1) std = self.sqrt(var + self.eps)