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 fcbbc6f commit 76407ecCopy full SHA for 76407ec
foolbox/models/pytorch.py
@@ -1,4 +1,5 @@
1
import numpy as np
2
+import warnings
3
4
from .base import DifferentiableModel
5
@@ -43,6 +44,12 @@ def __init__(
43
44
self._model = model
45
self.cuda = cuda
46
47
+ if model.training:
48
+ warnings.warn(
49
+ 'The PyTorch model is in training mode and therefore might'
50
+ ' not be deterministic. Call the eval() method to set it in'
51
+ ' evaluation mode if this is not intended.')
52
+
53
def batch_predictions(self, images):
54
# lazy import
55
import torch
0 commit comments