Function Differences with torch.cuda.set_device

torch.cuda.set_device

torch.cuda.set_device(device)

For more information, see torch.cuda.set_device.

mindspore.set_context

mindspore.set_context(**kwargs)

For more information, see 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.