We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0ba8308 + cceac45 commit 2ef1159Copy full SHA for 2ef1159
ptgnn/baseneuralmodel/abstractneuralmodel.py
@@ -1,6 +1,7 @@
1
from typing_extensions import final
2
3
import gzip
4
+import os
5
import torch
6
from abc import ABC, abstractmethod
7
from concurrent import futures
@@ -151,6 +152,7 @@ def build_neural_module(self) -> TNeuralModule:
151
152
153
# region Saving/Loading
154
def save(self, path: Path, model: TNeuralModule) -> None:
155
+ os.makedirs(os.path.dirname(str(path)), exist_ok=True)
156
with gzip.open(path, "wb") as f:
157
torch.save((self, model), f)
158
0 commit comments