We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e1c826 commit 62a7a7dCopy full SHA for 62a7a7d
sdk/diffgram/pytorch_diffgram/diffgram_pytorch_dataset.py
@@ -1,7 +1,12 @@
1
from torch.utils.data import Dataset, DataLoader
2
-import torch as torch # type: ignore
3
from diffgram.core.diffgram_dataset_iterator import DiffgramDatasetIterator
4
+try:
5
+ import torch as torch # type: ignore
6
+except ModuleNotFoundError:
7
+ raise ModuleNotFoundError(
8
+ "'torch' module should be installed to convert the Dataset into torch (pytorch) format"
9
+ )
10
11
class DiffgramPytorchDataset(DiffgramDatasetIterator, Dataset):
12
0 commit comments