Skip to content

Commit ab809c6

Browse files
committed
Add comment about using classes
1 parent 994932b commit ab809c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/torchjd/_linalg/_matrix.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
from torch import Tensor
44

5+
# Note: we're using classes and inherittance instead of NewType because it's possible to have
6+
# multiple inherittance but there is no type intersection. However, these classes should never be
7+
# instantiated: they're only used for static type checking.
8+
59

610
class Matrix(Tensor):
711
"""Tensor with exactly 2 dimensions."""

0 commit comments

Comments
 (0)