Skip to content

Commit

Permalink
Improve type-inference
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Apr 10, 2024
1 parent de5a56f commit ee9f7d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tensors/indexmanipulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ If `copy=false`, `tdst` might share data with `tsrc` whenever possible. Otherwis
To repartition into an existing destination, see [repartition!](@ref).
"""
function repartition(t::AbstractTensorMap, N₁::Int, N₂::Int=numind(t) - N₁;
Base.@constprop :aggressive function repartition(t::AbstractTensorMap, N₁::Int, N₂::Int=numind(t) - N₁;
copy::Bool=false)
N₁ + N₂ == numind(t) ||
throw(ArgumentError("Invalid repartition: $(numind(t)) to ($N₁, $N₂)"))
Expand Down
2 changes: 1 addition & 1 deletion test/tensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ for V in spacelist
@test dot(t2′, t2) dot(t′, t) dot(transpose(t2′), transpose(t2))
end

t3 = @constinferred repartition(t, k)
t3 = @constinferred repartition(t, $k)
@test norm(t3) norm(t)
t3′ = @constinferred repartition!(similar(t3), t′)
@test norm(t3′) norm(t′)
Expand Down

0 comments on commit ee9f7d7

Please sign in to comment.