Convert PyTorch CUDA tensor to NumPy array
How do I convert a torch.Tensor (on GPU) to a numpy.ndarray (on CPU)?

Use .detach() to convert from GPU / CUDA Tensor to numpy array:
tensor.detach().cpu().numpy()

