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
As the example shows, we first compute the Elemwise then immediately reduce it. Instead, we could fuse the CAReduce and Elemwise scalar Ops (i.e. create a Composite scalar Op corresponding to add(exp(x), exp(y))) and use that in a single CAReduce node that avoids the need for intermediate storage.
The rewrites required to do this would incorporate most of the same logic from aesara.tensor.basic_opt.FusionOptimizer, but, instead of producing another Elemwise, it would result in a new CAReduce.
We aren't currently converting
CAReduces ofElemwises into singleCAReduces:As the example shows, we first compute the
Elemwisethen immediately reduce it. Instead, we could fuse theCAReduceandElemwisescalarOps (i.e. create aCompositescalarOpcorresponding toadd(exp(x), exp(y))) and use that in a singleCAReducenode that avoids the need for intermediate storage.The rewrites required to do this would incorporate most of the same logic from
aesara.tensor.basic_opt.FusionOptimizer, but, instead of producing anotherElemwise, it would result in a newCAReduce.