[bugs] fix args.profile=False DummyProfiler errro

pull/5751/head
genghaozhe 6 months ago
parent ca674549e0
commit fba04e857b

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

Loading…
Cancel
Save