Skip to content

Commit 2ff87dc

Browse files
committed
test(operation): add tests for operation module
1 parent 802673d commit 2ff87dc

File tree

2 files changed

+3890
-0
lines changed

2 files changed

+3890
-0
lines changed

test/test_parity_tensor.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from parity_tensor import ParityTensor
2+
3+
import torch
4+
5+
def test_operation() -> None:
6+
x = ParityTensor((False, False), ((2, 2), (1, 3)), torch.randn([4, 4])).update_mask()
7+
8+
print()
9+
print(x)
10+
print()
11+
print(x.permute((0, 1)))
12+
print()
13+
print(x.permute((1, 0)))
14+
print()
15+
print(x + 1)
16+
print()
17+
print(x * 2)
18+
print()
19+
print(x / 2)
20+

0 commit comments

Comments
 (0)