Is it possible to transform a 1D tensor to a list ?
thank you
l = tf.Variable([0, 1, 2, 3]).numpy().tolist()
type(l)
>>> list
l
>>> [0, 1, 2, 3]
This method lets convert to list not only 1D tensor, but also any other shape
import tensorflow as tf
a = tf.constant([[1,2,3],[4,5,6]])
a = tf.make_tensor_proto(a)
a = tf.make_ndarray(a)
a = a.tolist()
OR
import tensorflow as tf
a = tf.constant([[1,2,3],[4,5,6]])
a = a.numpy().tolist()