utils.py 116 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
import torch

tensors = ['FloatTensor']


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