wrap forward passes with torch.no_grad() (#19278)
This commit is contained in:
@@ -299,6 +299,7 @@ class DebertaV2ModelIntegrationTest(unittest.TestCase):
|
|||||||
|
|
||||||
input_ids = torch.tensor([[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]])
|
input_ids = torch.tensor([[0, 31414, 232, 328, 740, 1140, 12695, 69, 46078, 1588, 2]])
|
||||||
attention_mask = torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
|
attention_mask = torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
|
||||||
|
with torch.no_grad():
|
||||||
output = model(input_ids, attention_mask=attention_mask)[0]
|
output = model(input_ids, attention_mask=attention_mask)[0]
|
||||||
# compare the actual values for a slice.
|
# compare the actual values for a slice.
|
||||||
expected_slice = torch.tensor(
|
expected_slice = torch.tensor(
|
||||||
|
|||||||
Reference in New Issue
Block a user