I’m assuming that the reason you’re padding a tensor and not a variable is that you don’t need its gradients. If so, couldn’t you turn the tensor into a Variable, then pad it, and then turn it back to a tensor with .data?