Skip to content

Commit 7c269cd

Browse files
committed
fix: storagetypes
1 parent d927cb3 commit 7c269cd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/tensors/blocktensor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Base.parent(t::BlockTensorMap) = t.data
164164
# handle this separately because the storagetype of `AbstractTensorMap` is
165165
# *always* Vector no matter the actual data storage type
166166
TK.storagetype(t::BlockTensorMap{AbstractTensorMap{E, S, N₁, N₂}}) where {E, S, N₁, N₂} =
167-
foldl(TK.promote_storagetype, values(t.data))
167+
mapreduce(TK.storagetype, TK.promote_storagetype, values(t.data))
168168

169169
function Base.copyto!(
170170
dest::BlockTensorMap, Rdest::CartesianIndices,

src/tensors/sparseblocktensor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Base.eltype(::Type{<:SparseBlockTensorMap{TT}}) where {TT} = TT
171171
# handle this separately because the storagetype of `AbstractTensorMap` is
172172
# *always* Vector no matter the actual data storage type
173173
TK.storagetype(t::SparseBlockTensorMap{AbstractTensorMap{E, S, N₁, N₂}}) where {E, S, N₁, N₂} =
174-
foldl(TK.promote_storagetype, nonzero_values(t))
174+
mapreduce(TK.storagetype, TK.promote_storagetype, nonzero_values(t))
175175

176176
issparse(::SparseBlockTensorMap) = true
177177
nonzero_keys(t::SparseBlockTensorMap) = keys(t.data)

0 commit comments

Comments
 (0)