'Args:
hdf_filename (string): Path to the HDF5 datafile.
name (string, optional): Name to assign this iterator. Defaults to None.'

def __init__(self, hdf_filename, name=None):

    super(ArrayIterator, self).__init__(name=name)
    self.hdf_filename = hdf_filename
    if (not os.path.isfile(hdf_filename)):
        raise IOError(('File    not    found    %s' % hdf_filename))
    self.hdf_file = h5py.File(hdf_filename, mode='r', driver=None)
    self.inp = self.hdf_file['input']
    self.ndata = self.inp.shape[0]
    assert (self.ndata >= self.be.bsz)
    self.start = 0
    self.lshape = tuple(self.inp.attrs['lshape'])
    self.shape = self.lshape
    if ('output' in self.hdf_file):
        self.out = self.hdf_file['output']
    self.inpbuf = None
    self.outbuf = None
    self.allocated = False
