MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / wrapper

Function wrapper

python/paddle/profiler/utils.py:197–204  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

195 def optimizer_wrapper(func):
196 @functools.wraps(func)
197 def wrapper(*args, **kwargs):
198 if in_profiler_mode():
199 with RecordEvent(
200 'Optimization Step', event_type=TracerEventType.Optimization
201 ):
202 return func(*args, **kwargs)
203 else:
204 return func(*args, **kwargs)
205
206 return wrapper
207

Callers

nothing calls this directly

Calls 3

in_profiler_modeFunction · 0.85
RecordEventClass · 0.70
funcFunction · 0.50

Tested by

no test coverage detected