You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining constraints like @constraint(m, v >= 0) for Vector-valued v on Julia 0.7 we get this deprecation warning
┌ Warning: `a::AbstractArray - b::Number` is deprecated, use `a .- b` instead.
│ caller = optimize_toplevel at lazyexpression.jl:59 [inlined]
└ @ Core ~/.julia/packages/SimpleQP/pHx4o/src/lazyexpression.jl:59
This comes from the minus expressions here but naively replacing those with broadcasted equivalents interferes with the current LazyExpression optimizations. I feel like the answer is to either integrate base broadcasting into LazyExpressions (a potentially daunting task) or to make a localized fix (e.g., maybe turn just this line into a broadcasted equivalent?); what do you think?
The text was updated successfully, but these errors were encountered:
I've been using @constraint(m, v >= zeros(n)) everywhere so I hadn't run into this yet. That will always remain a valid way to do this, so it's certainly an option for if you want to get rid of the depwarns on 0.7 right now.
Transforming . syntax into broadcast calls in @expression will be annoying, but is doable. I'm hoping that Julia will provide a function for this kind of 'normalization' of the AST (it used to just be expand), but its 0.7-equivalent, lower, unfortunately returns something entirely different.
After that's done, we'd need to add optimize methods for broadcast calls. Unfortunately, it's not as simply as turning broadcast into broadcast!, because if v is a Vector{<:AffineFunction}, then scalar subtraction also allocates.
So it's certainly not impossible, but it's quite a task to get this right.
When defining constraints like
@constraint(m, v >= 0)
forVector
-valuedv
on Julia 0.7 we get this deprecation warningThis comes from the minus expressions here but naively replacing those with
broadcast
ed equivalents interferes with the currentLazyExpression
optimizations. I feel like the answer is to either integrate base broadcasting intoLazyExpression
s (a potentially daunting task) or to make a localized fix (e.g., maybe turn just this line into a broadcasted equivalent?); what do you think?The text was updated successfully, but these errors were encountered: