MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __aenter__

Method __aenter__

lightx2v/utils/profiler.py:90–96  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

88 if not self.profile_memory:
89 return
90
91 reset_peak_memory_stats = getattr(torch_device_module, "reset_peak_memory_stats", None)
92 max_memory_allocated = getattr(torch_device_module, "max_memory_allocated", None)
93 if reset_peak_memory_stats is None or max_memory_allocated is None:
94 return
95
96 try:
97 if stack:
98 peak_allocated, peak_reserved = self._read_memory_peak()
99 for context in stack:

Callers

nothing calls this directly

Calls 3

_get_excluded_time_stackFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected