wrap forward passes with torch.no_grad() (#19414)
This commit is contained in:
@@ -538,7 +538,8 @@ class ImageGPTModelIntegrationTest(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
|
||||||
outputs = model(**inputs)
|
with torch.no_grad():
|
||||||
|
outputs = model(**inputs)
|
||||||
|
|
||||||
# verify the logits
|
# verify the logits
|
||||||
expected_shape = torch.Size((1, 1024, 512))
|
expected_shape = torch.Size((1, 1024, 512))
|
||||||
|
|||||||
Reference in New Issue
Block a user