new.py 149 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
import torch
from torch.autograd import Variable


rusty1s's avatar
rusty1s committed
5
6
def new(x, *size):
    return x.new(*size) if torch.is_tensor(x) else Variable(x.data.new(*size))