code: def sync_batch_normalization(
      x,
      beta,
      gamma,
      mean,
      variance,
      comm,
      group="world",
      axes=[1],
      decay_rate=0.9,
      eps=1e-05,
      batch_stat=True,
      output_stat=False,
      n_outputs=None,
  ):
      r"""
      Synchronized batch normalization.
  
      For some tasks (e.g., semantic segmentation), batch size will be too small and BatchNormalization layer might not work well.
      SyncBatchNorlization layer solves these problems by synchronizing batch stats (mean and var) between multiple processes.
  
      .. math::
          \begin{eqnarray}
            \mu &=& \frac{1}{M} \sum x_i \\
            \sigma^2 &=& \frac{1}{M} \left(\sum x_i - \mu\right)^2 \\
            \hat{x}_i &=& \frac{x_i - \mu}{\sqrt{\sigma^2 + \epsilon}} \\
            y_i &=& \hat{x}_i \gamma + \beta.
          \end{eqnarray}
  
      References:
  
          * Implementing Synchronized Multi-GPU Batch Normalization https://hangzhang.org/PyTorch-Encoding/notes/syncbn.html
  
      Args:
          x(~nnabla.Variable): N-D array of input.
          beta(~nnabla.Variable or None): N-D array of beta which is learned. If None, the bias term is omitted.
          gamma(~nnabla.Variable or None): N-D array of gamma which is learned. If None, the scale term is omitted.
          mean(~nnabla.Variable or None):
              N-D array of running mean (modified during forward execution).
              If None, dummy variable is created and running mean is never updated.
              mean=None with batch_stat=False is prohibited.
          variance(~nnabla.Variable or None):
              N-D array of running variance (modified during forward execution).
              If None, dummy variable is created and running variance is never updated.
              variance=None with batch_stat=False is prohibited.
          comm(~nnabla.communicators.Communicator): The communicator
          group(string): The name of the communicator group
          axes(list of int or int): Mean and variance are calculated along these axes.
          decay_rate(float): Decay rate of running mean and variance.
          eps(float): Tiny value to avoid zero division by std.
          batch_stat(bool):
              Use mini-batch statistics rather than running ones.
              If False, mean and variance must be `~nnabla.Variable`. (None is prohibited.)
          output_stat(bool): It true, the batch statistics of mean and variance,
              will be returned as Variables. They are also differentiable.
  
      Returns:
          Returns batch normalization output as :obj:`~nnabla.Variable`.
          If ``output_stat=True``, it also returns the mean and variance
          of the mini-batch
  
          * :obj:`~nnabla.Variable`: Output of the batch normalization
          * :obj:`~nnabla.Variable`: Mean (if `output_stat=True`)
          * :obj:`~nnabla.Variable`: Variance (if `output_stat=True`)
  
      See Also:
          ``nnabla.function_bases.batch_normalization``.
  
      """
      from .function_bases import (
          sync_batch_normalization as batch_normalization_base,
      )
  
      n_outputs = 3 if output_stat else 1
      axes = _force_list(axes)
  
      if not batch_stat and (mean is None or variance is None):
          raise ValueError(
              "If batch_stat is False, mean and variable must not be None."
          )
  
      beta, gamma, mean, variance = _create_bn_dummy_vars(
          x, axes, beta, gamma, mean, variance
      )
  
      return batch_normalization_base(
          x,
          beta,
          gamma,
          mean,
          variance,
          comm,
          group=group,
          axes=axes,
          decay_rate=decay_rate,
          eps=eps,
          batch_stat=batch_stat,
          n_outputs=n_outputs,
      )
  
imports: from __future__ import absolute_import
  from .function_bases import *
  from six.moves import reduce
  import numpy
  import nnabla
label_desc: Use image node_id 10 for calling a global function with example usage: sync_batch_normalization(x, beta, gamma, mean, variance, comm, group, axes, decay_rate, eps, batch_stat, output_stat, n_outputs) and returns: batch_normalization_base