Skip to content

Commit

Permalink
unrelated, start adding an option to turn CSE off
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Abbott committed Dec 18, 2020
1 parent e237ee6 commit 1d1221d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/symbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using DiffRules

const _CSE = Ref(true)

function insert_symbolic_gradient(axislist, store)

dZ = Symbol(DEL, ZED)
Expand Down Expand Up @@ -50,7 +52,7 @@ function insert_symbolic_gradient(axislist, store)
end
end
store.verbose>0 && @info "symbolic gradients" inbody
ex_body = commonsubex(quote $(inbody...) end)
ex_body = _CSE[] ? commonsubex(quote $(inbody...) end) : quote $(inbody...) end

ex_pre, ex_post = if store.redfun == :* # then nonzero LHS are handled already, but harder cases here:
product_grad(prebody, store)
Expand Down

0 comments on commit 1d1221d

Please sign in to comment.