(beta)torch_npu.npu.restart_device

本接口为预留接口,暂不支持。
接口原型
torch_npu.npu.restart_device(device_id: int, rebuild_all_resource: bool = False) -> None
功能描述
恢复对应device上的状态,后续在此device上进行计算可以继续进行计算执行。
参数说明
- “device_id”(int) 需要处理的device id。
- “rebuild_all_resource”(bool),是一个保留参数,在当前接口中没有实际的功能。
输入说明
要确保是一个有效的device,这个device可以是被stop过的也可以是没有被stop。
支持的型号
- Atlas A2 训练系列产品
调用示例
import torch import torch_npu torch.npu.set_device(0) torch_npu.npu.stop_device(0) torch_npu.npu.restart_device(0)
父主题: torch_npu.npu