// Iterate over the first dimension of the x array (=time).
outputs, updates = theano.scan(
self._step, // this will be called with arguments (sequences[i], outputs[i-1], non_sequences[i])
sequences=[x, dict(input=mask,taps=[0, -1])], // tensors to iterate over, inputs to _step
// initialization of the output. Input to _step with default tap=-1.
outputs_info=T.unbroadcast(alloc_zeros_matrix(X.shape[1], self.output_dim), 1),
non_sequences=self.U, // static inputs to _step