code: def test_hdf5meansubtract(backend_default, meansubhdf):
      NervanaObject.be.bsz = 128
      bsz = 128
  
      datit = HDF5Iterator(meansubhdf[0])
      datit.allocate()
      typ = meansubhdf[1]
      mn = datit.mean.get()
      assert typ in ["chan_mean", "full_mean"]
  
      cnt_image = 0
      max_len = datit.ndata
      MAX_CNT = max_len * datit.inp.shape[1]
      for x, t in datit:
          x_ = x.get().flatten()
          x_exp = (np.arange(len(x_)) + cnt_image) % MAX_CNT
          x_exp = x_exp.reshape((-1, np.prod(datit.lshape))).T
          if typ == "chan_mean":
              x_exp = x_exp.reshape((datit.lshape[0], -1)) - mn
          elif typ == "full_mean":
              x_exp = x_exp.reshape((-1, bsz)) - mn
          x_exp = x_exp.flatten()
          assert allclose_with_out(x_, x_exp, atol=0.0, rtol=1.0e-7)
          cnt_image += len(x_)
  
      datit.cleanup()
  
file_path: neon/tests/test_hdf5iterator.py
imports: import os
  import math
  import h5py
  import pytest
  import logging
  import tempfile
  import numpy
  from neon import NervanaObject
  from neon.data import HDF5Iterator, HDF5IteratorOneHot, HDF5IteratorAutoencoder
  from utils import allclose_with_out
label_desc: Use image node_id 9 for calling a global function with example usage: test_hdf5meansubtract(backend_default, meansubhdf) without return types