Skip to content

Commit bbb1d1a

Browse files
authored
Ensures that the XPU cache is cleared before creating tensors during the test. (#1892)
Ensures that the XPU cache is cleared before creating large tensors during the test.
1 parent 1f7a57f commit bbb1d1a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/regressions/test_tril.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class TestSimpleBinary(TestCase):
77
def test_tril(self, dtype=torch.bool):
88
max_seq_length = 131072
99
with torch.device("xpu"):
10+
torch.xpu.empty_cache()
1011
a = torch.ones(max_seq_length, max_seq_length, dtype=torch.bool)
1112
causal_mask = torch.tril(a)
1213
torch.xpu.synchronize()

0 commit comments

Comments
 (0)