code: def _instance_normalization_v1(
      x,
      beta,
      gamma,
      channel_axis=1,
      batch_axis=0,
      eps=1e-05,
      output_stat=False,
  ):
      r"""
      Applies Instance Normalization over an input tensor, which is defined as:
  
      .. math::
        \begin{eqnarray}
          \mu^i &=& \frac{1}{H} \sum_{i=1}^{H} x_i^i \\
          \sigma^i &=& \sqrt{\frac{1}{H} \sum_{i=1}^{H} \left(x_i^i - \mu^i\right)^2 + \epsilon} \\
          y &=& \frac{x - \mu^i}{\sigma^i} \gamma + \beta
        \end{eqnarray}
  
      where :math:`x` and :math:`y` are input and output variable,
      :math:`\mu^i` and :math:`\sigma^i` are the mean and std of each instance which is separately calculated for each batch and channel,
      and :math:`\gamma` and :math:`\beta` are adaptive gains and biases.
  
      If the input shape is [B, C, H, W] (= channel_axis=1, batch_axis=0), the shape of calculated mean and std are [B, C, 1, 1]
  
      References:
  
          * `Dmitry Ulyanov, Andrea Vedaldi, Victor Lempitsky, Instance Normalization: The Missing Ingredient for Fast Stylization.
            <https://arxiv.org/abs/1607.08022>`_
  
      Args:
          x (Variable): An input variable.
          beta (Variable): An Adaptive biases.
          gamma (Variable): An Adaptive gains.
          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`)
      """
  
      # check channel axis
      _check_axis(len(x.shape), channel_axis)
  
      # check batch axis
      batch_axis = _check_batch_axis_and_force_list(
          len(x.shape), batch_axis
      )
  
      # check whether broadcast is needed or not.
      # Unlike layer_norm and group_norm, only instance_norm can use bn scale bias & scale adaptation
      # by broadcasting channel axis to channel * batch axis. (like [1, C, 1, 1] -> [N, C, 1, 1])
  
      adapt_shape = [1 for _ in range(len(x.shape))]
      for baxis in batch_axis:
          adapt_shape[baxis] = x.shape[baxis]
      adapt_shape[channel_axis] = x.shape[channel_axis]
      adapt_shape = tuple(adapt_shape)
  
      if beta is not None and beta.shape != adapt_shape:
          assert (
              beta.shape[channel_axis] == adapt_shape[channel_axis]
          ), "channel size of beta: {} != channel size of x ({}).".format(
              beta.shape[channel_axis], adapt_shape[channel_axis]
          )
          beta = broadcast(beta, shape=adapt_shape)
  
      if gamma is not None and gamma.shape != adapt_shape:
          assert (
              gamma.shape[channel_axis] == adapt_shape[channel_axis]
          ), "channel size of gamma: {} != channel size of x ({}).".format(
              gamma.shape[channel_axis], adapt_shape[channel_axis]
          )
          gamma = broadcast(gamma, shape=adapt_shape)
  
      return tensor_normalization(
          x,
          batch_axis
          + [
              channel_axis,
          ],
          beta,
          gamma,
          eps,
          output_stat,
      )
  
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 17 for calling a global function with example usage: _instance_normalization_v1(x, beta, gamma, channel_axis, batch_axis, eps, output_stat) and returns: tensor_normalization