JuliaSymbolics / SymbolicUtils.jl

Symbolic expressions, rewriting and simplification
https://docs.sciml.ai/SymbolicUtils/stable/
Other
524 stars 99 forks source link

Scheduled broadcast `substitute` is not applied on scalarized tensor #494

Open mmikhasenko opened 1 year ago

mmikhasenko commented 1 year ago
@variables X[1:2] w
Y = substitute.(X, w => -w)
Y |> Symbolics.scalarize .|> y->substitute(y, Dict(X[1]=>2w, X[2]=>3w))

gives [2w, 3w], while the correct answer is [-2w, -3w].

note, that some mathematical operations work well, like Y = 2X, or Y = X .+ 1