Skip to content

Commit 5a3e613

Browse files
lkdvosclaude
andcommitted
Test copy_blocks! write-back on JLArray storage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ab352af commit 5a3e613

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎test/linalg/factorizations.jl‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ using BlockTensorKit
55
using Random
66
using Combinatorics
77
using LinearAlgebra
8+
using Adapt
9+
using JLArrays
810

911
Vtr = (
1012
SumSpace(ℂ^3),
@@ -544,4 +546,10 @@ end
544546
d = BlockTensorKit.copy_dense!(BlockTensorKit.similar_dense(b), b) .* 2
545547
BlockTensorKit.copy_blocks!(b, d)
546548
@test BlockTensorKit.copy_dense!(BlockTensorKit.similar_dense(b), b) == d
549+
550+
tg = adapt(JLVector{Float64}, t)
551+
c = first(blocksectors(t))
552+
BlockTensorKit.copy_blocks!(block(t, c), d .* 3)
553+
BlockTensorKit.copy_blocks!(block(tg, c), JLArray(d .* 3))
554+
@test adapt(Vector{Float64}, tg) ≈ t
547555
end

0 commit comments

Comments
 (0)