i have used this device = torch.device(“cuda” if torch.cuda.is_available() else “cpu”)
now getting this error
File “main.py”, line 58, in 
main(args, CORE)
File “main.py”, line 48, in main
CORE.train(args)
File “/home/ali/BioNet_project/pytorch_version/utils.py”, line 90, in train
l.backward()
File “/home/ali/anaconda3/envs/torch/lib/python3.6/site-packages/torch/tensor.py”, line 198, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File “/home/ali/anaconda3/envs/torch/lib/python3.6/site-packages/torch/autograd/init.py”, line 100, in backward
allow_unreachable=True)  # allow_unreachable flag
RuntimeError: cuda runtime error (700) : an illegal memory access was encountered at /opt/conda/conda-bld/pytorch_1587428091666/work/aten/src/THCUNN/generic/SpatialClassNLLCriterion.cu:240