tf.data.Dataset. The converted dataset.
if isinstance(dataset, tf.data.Dataset):
return dataset
if isinstance(dataset, np.ndarray):
return tf.data.Dataset.from_tensor_slices(dataset.astype(np.float32))
def fit(self, dataset):
After Change
if isinstance(dataset, np.ndarray):
dataset = tf.data.Dataset.from_tensor_slices(
dataset.astype(np.float32))
return data_utils.batch_dataset(dataset, self.batch_size)
def fit(self, dataset):
Analyze the dataset and record useful information.