I'm using keras with a theano backend. Now I have a variable x, which is an theano tensor with a type field "TensorType(float32, 3D)".
I added
from keras import backend as K
at the beginning of my file. Then I wrote:
x = K.expand_dims(x, dim = 1)
I expected that the type field of x should be "TensorType(float32, 4D)". However, it is "TensorType(float32, (False, True, False, False))", and I cannot figure out the reason. In addition, the document of keras doesn't provide further information of this function, it just says that "Adds a 1-sized dimension at index "dim" ".
Besides, if I perform
x = K.squeeze(x, 1)
, the type field of x will be "TensorType(float32, matrix)", which is expected.