code: def ref_instance_normalization(
      x, beta, gamma, channel_axis, batch_axis, eps, output_stat
  ):
      ignore_axes = _force_list(batch_axis) + [
          channel_axis,
      ]
  
      axes = tuple(_get_axes_excluding(len(x.shape), ignore_axes))
  
      x_mean = x.mean(axis=axes, keepdims=True)
      x_var = x.var(axis=axes, keepdims=True)
  
      norm = (x - x_mean) / (x_var + eps) ** 0.5
  
      if gamma is not None:
          norm *= gamma
  
      if beta is not None:
          norm += beta
  
      if output_stat:
          return norm, x_mean, x_var
  
      return norm
  
file_path: nnabla/python/test/function/test_instance_normalization.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
  from nnabla.normalization_functions import _force_list, _get_axes_excluding
label_desc: Use image node_id 1 for calling a global function with example usage: ref_instance_normalization(x, beta, gamma, channel_axis, batch_axis, eps, output_stat) and returns: norm, norm,  x_mean,  x_var