Skip to content

Commit 97cbcca

Browse files
authored
Loosen type of init in _norm to Number (#576)
This allows us to accommodate number types that are not themselves subtypes of `Real`
1 parent d9d2cef commit 97cbcca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/tensors/linalg.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function LinearAlgebra.norm(t::AbstractTensorMap, p::Real = 2)
258258
InnerProductStyle(t) === EuclideanInnerProduct() || throw_invalid_innerproduct(:norm)
259259
return _norm(blocks(t), p, float(zero(real(scalartype(t)))))
260260
end
261-
function _norm(blockiter, p::Real, init::Real)
261+
function _norm(blockiter, p::Real, init::Number)
262262
if p == Inf
263263
return mapreduce(max, blockiter; init = init) do (c, b)
264264
return isempty(b) ? init : oftype(init, LinearAlgebra.normInf(b))

0 commit comments

Comments
 (0)