摘要:
1.张量与数组运算,张量必须在cpu上,产生结果为cpu上的张量,可继续与数组运算(张量必须在gpu上)
2.张量与张量运算,cpu上的张量与gpu上的张量是无法运行的,必须在相同的gpu上或cpu上,猜想不同型号的gpu因该也不行
报错代码 TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
报错代码:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! 阅读全文