If we keep this op code in Theano, I would put it in gof/utils.py