[bugs] fix args.profile=False DummyProfiler errro

pull/5751/head
genghaozhe 2024-05-25 14:55:09 +00:00
parent ca674549e0
commit fba04e857b
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,12 @@ def get_profile_context(enable_flag, warmup_steps, active_steps, save_dir):
def step(self):
self.step_number += 1
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
pass
if enable_flag:
return profile(
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],