We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14cddf0 commit 3e45c31Copy full SHA for 3e45c31
src/symbolic.jl
@@ -3,6 +3,8 @@
3
4
using DiffRules
5
6
+const _CSE = Ref(true)
7
+
8
function insert_symbolic_gradient(axislist, store)
9
10
dZ = Symbol(DEL, ZED)
@@ -50,7 +52,7 @@ function insert_symbolic_gradient(axislist, store)
50
52
end
51
53
54
store.verbose>0 && @info "symbolic gradients" inbody
- ex_body = commonsubex(quote $(inbody...) end)
55
+ ex_body = _CSE[] ? commonsubex(quote $(inbody...) end) : quote $(inbody...) end
56
57
ex_pre, ex_post = if store.redfun == :* # then nonzero LHS are handled already, but harder cases here:
58
product_grad(prebody, store)
0 commit comments