wrap forward passes with torch.no_grad() (#19279)
This commit is contained in:
@@ -384,6 +384,7 @@ class DeiTModelIntegrationTest(unittest.TestCase):
|
|||||||
inputs = feature_extractor(images=image, return_tensors="pt").to(torch_device)
|
inputs = feature_extractor(images=image, return_tensors="pt").to(torch_device)
|
||||||
|
|
||||||
# forward pass
|
# forward pass
|
||||||
|
with torch.no_grad():
|
||||||
outputs = model(**inputs)
|
outputs = model(**inputs)
|
||||||
|
|
||||||
# verify the logits
|
# verify the logits
|
||||||
|
|||||||
Reference in New Issue
Block a user