A line of code: Hx.scatter(1, indices, kmatrix) in my project threw the error: “RuntimeError: invalid argument 3: Index tensor must have the same size as input tensor”. The error is invoked only on GPU, but not CPU. This is weird, especially it seems to relate to the variable size, which should not differ on different devices.
What’s the reason for this?