import numpy as np
input = np.random.rand(2,3,4)*10 #乘以10,把元素的值变为0~10,同理可以变为任意范围
input = input.astype(np.float32) #使用astype()可以变为指定类型的数据,doubel就是float32
input = torch.from_numpy(input)
import numpy as np
input = np.random.randn(2,3,4)*10 #乘以10,把元素的值变为0~10,同理可以变为任意范围
input = input.astype(np.float32) #使用astype()可以变为指定类型的数据,doubel就是float32
input = torch.from_numpy(input)