aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/tests/test_utils.cc
diff options
context:
space:
mode:
authorGravatar Nick Desaulniers <ndesaulniers@google.com>2018-04-10 10:52:15 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-10 10:55:15 -0700
commitc276b8314cd3161c5626d845edcfb6697cefd043 (patch)
treefc7b2253f32700eaeb444b7f38871a2ebd903316 /tensorflow/compiler/xla/tests/test_utils.cc
parent36a07c59954b8ace54879b8732b6a7ae2dce6450 (diff)
[TF:XLA] fix a segfault in MakeFakeArguments, and add a test case.
PiperOrigin-RevId: 192310749
Diffstat (limited to 'tensorflow/compiler/xla/tests/test_utils.cc')
-rw-r--r--tensorflow/compiler/xla/tests/test_utils.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/tests/test_utils.cc b/tensorflow/compiler/xla/tests/test_utils.cc
index 68f75d50cb..e30d115fae 100644
--- a/tensorflow/compiler/xla/tests/test_utils.cc
+++ b/tensorflow/compiler/xla/tests/test_utils.cc
@@ -165,7 +165,7 @@ enum class ConstantType { kUnknown, kZero, kOne };
// Return the constant type required by this computation, if known.
ConstantType GetInitValue(const HloComputation& computation) {
const HloInstruction* const root = computation.root_instruction();
- if (computation.num_parameters() != 2 ||
+ if (computation.num_parameters() != 2 || root->operand_count() != 2 ||
root->operand(0)->opcode() != HloOpcode::kParameter ||
root->operand(1)->opcode() != HloOpcode::kParameter ||
root->operand(0) == root->operand(1)) {