class_docstr: Adpat the input and output format for Keras Model.
  
  Adapter is used by the input nodes and the heads of the hypermodel. It do
  some type checking for the data and converts it to tf.data.Dataset format.
  It also batches the dataset if it is not batched.
docstr: Convert supported formats of datasets to batched tf.data.Dataset.
  
  # Arguments
      dataset: Usually numpy.ndarray, pandas.DataFrame or
          tensorflow.Dataset. The dataset to be converted.
      batch_size: Int. The batch_size to batch the dataset.
  
  # Returns
      tf.data.Dataset. The converted dataset.
docstr_tok: ["Convert","supported","formats","of","datasets","to","batched","tf.data.Dataset",".","#","Arguments","dataset",":","Usually","numpy.ndarray",",","pandas.DataFrame","or","tensorflow.Dataset",".","The","dataset","to","be","converted",".","batch_size",":","Int",".","The","batch_size","to","batch","the","dataset",".","#","Returns","tf.data.Dataset",".","The","converted","dataset","."]
code: def convert_to_dataset(self, dataset, batch_size):
      """Convert supported formats of datasets to batched tf.data.Dataset.
  
      # Arguments
          dataset: Usually numpy.ndarray, pandas.DataFrame or
              tensorflow.Dataset. The dataset to be converted.
          batch_size: Int. The batch_size to batch the dataset.
  
      # Returns
          tf.data.Dataset. The converted dataset.
      """
      if isinstance(dataset, np.ndarray):
          dataset = tf.data.Dataset.from_tensor_slices(dataset)
      return data_utils.batch_dataset(dataset, batch_size)
  
file_path: autokeras/autokeras/engine/adapter.py
imports: import numpy
  import tensorflow
  from autokeras.utils import data_utils
label_desc: Use image node_id 2 for calling the Adapter obj's underlying member method code with example usage: obj.convert_to_dataset(dataset, batch_size) and returns: data_utils