pytorch/test/cpp
Nick Gibson 2f21dfb541 [TensorExpr] Eager reduction initialization & removal from ReduceOp (#38585)
Summary:
This PR removes the deferred initializer field from ReduceOp in favour of eagerly initializing buffers when they are created (either in the constructor of `LoopNest`, or in `rfactor()`). This allows a pretty good simplification of reduction logic, removing almost all of the reduction expander and the ReduceInitCleaner & unpopular NoOp node added in the last fix.

Eager initialization is better for us anyway because it allows more opportunities to transform the initialization loop.

Added a few more tests, testReduceOverSplitWithTail failed before this change due to a bug in splitWithTail which now can't happen.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38585

Differential Revision: D21621551

Pulled By: nickgg

fbshipit-source-id: 378137e5723b4a6d6e390239efb12adce22a8215
2020-05-18 15:56:43 -07:00
..
api [aten] Pass std::function<> to thread_pool by value, instead of const ref. (#37681) 2020-05-05 08:41:38 -07:00
common
dist_autograd Fix/relax CMake linter rules (#35574) 2020-03-27 16:52:33 -07:00
jit [torchbind] Better error message when missing init. (#37474) 2020-05-13 17:38:31 -07:00
rpc [TensorPipe] Use the new multi-payload message API (#37919) 2020-05-07 02:52:30 -07:00
tensorexpr [TensorExpr] Eager reduction initialization & removal from ReduceOp (#38585) 2020-05-18 15:56:43 -07:00
__init__.py