class_docstr: The ArrayIterator class iterates over minibatches of data that
  have been preloaded into memory in the form of numpy arrays. This may be used when
  the entire dataset (e.g. CIFAR-10 or MNIST) is small enough to fit in memory. For example::
  
      X = np.random.rand(10000, 3072)
      y = np.random.randint(0, 10, 10000)
      train = ArrayIterator(X=X, y=y, nclass=10, lshape=(3, 32, 32))
  
  The above will create the ArrayIterator object. This object implements python's __iter__
  method, and returns one minibatch of data, formatted as tuple of (input, label), with
  each iteration. The minibatch size is controlled by the generated backend.
  
  X should be an ndarray of shape (# example, # features). For images, the features should be
  formatted in (channel, height, width) order. The `lshape` keyword indicates the local shape of
  the images in (channel, height, width) format.
  
  For classification tasks, the labels `y` should be integers from 0 to K-1, where K is the total
  number of classes. When `y` is not provided, the input features themselves will be returned
  as the target values (e.g. autoencoder).
  
  In regression tasks, where `y` is not a categorical label, set `make_onehot` to `False`.
  For example::
  
      X = np.random.rand(1000, 1)
      y = 2*X + 1
      train = ArrayIterator(X=X, y=y, make_onehot=False)
  
  For more information, see the Loading data section of the documentation.
docstr: Returns a new minibatch of data with each call.
  
  Yields:
      tuple: The next minibatch which includes both features and labels.
docstr_tok: ["Returns","a","new","minibatch","of","data","with","each","call",".","Yields",":","tuple",":","The","next","minibatch","which","includes","both","features","and","labels","."]
code: def __iter__(self):
      """
      Returns a new minibatch of data with each call.
  
      Yields:
          tuple: The next minibatch which includes both features and labels.
      """
      for i1 in range(self.start, self.ndata, self.be.bsz):
          bsz = min(self.be.bsz, self.ndata - i1)
          islice1, oslice1 = slice(0, bsz), slice(i1, i1 + bsz)
          islice2, oslice2 = None, None
          if self.be.bsz > bsz:
              islice2, oslice2 = slice(bsz, None), slice(
                  0, self.be.bsz - bsz
              )
              self.start = self.be.bsz - bsz
  
          for buf, dev, unpack_func in zip(
              self.hbuf, self.dbuf, self.unpack_func
          ):
              unpack_func(dev[oslice1], buf[:, islice1])
              if oslice2:
                  unpack_func(dev[oslice2], buf[:, islice2])
  
          inputs = self.Xbuf[0] if len(self.Xbuf) == 1 else self.Xbuf
          targets = self.ybuf if self.ybuf else inputs
          yield (inputs, targets)
  
file_path: neon/neon/data/dataiterator.py
imports: from builtins import zip
  import numpy
  from neon import NervanaObject
label_desc: Use image node_id 4 for calling the ArrayIterator obj's underlying member method code with example usage: obj.__iter__() without return types