toto'
toto'

Reputation: 1574

How get Tensorflow shape

I have the following constant in TensorFlow:

t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])

Now I want to know its shape. I have tried to run:

tf.shape(t)

I get: <tf.Tensor 'Shape:0' shape=(3,) dtype=int32>

I thought i should see something like [2,2,3]. How can I read the expected shape value?

thanks

Upvotes: 0

Views: 78

Answers (1)

rgk
rgk

Reputation: 1015

You may be looking for tf.get_shape(), which returns the TensorShape.

Upvotes: 1

Related Questions