class_docstr: Data iterator which uses an HDF5 file as the source of the data, useful when
  the entire HDF5 dataset cannot fit into memory (for smaller datasets, use the ArrayIterator).
  
  To initialize the HDF5Iterator, simply call::
  
      train_set = HDF5Iterator('your_data_path.h5')
  
  The HDF5 file format must contain the following datasets:
  
  - `input` (ndarray):
                      Input data, which is a 2-D array (float or uint8) that
                      has size `(N, F)`, where `N` is the number of examples,
                      and `F` is the number of features. For images, `F = C*H*W` where
                      `C` is the number of channels and `H` and `W` are the height
                      and width of the image, respectively. This data must also
                      have the following attributes:
      - `lshape` (tuple):
                  Tuple of ints indicating the shape of each
                  input (for examples, image data may have
                  an lshape of `[C, H, W]`)
      - `mean` (ndarray):
                  The mean to subtract, either formatted as (F, 1) or
                  a mean for each channel with dimensions (C, 1)
  - `output` (ndarray):
                      An optional dataset which, if supplied, will be
                      used at the target/expected output of the network. the
                      array should have the shape `(N, M)` where `N` is the number
                      of items (must match the `N` dim of the input set)
                      and `M` is the size of the output data which must match
                      size of ouput from the output layer of the network.
  
  For cases where the output should be converted to a one-hot encoding (see Loading Data),
  use the `HDF5IteratorOneHot`. Or for autoencoder problems, use `HDFIteratorAutoencoder`.
docstr: Defines a generator that can be used to iterate over this dataset.
  
  Yields:
      tuple: The next minibatch. A minibatch includes both features and
      labels.
docstr_tok: ["Defines","a","generator","that","can","be","used","to","iterate","over","this","dataset",".","Yields",":","tuple",":","The","next","minibatch",".","A","minibatch","includes","both","features","and","labels","."]
code: def __iter__(self):
      """
      Defines a generator that can be used to iterate over this dataset.
  
      Yields:
          tuple: The next minibatch. A minibatch includes both features and
          labels.
      """
      if not self.allocated:
          self.allocate()
      full_shape = list(self.lshape)
      full_shape.append(-1)
  
      mini_batch_in = self.mini_batch_in
      if self.outbuf is not None:
          mini_batch_out = self.mini_batch_out
      for i1 in range(self.start, self.ndata, self.be.bsz):
          i2 = min(i1 + self.be.bsz, self.ndata)
          bsz = i2 - i1
          if i2 == self.ndata:
              self.start = self.be.bsz - bsz
  
          # load mini batch on host
          xdev = self.inp
          mini_batch_in[:, :bsz] = xdev[i1:i2, :].T.astype(np.float32)
          if self.be.bsz > bsz:
              mini_batch_in[:, bsz:] = xdev[
                  : (self.be.bsz - bsz), :
              ].T.astype(np.float32)
  
          # push to device
          self.gen_input(mini_batch_in)
  
          if self.outbuf is not None:
              mini_batch_out[:, :bsz] = self.out[i1:i2].T
              if self.be.bsz > bsz:
                  mini_batch_out[:, bsz:] = self.out[
                      : (self.be.bsz - bsz)
                  ].T
  
              self.gen_output(mini_batch_out)
  
          inputs = self.inpbuf
          targets = self.outbuf
          yield (inputs, targets)
  
imports: import os
  import h5py
  import logging
  import numpy
  from neon.data import ArrayIterator
label_desc: Use image node_id 10 for calling the HDF5Iterator obj's underlying member method code with example usage: obj.__iter__() without return types