Browse Source

!2949 fix SequentialCell

Merge pull request !2949 from jiangjinsheng/issue_fix4
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
06217c047e
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/nn/layer/container.py
  2. +1
    -1
      mindspore/nn/layer/normalization.py

+ 1
- 1
mindspore/nn/layer/container.py View File

@@ -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.


+ 1
- 1
mindspore/nn/layer/normalization.py View File

@@ -588,7 +588,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)


Loading…
Cancel
Save