import torch
import numpy as np
v = torch.tensor([1,2,3,4,5,6])
print(v.dtype)
print(v)
print(v[1:4])
print(v[1:])
f = torch.FloatTensor([1,2,3,4,5,6])
print(f.dtype)
print(f)
print(f.size())
v.view(6,1) # reshape
v.view(3,2) # reshape
v.view(3,-1) # reshape
a = np.array([1,2,3,4,5])
print(a)
tensor_cnv = torch.from_numpy(a)
print(tensor_cnv)
print(tensor_cnv.type())
numpy_cnv = tensor_cnv.numpy()
print(numpy_cnv)