# Function Differences with torch.cuda.set_device ## torch.cuda.set_device ```python torch.cuda.set_device(device) ``` For more information, see [torch.cuda.set_device](https://pytorch.org/docs/1.5.0/cuda.html#torch.cuda.set_device). ## 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 set the current `device`. MindSpore:It is not only used to set the current `device`, but also set the `mode`, `device_target`, `save_graphs`, etc.