mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
Added with torch.no_grad() to Camembert integration test (#21544)
add with torch.no_grad() to Camembert integration test Co-authored-by: Bibi <Bibi@katies-mac.local>
This commit is contained in:
parent
f83942684d
commit
21a2d900ec
1 changed files with 2 additions and 1 deletions
|
|
@ -39,7 +39,8 @@ class CamembertModelIntegrationTest(unittest.TestCase):
|
|||
device=torch_device,
|
||||
dtype=torch.long,
|
||||
) # J'aime le camembert !
|
||||
output = model(input_ids)["last_hidden_state"]
|
||||
with torch.no_grad():
|
||||
output = model(input_ids)["last_hidden_state"]
|
||||
expected_shape = torch.Size((1, 10, 768))
|
||||
self.assertEqual(output.shape, expected_shape)
|
||||
# compare the actual values for a slice.
|
||||
|
|
|
|||
Loading…
Reference in a new issue