@@ -45,7 +45,6 @@ def laplacian(verts: torch.Tensor, edges: torch.Tensor) -> torch.Tensor:
45
45
# i.e. A[i, j] = 1 if (i,j) is an edge, or
46
46
# A[e0, e1] = 1 & A[e1, e0] = 1
47
47
ones = torch .ones (idx .shape [1 ], dtype = torch .float32 , device = verts .device )
48
- # pyre-fixme[16]: Module `sparse` has no attribute `FloatTensor`.
49
48
A = torch .sparse .FloatTensor (idx , ones , (V , V ))
50
49
51
50
# the sum of i-th row of A gives the degree of the i-th vertex
@@ -60,14 +59,12 @@ def laplacian(verts: torch.Tensor, edges: torch.Tensor) -> torch.Tensor:
60
59
# pyre-fixme[58]: `/` is not supported for operand types `float` and `Tensor`.
61
60
deg1 = torch .where (deg1 > 0.0 , 1.0 / deg1 , deg1 )
62
61
val = torch .cat ([deg0 , deg1 ])
63
- # pyre-fixme[16]: Module `sparse` has no attribute `FloatTensor`.
64
62
L = torch .sparse .FloatTensor (idx , val , (V , V ))
65
63
66
64
# Then we add the diagonal values L[i, i] = -1.
67
65
idx = torch .arange (V , device = verts .device )
68
66
idx = torch .stack ([idx , idx ], dim = 0 )
69
67
ones = torch .ones (idx .shape [1 ], dtype = torch .float32 , device = verts .device )
70
- # pyre-fixme[16]: Module `sparse` has no attribute `FloatTensor`.
71
68
L -= torch .sparse .FloatTensor (idx , ones , (V , V ))
72
69
73
70
return L
@@ -124,7 +121,6 @@ def cot_laplacian(
124
121
ii = faces [:, [1 , 2 , 0 ]]
125
122
jj = faces [:, [2 , 0 , 1 ]]
126
123
idx = torch .stack ([ii , jj ], dim = 0 ).view (2 , F * 3 )
127
- # pyre-fixme[16]: Module `sparse` has no attribute `FloatTensor`.
128
124
L = torch .sparse .FloatTensor (idx , cot .view (- 1 ), (V , V ))
129
125
130
126
# Make it symmetric; this means we are also setting
@@ -173,7 +169,6 @@ def norm_laplacian(
173
169
e01 = edges .t () # (2, E)
174
170
175
171
V = verts .shape [0 ]
176
- # pyre-fixme[16]: Module `sparse` has no attribute `FloatTensor`.
177
172
L = torch .sparse .FloatTensor (e01 , w01 , (V , V ))
178
173
L = L + L .t ()
179
174
0 commit comments