code: def ref_grad_fused_batch_normalization(
      x,
      beta,
      gamma,
      rmean,
      rvar,
      z,
      dy,
      axes,
      decay_rate,
      eps,
      batch_stat,
      nonlinearity,
      output_stat,
      **kw,
  ):
      with nn.context_scope(cpu_context):
          xvar = nn.Variable.from_numpy_array(x, need_grad=True)
          xvar.g = 0
          betavar = nn.Variable.from_numpy_array(beta, need_grad=True)
          betavar.g = 0
          gammavar = nn.Variable.from_numpy_array(gamma, need_grad=True)
          gammavar.g = 0
          rmeanvar = nn.Variable.from_numpy_array(rmean)
          rmeanvar.g = 0
          rvarvar = nn.Variable.from_numpy_array(rvar)
          rvarvar.g = 0
          zvar = None
          if z is not None:
              zvar = nn.Variable.from_numpy_array(z, need_grad=True)
              zvar.g = 0
          with nn.auto_forward():
              bn = F.batch_normalization(
                  xvar,
                  betavar,
                  gammavar,
                  rmeanvar,
                  rvarvar,
                  axes,
                  decay_rate,
                  eps,
                  batch_stat,
                  output_stat,
              )
              if z is None:
                  if output_stat:
                      y1 = bn[0]
                  else:
                      y1 = bn
              else:
                  if output_stat:
                      y1 = F.add2(bn[0], zvar)
                  else:
                      y1 = F.add2(bn, zvar)
              y = F.relu(y1)
          y.g = dy
          y.backward(dy)
          concat = [
              xvar.g.flatten(),
              betavar.g.flatten(),
              gammavar.g.flatten(),
          ]
          if z is not None:
              concat.append(zvar.g.flatten())
          return np.concatenate(concat)
  
file_path: nnabla/python/test/function/test_fused_batch_normalization.py
imports: from six.moves import range
  import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 2 for calling a global function with example usage: ref_grad_fused_batch_normalization(x, beta, gamma, rmean, rvar, z, dy, axes, decay_rate, eps, batch_stat, nonlinearity, output_stat) and returns: np