Skip to content

Commit

Permalink
Add torch import check - thanks @ddundo; add missing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Nov 23, 2024
1 parent d5da0e6 commit 53694d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UM2N/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import os

try:
import torch # noqa
except ImportError:
raise ImportError(
"PyTorch is required to use this package. Please install it first."
" Visit https://pytorch.org/get-started/locally/ for installation instructions."
)

os.environ["OMP_NUM_THREADS"] = "1"

from pkg_resources import DistributionNotFound, get_distribution # noqa
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies = [
"seaborn",
# "torch", # NOTE: Should be installed beforehand
"torch_geometric",
"wandb",
]
authors = [
{name = "Chunyang Wang"},
Expand Down

0 comments on commit 53694d6

Please sign in to comment.