Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 14, 2021
1 parent e0de6e5 commit 5965162
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytorch_lightning/utilities/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def _compare_version(package: str, op, version) -> bool:
>>> _compare_version("torch", operator.ge, "0.1")
True
"""
if not _module_available(package):
return False
try:
pkg = importlib.import_module(package)
assert hasattr(pkg, '__version__')
Expand Down

0 comments on commit 5965162

Please sign in to comment.