torch.accelerator.set_device_idx#
- torch.accelerator.set_device_idx(device, /)[原始碼]#
(已棄用) 將當前裝置索引設定為給定的裝置。
- 引數
device (
torch.device, str, int) – 給定的裝置,必須與當前的 accelerator 裝置型別匹配。
警告
torch.accelerator.set_device_idx()已棄用,推薦使用torch.accelerator.set_device_index(),將在未來的 PyTorch 版本中移除。