pchanial / pyoperators

Operators and solvers for high-performance computing.
http://pchanial.github.com/pyoperators
Other
14 stars 9 forks source link

ENH: Optimise operators which preserve the input #7

Open pchanial opened 12 years ago

pchanial commented 12 years ago

Operators such as ReshapeOperator or SliceOperator preserve their inputs (let's call such an operator PRE). Currently, when composed by an out-of-place operator OUT:

y = (OUT * PRE)(x)

the following operations take place:

tmp = PRE(x)
y = OUT(tmp)

The tmp variable should be optimised out. I suggest a 'preserve_input' decorator to flag these operators.