Solved by ptrblck in post #2 
              
              
                As the error points out, you cannot directly transform a GPU tensor to a numpy array and would need to transfer it to the CPU first via the tensor.cpu() operation before calling .numpy().