Slightly more general make_theano_batch