Fix missing dependency in torch.utils.tensorboard (#115598)

Fixes #114591

Version package was removed in this pull request: #114108 but is still used in `torch.utils.tensorboard` causing import errors. The fix removes the import and uses a simpler check.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/115598
Approved by: https://github.com/malfet
This commit is contained in:
Sacha 2023-12-20 21:11:52 +00:00 committed by PyTorch MergeBot
parent 1d5a9a1c1a
commit bc0d8649a4

View file

@ -1,5 +1,5 @@
import tensorboard
from packaging.version import Version
from torch._vendor.packaging.version import Version
if not hasattr(tensorboard, "__version__") or Version(
tensorboard.__version__