utils.py 132 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
import torch

rusty1s's avatar
rusty1s committed
3
tensors = ['FloatTensor', 'DoubleTensor']
rusty1s's avatar
rusty1s committed
4
5
6
7
8


def Tensor(str, x):
    tensor = getattr(torch, str)
    return tensor(x)