Hi everyone, I have a doubt about slicing on cuda tensor (Pytorch 1.10 - GPU RTX 3070). For example, following code cant learning
# labels for multi-outputs  
for epoch in range(epochs):
   for features, labels in train_loader:
      features = features.to(device)
      labels = labels.to(device)
      preds = model(x)
      loss = cross_entropy(preds, labels[:,0])
      optim.zero_grad()
      loss.backward()
      optim.step()

But, if I use :
 loss = cross_entropy(preds, labels[:,0].contiguous())

it works!, the model starts learning. What is the difference or its a bug?. (Sorry for my bad english).
Thanks in advance!