First of all, if data samples were already somehow loaded by the program (for instance, as NumPy or TensorFlow structures), they can be passed directly to tf.data using the .from_tensors() or .from_tensor_slices() static methods.
Both accept nested array/tensor structures, but the latter will slice the data into samples along the first axis as follows:
x, y = np.array([1, 2, 3, 4]), np.array([5, 6, 7, 8])
d = tf.data.Dataset.from_tensors((x,y))
print(d.output_shapes) # > (TensorShape([4]), TensorShape([4]))
d_sliced = tf.data.Dataset.from_tensor_slices((x,y))
print(d_sliced.output_shapes) # > (TensorShape([]), TensorShape([]))
As we can observe, the second dataset, d_sliced, ends up containing four pairs of samples, each containing only one value.