Solved by ptrblck in post #2 
              
              
                The code raises an error on the CPU as well as the GPU using the latest stable version (1.7.0). 
Note that assert statements in CUDA code were mostly disabled in 1.5.0 due to a bug, so that your code doesn’t raise the proper error if you are using the GPU. 
The reason for the error is that your weig…