torch.accelerator.set_device_index¶
- torch.accelerator.set_device_index(device, /)[source][source]¶
將當前裝置索引設定為給定裝置。
- 引數
device (
torch.device, str, int) – 必須與當前 accelerator 裝置型別匹配的給定裝置。
注意
如果此裝置索引為負,則此函式為空操作。
將當前裝置索引設定為給定裝置。
device (torch.device, str, int) – 必須與當前 accelerator 裝置型別匹配的給定裝置。
注意
如果此裝置索引為負,則此函式為空操作。