I have a tensor, X
of shape (T, n, k)
.
If I knew the shape beforehand, it is easy to reshape, tf.reshape(X, (T * n, k))
where T, n, k
are ints, not tensors. But is there a way to do this if I don't know the shapes. It seems that getting the shapes like shape = tf.shape(X)
and reshaping doesn't work. That is,
tf.reshape(X, (tf.shape[0] * tf.shape[1], tf.shape[2]))
Any ideas? In my application, T
and k
are known before runtime but n
is only known at runtime.