@@ -8,6 +8,7 @@ using NDTensors.GradedAxes:
88using NDTensors. LabelledNumbers: label
99using NDTensors. SparseArrayInterface: nstored
1010using NDTensors. TensorAlgebra: fusedims, splitdims
11+ using LinearAlgebra: adjoint
1112using Random: randn!
1213function blockdiagonal! (f, a:: AbstractArray )
1314 for i in 1 : minimum (blocksize (a))
@@ -38,8 +39,6 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
3839 @test blocklengths .(axes (b)) == ([2 , 2 ], [2 , 2 ], [2 , 2 ], [2 , 2 ])
3940 @test nstored (b) == 32
4041 @test block_nstored (b) == 2
41- # TODO : Have to investigate why this fails
42- # on Julia v1.6, or drop support for v1.6.
4342 for i in 1 : ndims (a)
4443 @test axes (b, i) isa GradedOneTo
4544 end
@@ -158,11 +157,11 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
158157 b = 2 * a
159158 @test block_nstored (b) == 2
160159 @test Array (b) == 2 * Array (a)
161- @test a[:, :] isa BlockSparseArray
162- for ax in axes (b)
163- @test ax isa GradedUnitRangeDual
160+ @test a[:, :] isa BlockSparseArray # broken in 1.6
161+ for i in 1 : 2
162+ @test axes (b, i) isa GradedUnitRangeDual
163+ @test_broken axes (a[:, :], i) isa GradedUnitRangeDual
164164 end
165-
166165 I = [Block (1 )[1 : 1 ]]
167166 @test_broken a[I, :]
168167 @test_broken a[:, I]
@@ -179,9 +178,10 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
179178 b = 2 * a
180179 @test block_nstored (b) == 2
181180 @test Array (b) == 2 * Array (a)
182- @test a[:, :] isa BlockSparseArray
183- for ax in axes (b)
184- @test ax isa GradedUnitRangeDual
181+ @test a[:, :] isa BlockSparseArray # broken in 1.6
182+ for i in 1 : 2
183+ @test axes (b, i) isa GradedUnitRangeDual
184+ @test_broken axes (a[:, :], i) isa GradedUnitRangeDual
185185 end
186186
187187 I = [Block (1 )[1 : 1 ]]
@@ -191,7 +191,7 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
191191 @test_broken GradedAxes. isdual (axes (a[I, I], 1 ))
192192 end
193193
194- @testset " BlockedUnitRange" begin
194+ @testset " BlockedUnitRange" begin # self dual
195195 r = blockedrange ([2 , 2 ])
196196 a = BlockSparseArray {elt} (dual (r), dual (r))
197197 @views for i in [Block (1 , 1 ), Block (2 , 2 )]
@@ -201,8 +201,9 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
201201 @test block_nstored (b) == 2
202202 @test Array (b) == 2 * Array (a)
203203 @test a[:, :] isa BlockSparseArray
204- for ax in axes (b)
205- @test ax isa BlockedOneTo
204+ for i in 1 : 2
205+ @test axes (b, i) isa BlockedOneTo
206+ @test axes (a[:, :], i) isa BlockedOneTo
206207 end
207208
208209 I = [Block (1 )[1 : 1 ]]
@@ -226,7 +227,8 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
226227 @test ax isa typeof (dual (r))
227228 end
228229
229- @test a[:, :] isa BlockSparseArray
230+ @test a[:, :] isa BlockSparseArray # broken in 1.6
231+ @test axes (a[:, :]) isa Tuple{BlockedOneTo,BlockedOneTo} # broken in 1.6
230232
231233 I = [Block (1 )[1 : 1 ]]
232234 @test size (a[I, :]) == (1 , 4 )
0 commit comments