# Function Differences with torch.cuda.set_device ## torch.Tensor.cuda ```python torch.Tensor.cuda() ``` For more information, see [torch.Tensor.cuda](https://pytorch.org/docs/1.5.0/tensors.html#torch.Tensor.cuda). ## mindspore.set_context ```python mindspore.set_context(**kwargs) ``` For more information, see [mindspore.set_context](https://mindspore.cn/docs/en/r2.0.0-alpha/api_python/mindspore/mindspore.set_context.html#mindspore.set_context). ## Differences PyTorch: It is used to copy object in CUDA memory. MindSpore:When set parameter `device_target='GPU'` or `device_target='Ascend'`, Network and Tensor are copied to GPU/Ascend device automatically.