def adapt(self, dataset, batch_size):
        """Check, convert and batch the 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.
        """
        self.check(dataset)
        dataset = self.convert_to_dataset(dataset, batch_size)
        return dataset
Check, convert and batch the 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.
        
autokeras/engine/adapter.py