wrap forward passes with torch.no_grad() (#19414)

This commit is contained in:
Partho
2022-10-11 00:33:24 +05:30
committed by GitHub
parent d739a707d9
commit c6a928cadb

View File

@@ -538,6 +538,7 @@ class ImageGPTModelIntegrationTest(unittest.TestCase):
inputs = feature_extractor(images=image, return_tensors="pt").to(torch_device)
# forward pass
with torch.no_grad():
outputs = model(**inputs)
# verify the logits