def repeat(x, n):
    tensors = [x] * n
    stacked = T.stack(*tensors)
    return stacked.dimshuffle((1, 0, 2))
Repeat a 2D tensor:
dataset/ETHPy150Open sharadmv/deepx/deepx/backend/theano_backend.py/repeat