@@ -123,10 +123,10 @@ end
123123# ------------------------
124124for (fname, felt) in ((:zeros , :zero ), (:ones , :one ))
125125 @eval begin
126- function Base. $fname (:: Type{T } , V:: TensorMapSumSpace ) where {T }
127- TT = blocktensormaptype (spacetype (V), numout (V), numin (V), T )
126+ function Base. $fname (:: Type{TorA } , V:: TensorMapSumSpace ) where {TorA }
127+ TT = blocktensormaptype (spacetype (V), numout (V), numin (V), TorA )
128128 t = TT (undef, V)
129- fill! (t, $ felt (T ))
129+ fill! (t, $ felt (scalartype (t) ))
130130 return t
131131 end
132132 end
@@ -136,9 +136,9 @@ for randfun in (:rand, :randn, :randexp)
136136 randfun! = Symbol (randfun, :! )
137137 @eval begin
138138 function Random. $randfun (
139- rng:: Random.AbstractRNG , :: Type{T } , V:: TensorMapSumSpace
140- ) where {T }
141- TT = blocktensormaptype (spacetype (V), numout (V), numin (V), T )
139+ rng:: Random.AbstractRNG , :: Type{TorA } , V:: TensorMapSumSpace
140+ ) where {TorA }
141+ TT = blocktensormaptype (spacetype (V), numout (V), numin (V), TorA )
142142 t = TT (undef, V)
143143 Random.$ randfun! (rng, t)
144144 return t
0 commit comments