@@ -94,28 +94,6 @@ def test_noncanonical_same_length_uses_dense_reference(self):
9494 rotate_back_reference (x_local , wigner , coeff_index , dim ),
9595 )
9696
97- def test_explicit_block_uses_shape_contract_only (self ):
98- device = torch .device ("cpu" )
99- dtype = torch .float32
100- lmax = 3
101- dim = get_so3_dim_of_lmax (lmax )
102- canonical = build_m_major_index (lmax , 1 , device = device )
103- coeff_index = torch .roll (canonical , shifts = 1 )
104- x = torch .randn (4 , dim , 3 , device = device , dtype = dtype )
105- src = torch .tensor ([0 , 2 , 1 , 3 , 0 ], dtype = torch .long , device = device )
106- wigner = torch .randn (src .numel (), dim , dim , device = device , dtype = dtype )
107- x_local = torch .randn (
108- src .numel (), coeff_index .numel (), 3 , device = device , dtype = dtype
109- )
110-
111- self .assertEqual (
112- rotate_to_local_block (x , src , wigner , coeff_index , dim ).shape , x_local .shape
113- )
114- self .assertEqual (
115- rotate_back_block (x_local , wigner , coeff_index , dim ).shape ,
116- (src .numel (), dim , 3 ),
117- )
118-
11997 def test_symbolic_trace_noncanonical_same_length_uses_dense_op (self ):
12098 device = torch .device ("cpu" )
12199 dtype = torch .float32
@@ -186,7 +164,7 @@ def _assert_to_local_matches_reference(self, x0, src, w0, coeff_index, dim):
186164
187165 xa = x0 .clone ().requires_grad_ (True )
188166 wa = w0 .clone ().requires_grad_ (True )
189- out = rotate_to_local_block (xa , src , wa , coeff_index , dim )
167+ out = rotate_to_local_block (xa , src , wa , lmax )
190168 xr = x0 .clone ().requires_grad_ (True )
191169 wr = w0 .clone ().requires_grad_ (True )
192170 ref = rotate_to_local_reference (xr , src , wr , coeff_index , dim )
@@ -206,7 +184,7 @@ def _assert_back_matches_reference(self, xl0, w0, coeff_index, dim):
206184
207185 xa = xl0 .clone ().requires_grad_ (True )
208186 wa = w0 .clone ().requires_grad_ (True )
209- out = rotate_back_block (xa , wa , coeff_index , dim )
187+ out = rotate_back_block (xa , wa , lmax )
210188 xr = xl0 .clone ().requires_grad_ (True )
211189 wr = w0 .clone ().requires_grad_ (True )
212190 ref = rotate_back_reference (xr , wr , coeff_index , dim )
@@ -248,7 +226,7 @@ def test_symbolic_make_fx_rotate_to_local_forward_backward_matches_eager(self):
248226 def forward_and_grad (x , wigner ):
249227 x_req = x .detach ().requires_grad_ (True )
250228 w_req = wigner .detach ().requires_grad_ (True )
251- out = rotate_to_local_block (x_req , src , w_req , coeff_index , dim )
229+ out = rotate_to_local_block (x_req , src , w_req , lmax )
252230 grad_x , grad_wigner = torch .autograd .grad (
253231 out ,
254232 (x_req , w_req ),
@@ -291,7 +269,7 @@ def test_symbolic_make_fx_rotate_back_forward_backward_matches_eager(self):
291269 def forward_and_grad (x_local , wigner ):
292270 x_req = x_local .detach ().requires_grad_ (True )
293271 w_req = wigner .detach ().requires_grad_ (True )
294- out = rotate_back_block (x_req , w_req , coeff_index , dim )
272+ out = rotate_back_block (x_req , w_req , lmax )
295273 grad_x , grad_wigner = torch .autograd .grad (
296274 out ,
297275 (x_req , w_req ),
0 commit comments