Hi,
I think the error you see does not come from your kernel but from an indexing operation that gets an invalid index value:
Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.

You can run your script with CUDA_LAUNCH_BLOCKING=1 to get a proper python stacktrace.