Based on this warning from the docs:

When using the CUDA backend, this operation may induce nondeterministic behaviour in its backward pass that is not easily switched off. Please see the notes on Reproducibility for background.

I would assume it’s randomly overwriting the values.