I want to generate windows of the range of 10:
import tensorflow as tf
dataset = tf.data.Dataset.from_tensor_slices(tf.range(10))
dataset = dataset.window(5, shift=1, drop_remainder=True)
and would like to train my model on this dataset.
To do so, those windows have to be converted to tensors. But the datatype of these windows cannot be converted via tf.convert_to_tensor to a tensor. It is possible to do tf.convert_to_tensor(list(window)) but this is quite inefficient.
Does anyone know how to convert a tf.VariantDataset efficiently to a tf.Tensor?
Thank you for your help!