My goal is to convert a tensor into a ndarray without 'run' or 'eval'. I wanted to perform the same operation as the example.
A = tf.constant(5)
B = tf.constant([[A, 1], [0,0]])
However, ndarray can be inside tf.constant but tensor cannot. Therefore, I tried to perform the operation using the following example, but tf.make_ndarray does not work.
A = tf.constant(5)
C = tf.make_ndarray(A)
B = tf.constant([[C, 1], [0,0]])
https://github.com/tensorflow/tensorflow/issues/28840#issuecomment-509551333
As mentioned in the github link above, tf.make_ndarray does not work. To be precise, an error occurs because tensorflow requires a 'tensor_shape' that does not exist, instead of a 'shape' that exists.
How can I run the code in this situation?
tf.make_ndarrayexpects aTensorProto(e.g. read from a serialized graph or made withtf.make_tensor_proto), not atf.Tensor.