Suddenly - RuntimeError: CUDA error: device-side assert triggered

I checked other suggestions, but other people used RNN Networks and data labels.
In my case, everything was working fine yesterday, but suddenly my code is not working anymore.

I am trying to run this code on my local machine:

C:/w/1/s/tmp_conda_3.6_045031/conda/conda-bld/pytorch_1565412750030/work/aten/src/THC/ block: [25,0,0], thread: [63,0,0] Assertion dstIndex < dstAddDimSize failed.
THCudaCheck FAIL file=C:/w/1/s/tmp_conda_3.6_045031/conda/conda-bld/pytorch_1565412750030/work/aten/src\THC/THCTensorMathCompareT.cuh line=69 error=59 : device-side assert triggered
Traceback (most recent call last):
File “”, line 763, in
agent.train(epochs, horizon)
File “”, line 629, in train
loss = self.update_model()
File “”, line 578, in update_model
elementwise_loss_n_loss = self._compute_dqn_loss(samples, gamma)
File “”, line 710, in _compute_dqn_loss
dist = self.dqn.dist(state)
File “”, line 386, in dist
File “C:\Users\un_po\Anaconda3\envs\rainbowPy\lib\site-packages\torch\”, line 82, in repr
return torch._tensor_str._str(self)
File “C:\Users\un_po\Anaconda3\envs\rainbowPy\lib\site-packages\”, line 300, in _str
tensor_str = _tensor_str(self, indent)
File “C:\Users\un_po\Anaconda3\envs\rainbowPy\lib\site-packages\”, line 201, in _tensor_str
formatter = _Formatter(get_summarized_data(self) if summarize else self)
File “C:\Users\un_po\Anaconda3\envs\rainbowPy\lib\site-packages\”, line 87, in init
nonzero_finite_vals = torch.masked_select(tensor_view, torch.isfinite(tensor_view) &
File “C:\Users\un_po\Anaconda3\envs\rainbowPy\lib\site-packages\torch\”, line 228, in isfinite
return (tensor == tensor) & (tensor.abs() != inf)
RuntimeError: cuda runtime error (59) : device-side assert triggered at C:/w/1/s/tmp_conda_3.6_045031/conda/conda-bld/pytorch_1565412750030/work/aten/src\THC/THCTensorMathCompareT.cuh:69

Yesterday the same code just worked fine.

And the code still works on CPU.

Downgrading pytorch and cuda helped. Strange

Did you change something else besides the PyTorch version?
What CUDA, cudnn, and PyTorch versions are you using now and which one raised this error?
Do you have a reproducible code snippet so that we could have a look?