Im extracting data from a csv file with pandas and converted it to pytorch tensors.
Y = torch.from_numpy(np.array(cdf[‘class’][:4000], dtype=np.long))
X = torch.from_numpy(np.column_stack((np.array(cdf[‘cap-shape’][:4000], dtype=np.float), np.array(cdf[‘cap-surface’][:4000], dtype=np.float), np.array(cdf[‘cap-color’][:4000], dtype=np.float))))
x = Variable(X, requires_grad=True).float()
y = Variable(Y)