Because of the asynchronous nature of cuda, the assert might not point to a full correct stack trace pointing to where the assert was triggered from.
if you run the program with CUDA_LAUNCH_BLOCKING=1 python script.py
this will help get a more exact stack trace