RuntimeError                              Traceback (most recent call last)
<ipython-input-12-1c0a7c8d9dd2> in <module>()
     23     loss += Loss(out, target)
     24 
---> 25     loss.backward()
     26     optimizer.step()
     27 

/usr/local/lib/python3.5/site-packages/torch/autograd/variable.py in backward(self, gradient, retain_variables)
    144                     'or with gradient w.r.t. the variable')
    145             gradient = self.data.new().resize_as_(self.data).fill_(1)
--> 146         self._execution_engine.run_backward((self,), (gradient,), retain_variables)
    147 
    148     def register_hook(self, hook):

/usr/local/lib/python3.5/site-packages/torch/nn/_functions/thnn/pooling.py in backward(self, grad_output, _indices_grad)
     61                                                          self.pad, 0,
     62                                                          self.dilation, 1,
---> 63                                                          self.ceil_mode)
     64         grad_input = grad_input.squeeze(2)
     65         return grad_input

RuntimeError: cuda runtime error (59) : device-side assert triggered at /b/wheel/pytorch-src/torch/lib/THCUNN/generic/SpatialDilatedMaxPooling.cu:228

It seems there are more problems than I just use cpu.I do not know why.
RuntimeError: cuda runtime error (59) : device-side assert triggered at /b/wheel/pytorch-src/torch/lib/THCUNN/generic/Threshold.cu:66

is there a best practice to debug these problems?