From 67d6c0684b4124c2b38cd3b06f2b211ad2bf5f85 Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Mon, 12 Oct 2026 14:02:29 +0200 Subject: [PATCH] Loosen type of `init` in `_norm` to `Number` This allows us to accommodate number types that are not themselves subtypes of `Real` --- src/tensors/linalg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tensors/linalg.jl b/src/tensors/linalg.jl index b97a52304..a0893749d 100644 --- a/src/tensors/linalg.jl +++ b/src/tensors/linalg.jl @@ -258,7 +258,7 @@ function LinearAlgebra.norm(t::AbstractTensorMap, p::Real = 2) InnerProductStyle(t) === EuclideanInnerProduct() || throw_invalid_innerproduct(:norm) return _norm(blocks(t), p, float(zero(real(scalartype(t))))) end -function _norm(blockiter, p::Real, init::Real) +function _norm(blockiter, p::Real, init::Number) if p == Inf return mapreduce(max, blockiter; init = init) do (c, b) return isempty(b) ? init : oftype(init, LinearAlgebra.normInf(b))