code: def group_normalization(
      x,
      beta,
      gamma,
      num_groups,
      channel_axis=1,
      batch_axis=0,
      eps=1e-05,
      output_stat=False,
  ):
      r"""
      Applies Group Normalization over an input tensor, which is defined as:
  
      .. math::
        \begin{eqnarray}
          \mu^g &=& \frac{1}{H} \sum_{i=1}^{H} x_i^g \\
          \sigma^g &=& \sqrt{\frac{1}{H} \sum_{i=1}^{H} \left(x_i^g - \mu^g\right)^2 + \epsilon} \\
          y &=& \frac{x - \mu^g}{\sigma^g} \gamma + \beta
        \end{eqnarray}
  
      where :math:`x` and :math:`y` are input and output variable,
      :math:`\mu^g` and :math:`\sigma^g` are the mean and std of each group which contains `num_channels / num_groups` channels,
      and :math:`\gamma` and :math:`\beta` are adaptive gains and biases.
  
      The input channels, specified by :attr:`channel_axis`, are separated into :attr:`num_groups` groups,
      and the mean and std are calculated over the each group.
      For example, if the input shape is [B, C, H, W] (= channel_axis=1, batch_axis=0),
      an input variable is once reshaped to [B, num_groups, C / num_groups, H, W]
      and standardize by its mean and std whose shapes are [B, num_groups, 1, 1, 1].
      Finally, an output variable is reshaped again to the original input shape (= [B, C, H, W] in the case above).
  
      References:
  
          * `Yuxin Wu, Kaiming He, Group Normalization.
            <https://arxiv.org/abs/1803.08494>`_
  
      Args:
          x (Variable): An input variable.
          beta (Variable or None): An Adaptive biases. If None, the bias term is omitted.
          gamma (Variable or None): An Adaptive gains. If None, the scale term is omitted.
          num_groups (int): A number of groups. The channel dim of 'x' must be integer multiple of `num_groups`.
          channel_axis (int): Channel axis.
          batch_axis (int or repeated int): Batch axes.
          eps (float): Tiny value to avoid zero division by std.
          output_stat(bool): If true, the batch statistics of mean and variance.
  
      Returns:
          * :obj:`~nnabla.Variable`: Normalized output variable.
          * :obj:`~nnabla.Variable`: Mean (if `output_stat=True`)
          * :obj:`~nnabla.Variable`: Std (if `output_stat=True`)
      """
      from .function_bases import (
          group_normalization as group_normalization_base,
      )
  
      n_outputs = 3 if output_stat else 1
  
      batch_axis = _force_list(batch_axis)
  
      no_scale = gamma is None
      no_bias = beta is None
  
      return group_normalization_base(
          x,
          beta=beta,
          gamma=gamma,
          num_groups=num_groups,
          channel_axis=channel_axis,
          batch_axis=batch_axis,
          eps=eps,
          no_scale=no_scale,
          no_bias=no_bias,
          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 18 for calling a global function with example usage: group_normalization(x, beta, gamma, num_groups, channel_axis, batch_axis, eps, output_stat) and returns: group_normalization_base