本接口为预留接口,暂不支持。
torch_npu.npu.restart_device(device_id: int, rebuild_all_resource: bool = False) -> None
恢复对应device上的状态,后续在此device上进行计算可以继续进行计算执行。
要确保是一个有效的device,这个device可以是被stop过的也可以是没有被stop。
1 2 3 4 5 | import torch import torch_npu torch.npu.set_device(0) torch_npu.npu.stop_device(0) torch_npu.npu.restart_device(0) |