aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/tests/literal_test_util.h
diff options
context:
space:
mode:
authorGravatar Kay Zhu <kayzhu@google.com>2017-05-25 17:32:49 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-05-25 17:36:25 -0700
commit405f70c6de296faf7561d6739e947d0fb9b26f14 (patch)
treedbba00032e0720aac01c3e157fa6a4b2eb88e48f /tensorflow/compiler/xla/tests/literal_test_util.h
parent2b546d85dbdc9381c160084180f6c5e536d61719 (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 'tensorflow/compiler/xla/tests/literal_test_util.h')
-rw-r--r--tensorflow/compiler/xla/tests/literal_test_util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/tests/literal_test_util.h b/tensorflow/compiler/xla/tests/literal_test_util.h
index 4f98083033..a8b07a2c5d 100644
--- a/tensorflow/compiler/xla/tests/literal_test_util.h
+++ b/tensorflow/compiler/xla/tests/literal_test_util.h
@@ -29,6 +29,7 @@ limitations under the License.
#include "tensorflow/compiler/xla/test_helpers.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
+#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/gtl/array_slice.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/test.h"