Skip to content

Commit

Permalink
Remove dead code for torch import check (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian authored Nov 16, 2024
1 parent 66c16ff commit 4727428
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/viztracer/viztracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,7 @@ def start(self) -> None:
self.enable = True
self.parsed = False
if self.log_torch:
try:
from torch.profiler import profile, supported_activities # type: ignore
except ImportError:
raise ImportError("torch is not installed, please install it to use log_torch")
from torch.profiler import profile, supported_activities # type: ignore
self.torch_profile = profile(activities=supported_activities()).__enter__()
if self.log_print:
self.overload_print()
Expand Down

0 comments on commit 4727428

Please sign in to comment.