When batch_size is set to 1 (it's original value), the test fails. An assert downstream expects the batch to be a Theano matrix, but setting batch_size=1 here causes the batch to be a Theano Vector. I will look into this tomorrow, but any suggestions as to what might be happening or where I should look would be very much appreciated.