Answers for "can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor"

0

can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor

# 在我們想把 GPU tensor 轉換成 Numpy 時,需要先將 tensor 轉換到 CPU 去,
# 因為 Numpy 是 CPU-only 的。

# images.numpy() => images.cpu().numpy()
Posted by: Guest on June-13-2021

Code answers related to "can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor"

Browse Popular Code Answers by Language