I have a theano shared variable of shape (1, 500), but when passed to a scan function the shape turns out to be (1, 1, 500). Example code snippet is below.
y_t1 = theano.shared(name='y_t1', value=np.zeros((1, 500), dtype=theano.config.floatX))
def forward(X, y_t1):
return y_t1
(hyp), _ = theano.scan(fn=forward, sequences=X, outputs_info=[y_t1])
y_t1 is created with size (1, 500) and reports its shape to be (1, 500) outside of the function "forward", but inside "forward" it has shape (1, 1, 500). Why does this happen?
Thanks.