Skip to content

Commit 93655c3

Browse files
committed
Unbreak previously broken tests
1 parent 6adeb52 commit 93655c3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
7070
@test adjoint(a) isa Adjoint{elt,<:BlockSparseArray}
7171
@test_broken adjoint(a)[Block(1), :] isa Adjoint{elt,<:BlockSparseArray}
7272
# could also be directly a BlockSparseArray
73-
74-
a = dev(BlockSparseArray{elt}([1], [1, 1]))
75-
@allowscalar a[1, 2] = 1
76-
@test [a[Block(Tuple(it))] for it in eachindex(block_stored_indices(a))] isa Vector
77-
ah = adjoint(a)
78-
@test_broken [ah[Block(Tuple(it))] for it in eachindex(block_stored_indices(ah))] isa Vector
7973
end
8074
@testset "Constructors" begin
8175
# BlockSparseMatrix
@@ -210,6 +204,15 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
210204
## @test b[Block()[]] == 2
211205
end
212206
end
207+
208+
# adjoint and transpose
209+
a = dev(BlockSparseArray{elt}([1], [1, 1]))
210+
@allowscalar a[1, 2] = 1
211+
@test [@views(a[it]) for it in block_stored_indices(a)] isa Vector
212+
ah = adjoint(a)
213+
@test [@views(ah[it]) for it in block_stored_indices(ah)] isa Vector
214+
at = transpose(a)
215+
@test [@views(at[it]) for it in block_stored_indices(at)] isa Vector
213216
end
214217
@testset "Tensor algebra" begin
215218
a = dev(BlockSparseArray{elt}(undef, ([2, 3], [3, 4])))

0 commit comments

Comments
 (0)