I was wondering how to make a 5D tensor in Theano.
Specifically, I tried dtensor = T.TensorType('float32', (False,)*5)
. However, the only issue is that dtensor.shape
returns: AttributeError: 'TensorType' object has no attribute 'shape'
Whereas if I used a standard tensor type likedtensor = T.tensor3('float32')
, I don't get this issue when I call dtensor.shape.
Is there a way to have this not be an issue with a 5D tensor in Theano?
Theano variables do not have explicit shape information since they are symbolic variables, not numerical. Even dtensor3 = T.tensor3(T.config.floatX)
does not have an explicit shape. When you type dtensor3.shape
you'll get an object Shape.0
but when you do dtensor3.shape.eval()
to get its value you'll get an error.
For both cases however, dtensor.ndim
works and prints out 5
and 3
respectively.