!2949 fix SequentialCell

Merge pull request !2949 from jiangjinsheng/issue_fix4
pull/2949/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 06217c047e

@ -69,7 +69,7 @@ class SequentialCell(Cell):
Alternatively, an ordered dict of cells can also be passed in. Alternatively, an ordered dict of cells can also be passed in.
Args: Args:
args (list, optional): List of subclass of Cell. args (list, OrderedDict): List of subclass of Cell.
Raises: Raises:
TypeError: If arg is not of type list or OrderedDict. TypeError: If arg is not of type list or OrderedDict.

@ -588,7 +588,7 @@ class GroupNorm(Cell):
"""calculate groupnorm output""" """calculate groupnorm output"""
batch, channel, height, width = self.shape(x) batch, channel, height, width = self.shape(x)
_channel_check(channel, self.num_channels) _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) mean = self.reduce_mean(x, 2)
var = self.reduce_sum(self.square(x - mean), 2) / (channel * height * width / self.num_groups - 1) var = self.reduce_sum(self.square(x - mean), 2) / (channel * height * width / self.num_groups - 1)
std = self.sqrt(var + self.eps) std = self.sqrt(var + self.eps)

Loading…
Cancel
Save