code: def test_op_reduce_mean(input_data, axis, device_id, precision):
      dt = PRECISION_TO_TYPE[precision]
  
      data = AA(input_data, dtype=dt)
      axis = tuple(axis) if isinstance(axis, list) else (axis)
      expected_forward = [np.mean(data, axis=axis, keepdims=True)]
  
      counts = (
          np.prod([data.shape[a] for a in axis])
          if type(axis) in [list, tuple]
          else data.shape[axis]
      )
      backward = np.ones_like(data) / counts
  
      expected_backward = {"arg": [backward]}
  
      from .. import reduce_mean
  
      _test_unary_op(
          precision,
          device_id,
          reduce_mean,
          input_data,
          expected_forward,
          expected_backward,
          {"axis": axis},
      )
  
imports: from __future__ import division
  import numpy
  import itertools
  import pytest
  import cntk
  from .ops_test_utils import unittest_helper, _test_unary_op, AA, precision, PRECISION_TO_TYPE, constant
  from cntk.internal import sanitize_dtype_cntk
  from ..None import reduce_sum, reduce_max, reduce_min, reduce_mean, reduce_log_sum_exp, reduce_prod
label_desc: Use image node_id 4 for calling a global function with example usage: test_op_reduce_mean(input_data, axis, device_id, precision) without return types