I want to change list to tensor with tf.convert_to_tensor
, data is following:
data=[
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
You can't. Like the error message says, TensorFlow arrays can not have different sizes along one dimension. Try to use a list of TensorFlow arrays instead or the dataset api.
I'm not sure whether they exist in TensorFlow 1 but TensorFlow 2.0 supports RaggedTensors, which the documentation describes as "... the TensorFlow equivalent of nested variable-length lists."
I think it would be trivial to convert your data to RaggedTensors. It might even be as easy as:
data_tensor = tf.ragged.constant(data)