Browse Source

[bugs] fix args.profile=False DummyProfiler errro

pull/5751/head
genghaozhe 6 months ago
parent
commit
fba04e857b
  1. 6
      examples/language/performance_evaluator.py

6
examples/language/performance_evaluator.py

@ -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],

Loading…
Cancel
Save