PyTorch · Method
tensor.cuda
Moves a tensor to CUDA memory. It can select a GPU, request a memory format, and optionally perform an asynchronous host-side copy from pinned memory.
Last updated
Syntax
Tensor.cuda(device=None, non_blocking=False, memory_format=torch.preserve_format) → TensorIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
torch.Tensor.is_cudatorch.devicetorch.memory_formattorch.preserve_format