@@ -132,9 +132,8 @@ Optionally, a scalartype `T` for the destination can be supplied that might diff
132132@inline promote_storagetype (A:: AbstractTensorMap ) = storagetype (A)
133133@inline promote_storagetype (A:: AbstractTensorMap , B:: AbstractTensorMap , Cs:: AbstractTensorMap... ) =
134134 promote_storagetype (storagetype (A), storagetype (B), map (storagetype, Cs)... )
135- @inline promote_storagetype (:: Type{T} , A:: AbstractTensorMap ) where {T <: Number } = similarstoragetype (A, T)
136- @inline promote_storagetype (:: Type{T} , A:: AbstractTensorMap , B:: AbstractTensorMap , Cs:: AbstractTensorMap... ) where {T <: Number } =
137- promote_storagetype (similarstoragetype (A, T), similarstoragetype (B, T), map (Base. Fix2 (similarstoragetype, T), Cs)... )
135+ @inline promote_storagetype (:: Type{T} , A:: AbstractTensorMap , Bs:: AbstractTensorMap... ) where {T <: Number } =
136+ promote_storagetype (similarstoragetype (A, T), mapreduce (Base. Fix2 (similarstoragetype, T), Bs)... )
138137
139138@inline function promote_storagetype (
140139 :: Type{A} , :: Type{B} , Cs:: Type{<:AbstractTensorMap} ...
149148
150149# promotion system in the same spirit as base/promotion.jl
151150promote_storagetype (:: Type{Base.Bottom} , :: Type{Base.Bottom} ) = Base. Bottom
151+ promote_storagetype (:: Type{T} ) where {T} = T
152152promote_storagetype (:: Type{T} , :: Type{T} ) where {T} = T
153153promote_storagetype (:: Type{T} , :: Type{Base.Bottom} ) where {T} = T
154154promote_storagetype (:: Type{Base.Bottom} , :: Type{T} ) where {T} = T
0 commit comments