class_docstr: This adapter adapts np.ndarray, a list of np.ndarray, and a dict of
  np.ndarray into a tf.keras.utils.Sequence instance.
class_docstr_tok: ["This","adapter","adapts","np.ndarray",",","a","list","of","np.ndarray",",","and","a","dict","of","np.ndarray","into","a","tf.keras.utils.Sequence","instance","."]
docstr: If converting numpy array data to Sequence to optimize performance, consider
  using ArrayLikeAdapter.
  
  Args:
      x: Input data. It could be:
          1) A Numpy array (or array-like), or a list of arrays (in case the model
          has multiple inputs).
          2) A dict mapping input names to the corresponding array, if the model
          has named inputs.
  
      y: Target data. Like the input data x, it could be either Numpy array(s).
  
      batch_size: Number of samples per batch.
  
      sample_weights: Numpy array of weights for the samples.
  
      drop_leftovers: If True, drop the data that cannot complete the last batch. This
          argument is ignored if x is a Sequence or a Dataset.
docstr_tok: ["If","converting","numpy","array","data","to","Sequence","to","optimize","performance",",","consider","using","ArrayLikeAdapter",".","Args",":","x",":","Input","data",".","It","could","be",":","1",")","A","Numpy","array","(","or","array-like",")",",","or","a","list","of","arrays","(","in","case","the","model","has","multiple","inputs",")",".","2",")","A","dict","mapping","input","names","to","the","corresponding","array",",","if","the","model","has","named","inputs",".","y",":","Target","data",".","Like","the","input","data","x",",","it","could","be","either","Numpy","array","(","s",")",".","batch_size",":","Number","of","samples","per","batch",".","sample_weights",":","Numpy","array","of","weights","for","the","samples",".","drop_leftovers",":","If","True",",","drop","the","data","that","can","not","complete","the","last","batch",".","This","argument","is","ignored","if","x","is","a","Sequence","or","a","Dataset","."]
code: def __init__(
      self,
      x: ArrayLike,
      y: ArrayLike,
      batch_size: int,
      sample_weights: Optional[np.ndarray] = None,
      drop_leftovers: bool = False,
  ):
      """
      If converting numpy array data to Sequence to optimize performance, consider
      using ArrayLikeAdapter.
  
      Args:
          x: Input data. It could be:
              1) A Numpy array (or array-like), or a list of arrays (in case the model
              has multiple inputs).
              2) A dict mapping input names to the corresponding array, if the model
              has named inputs.
  
          y: Target data. Like the input data x, it could be either Numpy array(s).
  
          batch_size: Number of samples per batch.
  
          sample_weights: Numpy array of weights for the samples.
  
          drop_leftovers: If True, drop the data that cannot complete the last batch. This
              argument is ignored if x is a Sequence or a Dataset.
      """
  
      if not (
          isinstance(x, np.ndarray)
          or _is_list_of_numpy_array(x)
          or _is_dict_of_numpy_array(x)
      ):
          raise det.errors.InvalidDataTypeException(
              type(x),
              "Data which is not tf.data.Datasets or tf.keras.utils.Sequence objects must be a "
              "numpy array or a list/dict of numpy arrays. See the instructions below for "
              f"details:\n{keras.TFKerasTrial.build_training_data_loader.__doc__}",
          )
      if not (
          isinstance(y, np.ndarray)
          or _is_list_of_numpy_array(y)
          or _is_dict_of_numpy_array(y)
      ):
          raise det.errors.InvalidDataTypeException(
              type(y),
              "Data which is not tf.data.Datasets or tf.keras.utils.Sequence objects must be a "
              "numpy array or a list/dict of numpy arrays. See the instructions below for "
              f"details:\n{keras.TFKerasTrial.build_training_data_loader.__doc__}",
          )
  
      self._x_length = _length_of_multi_arraylike(x)
      self._y_length = _length_of_multi_arraylike(y)
  
      check.eq(
          self._x_length,
          self._y_length,
          "Length of x and y do not match.",
      )
      check.check_gt_eq(
          self._x_length,
          batch_size,
          "Batch size is too large for the input data.",
      )
      if sample_weights is not None:
          check.eq(
              self._x_length,
              len(sample_weights),
              "Lengths of input data and sample weights do not match.",
          )
  
      self.x = x
      self.y = y
      self.sample_weight = sample_weights
  
      self.batch_size = batch_size
      self.drop_leftovers = drop_leftovers
  
file_path: determined/harness/determined/keras/_data.py
imports: import math
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import tensorflow
  import determined
  from determined import keras
  from determined.common import check
label_desc: Use image node_id 1 to create a new _ArrayLikeAdapter object from inherited base classes: tf.keras.utils with example: obj = _ArrayLikeAdapter(x, y, batch_size, sample_weights, drop_leftovers)