Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix converting empty tensors to array #180

Merged
merged 10 commits into from
Nov 21, 2024
Merged
2 changes: 1 addition & 1 deletion src/tensors/abstracttensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ function Base.convert(::Type{Array}, t::AbstractTensorMap)
else
cod = codomain(t)
dom = domain(t)
T = isreal(sectorscalartype(I)) ? scalartype(t) : complex(scalartype(t))
T = sectorscalartype(I) <: Complex ? complex(scalartype(t)) : scalartype(t)
lkdvos marked this conversation as resolved.
Show resolved Hide resolved
A = zeros(T, dims(cod)..., dims(dom)...)
for (f₁, f₂) in fusiontrees(t)
F = convert(Array, (f₁, f₂))
Expand Down
Loading