megengine.functional.nn.sync_batch_norm¶
- sync_batch_norm(inp, running_mean, running_var, weight=None, bias=None, training=False, momentum=0.9, eps=1e-05, eps_mode='additive', group=WORLD)[source]¶
Applies synchronized batch normalization to the input.
Refer to
BatchNorm2d
andBatchNorm1d
for more information.- Parameters
inp (
Tensor
) – input tensor.running_mean (
Tensor
) – tensor to store running mean.running_var (
Tensor
) – tensor to store running variance.weight (
Optional
[Tensor
]) – scaling tensor in the learnable affine parameters. See \(\gamma\) inBatchNorm2d
.bias (
Optional
[Tensor
]) – bias tensor in the learnable affine parameters. See \(\beta\) inBatchNorm2d
.training (
bool
) – a boolean value to indicate whether batch norm is performed in traning mode. Default: Falsemomentum (
Union
[float
,Tensor
]) – value used for therunning_mean
andrunning_var
computation. Default: 0.9eps (
float
) – a value added to the denominator for numerical stability. Default: 1e-5eps_mode – mode of calculation for eps, “max” or “additive”. Default: “additive”
group – communication group, caculate mean and variance between this group. Default:
WORLD
- Return type