code: def ref_mean_subtraction(x, rmean, t, base_axis, batch_stat):
      if batch_stat:
          mean = (
              x.mean(tuple(range(0, base_axis)))
              if base_axis >= 0
              else x.mean(tuple(range(0, len(x.shape) + base_axis)))
          )
          rmean[...] = rmean + (mean - rmean) / (t + 1)
          t += 1
      return x - rmean
  
file_path: nnabla/python/test/function/test_mean_subtraction.py
imports: 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 1 for calling a global function with example usage: ref_mean_subtraction(x, rmean, t, base_axis, batch_stat) and returns: unknown