测试1 from torch.utils.data import TensorDataset,DataLoader import numpy as np import torch a = np.array([[1,2,3],[2,3,3],[1,1,2],[10,10,10],[100,200,200],[-1,-2,-3]]) print(a)X = torch.FloatTensor(a) print(X)dataset =TensorDataset(X,X) 测试2 from torch.utils.data import TensorDataset,DataLoader import numpy as np import torch a = np.array([[1,2,3],[2,3,3],[1,1,2],[10,10,10],[100,200,200],[-1,-2,-3]]) print(a)X = torch.FloatTensor(a) print(X)dataset =TensorDataset(X,X)dataloader = DataLoader(dataset,batch_size=4)