MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / profile_callable

Method profile_callable

monai/utils/profiling.py:323–333  ·  view source on GitHub ↗

Decorator which can be applied to a function which profiles any calls to it. All calls to decorated callables must be done within the context of the profiler.

(self, name=None)

Source from the content-addressed store, hash-verified

321 self._put_result(name, diff, caller.filename, caller.lineno)
322
323 def profile_callable(self, name=None):
324 """
325 Decorator which can be applied to a function which profiles any calls to it. All calls to decorated
326 callables must be done within the context of the profiler.
327 """
328
329 def _outer(func):
330 _name = func.__name__ if name is None else name
331 return self.profile_ctx(_name)(func)
332
333 return _outer
334
335 def profile_iter(self, name, iterable):
336 """Wrapper around anything iterable to profile how long it takes to generate items."""

Callers 1

test_profile_callableMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_profile_callableMethod · 0.64