Browse Source

!965 doc fix,add GlobalBN only support 2d and 4d

Merge pull request !965 from JichenZhao/globalbn_doc_fix
tags/v0.3.0-alpha
mindspore-ci-bot Gitee 6 years ago
parent
commit
8e06c2fe93
2 changed files with 4 additions and 0 deletions
  1. +3
    -0
      mindspore/nn/layer/normalization.py
  2. +1
    -0
      mindspore/ops/operations/comm_ops.py

+ 3
- 0
mindspore/nn/layer/normalization.py View File

@@ -355,6 +355,9 @@ class GlobalBatchNorm(_BatchNorm):
.. math::
y = \frac{x - \mathrm{E}[x]}{\sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma + \beta

Note:
Currently, GlobalBatchNorm only supports 2D and 4D inputs.

Args:
num_features (int): `C` from an expected input of size (N, C, H, W).
device_num_each_group (int): The number of devices in each group.


+ 1
- 0
mindspore/ops/operations/comm_ops.py View File

@@ -156,6 +156,7 @@ class AllGather(PrimitiveWithInfer):
self.add_prim_attr('group', _get_group(group))

def infer_shape(self, x_shape):
validator.check_integer("x shape", len(x_shape), 0, Rel.GT, self.name)
x_shape[0] = x_shape[0] * self.rank_size
return x_shape



Loading…
Cancel
Save