Skip to content

Commit

Permalink
simplify super:
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsn committed Dec 10, 2024
1 parent 754d1fe commit eabbf1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ddtrace/profiling/collector/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def _start_service(self):
raise collector.CollectorUnavailable(e)
self._torch_module = torch
self.patch()
super(MLProfilerCollector, self)._start_service()
super()._start_service()

def _stop_service(self):
# type: (...) -> None
"""Stop collecting framework profiler usage."""
super(MLProfilerCollector, self)._stop_service()
super()._stop_service()
self.unpatch()

def patch(self):
Expand Down Expand Up @@ -96,6 +96,9 @@ class TorchProfilerCollector(MLProfilerCollector):

PROFILED_TORCH_CLASS = _WrappedTorchProfiler

def __init__(self, recorder=None):
super().__init__(recorder)

def _get_patch_target(self):
# type: (...) -> typing.Any
return self._torch_module.profiler.profile
Expand Down

0 comments on commit eabbf1d

Please sign in to comment.