class_docstr: Simple numpy data generator backed by numpy arrays.
  
  Can be useful for applying numpy data to estimators in other frameworks
      e.g., when translating the entire numpy data to GPU tensors would cause OOM
docstr: Create a numpy data generator backed by numpy arrays
  
  :param x: Numpy array of inputs
  :param y: Numpy array of targets
  :param batch_size: Size of the minibatches
  :param drop_remainder: Whether to omit the last incomplete minibatch in an epoch
  :param shuffle: Whether to shuffle the dataset for each epoch
code: def __init__(
      self,
      x: np.ndarray,
      y: np.ndarray,
      batch_size: int = 1,
      drop_remainder: bool = True,
      shuffle: bool = False,
  ):
      """
      Create a numpy data generator backed by numpy arrays
  
      :param x: Numpy array of inputs
      :param y: Numpy array of targets
      :param batch_size: Size of the minibatches
      :param drop_remainder: Whether to omit the last incomplete minibatch in an epoch
      :param shuffle: Whether to shuffle the dataset for each epoch
      """
      x = np.asanyarray(x)
      y = np.asanyarray(y)
      try:
          if len(x) != len(y):
              raise ValueError("inputs must be of equal length")
      except TypeError as err:
          raise ValueError(
              f"inputs x {x} and y {y} must be sized objects"
          ) from err
      size = len(x)
      self.x = x
      self.y = y
      super().__init__(size, int(batch_size))
      self.shuffle = bool(shuffle)
  
      self.drop_remainder = bool(drop_remainder)
      batches_per_epoch = size / self.batch_size
      if not self.drop_remainder:
          batches_per_epoch = np.ceil(batches_per_epoch)
      self.batches_per_epoch = int(batches_per_epoch)
      self._iterator = self
      self.generator: Iterator[Any] = iter([])
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import abc
  import inspect
  import logging
  from typing import Any, Dict, Generator, Iterator, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
label_desc: Use image node_id 1 to create a new NumpyDataGenerator object from inherited base classes: DataGenerator with example: obj = NumpyDataGenerator(x, y, batch_size, drop_remainder, shuffle)