I have a dataset represented as a NumPy matrix of shape (num_features, num_examples) and I wish to convert it to TensorFlow type tf.Dataset.
I think @MatthewScarpino clearly explained the differences between these two methods.
Here I try to describe the typical usage of these two methods:
from_tensors can be used to construct a larger dataset from several small datasets, i.e., the size (length) of the dataset becomes larger;
while from_tensor_slices can be used to combine different elements into one dataset, e.g., combine features and labels into one dataset (that's also why the 1st dimension of the tensors should be the same). That is, the dataset becomes "wider".