device¶ class torch.mtia.device(device)[源代码][源代码]¶ 改变所选设备的上下文管理器。 参数 device (torch.device 或 int) – 要选择的设备索引。如果此参数为负整数或 None,则此操作无效(no-op)。