Skip to content

Commit cfbf392

Browse files
committed
set no grad for predict
1 parent 2acd166 commit cfbf392

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

chebai/trainer/CustomTrainer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def _resolve_logging_argument(self, key: str, value: Any) -> Tuple[str, Any]:
8080
else:
8181
return key, value
8282

83+
@torch.no_grad()
8384
def predict_from_file(
8485
self,
8586
checkpoint_path: _PATH,
@@ -106,6 +107,7 @@ def predict_from_file(
106107
save_to=save_to,
107108
)
108109

110+
@torch.no_grad()
109111
def _predict_smiles(
110112
self,
111113
checkpoint_path: _PATH,

0 commit comments

Comments
 (0)