Trying to use Cuda to train model. Already passed model and input to cuda device:
if use_gpu: 
	self.net.cuda();
criterion = nn.CrossEntropyLoss();
optimizer = optim.Adam(self.net.parameters(), lr=1e-3);

inputs, labels = data;
if use_gpu:
	inputs = inputs.cuda();
	labels = labels.cuda();

But when it executes loss.backward() it immediately crashes without any error.
outputs = self.net(inputs);
loss = criterion(outputs, labels);
loss.backward();

I am using pytorch version 1.3.1+cu92 with NVIDIA GeForce RTX 2060
Already tried to install cuda driver.
Any tips?