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.
2 parents 9b055ad + 97af490 commit ab5db83Copy full SHA for ab5db83
foolbox/models/pytorch.py
@@ -65,11 +65,13 @@ def __init__(
65
self._model = model.to(self.device)
66
67
if model.training:
68
- warnings.warn(
69
- "The PyTorch model is in training mode and therefore might"
70
- " not be deterministic. Call the eval() method to set it in"
71
- " evaluation mode if this is not intended."
72
- )
+ with warnings.catch_warnings():
+ warnings.simplefilter("always")
+ warnings.warn(
+ "The PyTorch model is in training mode and therefore might"
+ " not be deterministic. Call the eval() method to set it in"
73
+ " evaluation mode if this is not intended."
74
+ )
75
76
def forward(self, inputs):
77
# lazy import
0 commit comments