Is your code working fine on the CPU?
This would give you a better error message than the current assert statement.
If it’s working on the CPU, rerun the script with:
CUDA_LAUNCH_BLOCKING=1 python scripy.py args

and post the stack trace here, please.