We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 547cdd3 commit eff92d4Copy full SHA for eff92d4
1 file changed
ext/BlockTensorKitAdaptExt.jl
@@ -10,7 +10,9 @@ function Adapt.adapt_structure(to, x::BlockTensorMap)
10
end
11
12
function Adapt.adapt_structure(to, x::SparseBlockTensorMap)
13
- data′ = Dict(I => adapt(to, v) for (I, v) in x.data)
+ ad = adapt(to)
14
+ TT = Base.promote_op(ad, eltype(x))
15
+ data′ = Dict{CartesianIndex{ndims(x)}, TT}(I => adapt(to, v) for (I, v) in x.data)
16
return SparseBlockTensorMap(data′, space(x))
17
18
0 commit comments