pandas to tensor torch

Solutions on MaxInterview for pandas to tensor torch by the best coders in the world

showing results for - "pandas to tensor torch"
Oskar
25 Jan 2020
1train_target = torch.tensor(train['Target'].values.astype(np.float32))
2train = torch.tensor(train.drop('Target', axis = 1).values.astype(np.float32)) 
3train_tensor = data_utils.TensorDataset(train, train_target) 
4train_loader = data_utils.DataLoader(dataset = train_tensor, batch_size = batch_size, shuffle = True)
5