diff options
author | Kay Zhu <kayzhu@google.com> | 2017-05-25 17:32:49 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-05-25 17:36:25 -0700 |
commit | 405f70c6de296faf7561d6739e947d0fb9b26f14 (patch) | |
tree | dbba00032e0720aac01c3e157fa6a4b2eb88e48f /util/python/BUILD | |
parent | 2b546d85dbdc9381c160084180f6c5e536d61719 (diff) |
[XLA] Enable HloEvaluator for constant folding, also merged a few operations
from hlo_constant_folding to hlo_evaluator.
Additionally:
- In ShapeUtil::ForEachIndex:
* fix a bug where visitor is called when the shape has zero elements (e.g., F32{1,0})
* added test case for ForEachIndex.
- In HloEvaluator:
* Instead of copying and caching a Constant instruction, return the literal directly if the instruction is constant.
* Fix an issue where TUPLE and OPAQUE primitives are not keyed in the templated typed_visitor.
* Use (fixed) LiteralUtil::Populate to populate resulting literal, fixes the preexisting bug in the evaluator where R0 and shape with zero size dimensions are not handled.
* Refactor ElementWiseUnaryOp and HandleCompare to be templatized on the operand's type.
* Refactor IsFinite to be top level since it is only applicable to floats and the return type is always boolean.
* Change from std::remainder to std::fmod for kRemainder to be compliant with existing XLA behavior.
* Change from std::max and std::min to std::fmax and std::fmin to handle NaNs.
* Minor comments fix.
- Disables constant_folding and reshape-motion for ClientLibraryTestBase so that constant folding would not affect the intended code paths to be execercised by the test. In the longer term we plan change all Constants to Parameter and re-enable constant_folding in tests.
PiperOrigin-RevId: 157174708
Diffstat (limited to 'util/python/BUILD')
0 files changed, 0 insertions, 0 deletions