import tensorflow as tf features = tf.reshape(tf.cast(tf.range(40), tf.float32), (20, 2)) labels = tf.cast(tf.range(20) % 2, tf.int32) full_dataset = tf.data.Dataset.from_tensor_slices((features, labels))