torch_npu.profiler.ProfilerAction
Profiler状态,Enum类型。
import torch import torch_npu ... torch_npu.profiler.ProfilerAction.WARMUP with torch_npu.profiler.profile( on_trace_ready=torch_npu.profiler.tensorboard_trace_handler("./result") ) as prof: for step in range(steps): train_one_step(step, steps, train_loader, model, optimizer, criterion) prof.step()