Skip to content

Commit 48de187

Browse files
committed
Add comment about strides
1 parent 10f250c commit 48de187

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/torchjd/sparse/_diagonal_sparse_tensor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def __init__(self, physical: Tensor, v_to_ps: list[list[int]]):
6666

6767
self.physical = physical
6868
self.v_to_ps = v_to_ps
69+
70+
# strides is of shape [v_ndim, p_ndim], such that v_index = strides @ p_index
6971
pshape = list(self.physical.shape)
7072
self.strides = tensor([strides_v2(pdims, pshape) for pdims in self.v_to_ps])
7173

0 commit comments

Comments
 (0)