It would start then without with construct also, right?
autograd_profiler = torch.autograd.profiler.profile(enabled=args.profile_autograd)
# model code
autograd_profiler.export_chrome_trace(args.profile_autograd)

Do you know if I can stop it explicitly? I could not find a method for that in docs: https://pytorch.org/docs/stable/autograd.html#torch.autograd.profiler.profile 7