"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "7a22a02a7032c6fcecaad47363d84f98e239da79"
Unverified Commit 0167edc8 authored by MrinalTyagi's avatar MrinalTyagi Committed by GitHub
Browse files

Added forward pass of test_inference_image_classification_head with torch.no_grad() (#14777)

parent 7a787c68
...@@ -347,7 +347,8 @@ class ViTModelIntegrationTest(unittest.TestCase): ...@@ -347,7 +347,8 @@ class ViTModelIntegrationTest(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, 1000)) expected_shape = torch.Size((1, 1000))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment