Skip to content

Commit 9a1d996

Browse files
lkdvosJutho
andauthored
Apply suggestions from code review
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
1 parent 0f49439 commit 9a1d996

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/tensors/linalg.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ function LinearAlgebra.rank(
290290
t::AbstractTensorMap;
291291
atol::Real = 0, rtol::Real = atol > 0 ? 0 : _default_rtol(t)
292292
)
293-
r = zero(dimscalartype(sectortype(t)))
294-
iszero(dim(t)) && return r
293+
r = dim(t)
294+
iszero(r) && return r
295+
r = zero(r)
295296
S = MatrixAlgebraKit.svd_vals(t)
296297
tol = max(atol, rtol * maximum(parent(S)))
297298
for (c, b) in pairs(S)

0 commit comments

Comments
 (0)