Skip to content

Commit

Permalink
fix unnecessary import in torch.tensorboard. __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sachahu1 committed Dec 11, 2023
1 parent 617c228 commit bf39212
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions torch/utils/tensorboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import tensorboard
from packaging.version import Version

if not hasattr(tensorboard, "__version__") or Version(
tensorboard.__version__
) < Version("1.15"):

if not hasattr(tensorboard, "__version__") or (tensorboard.__version__ < "1.15"):
raise ImportError("TensorBoard logging requires TensorBoard version 1.15 or above")

del Version
del tensorboard

from .writer import FileWriter, SummaryWriter # noqa: F401
Expand Down

0 comments on commit bf39212

Please sign in to comment.