aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/tests/test_utils.cc
diff options
context:
space:
mode:
authorGravatar Michael Kuperstein <mkuper@google.com>2018-08-29 13:23:20 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-29 13:26:41 -0700
commit065f9b833ffbb3b2f03d63febb186275674ba133 (patch)
treeb4521b490c7b1af24cec410e2d3d02419428df64 /tensorflow/compiler/xla/tests/test_utils.cc
parent52773e6765649b9963985c81fc0612742ffac73b (diff)
Automated rollback of commit 150dee25d82589ca109957cc996efbd2a236e044
PiperOrigin-RevId: 210778248
Diffstat (limited to 'tensorflow/compiler/xla/tests/test_utils.cc')
-rw-r--r--tensorflow/compiler/xla/tests/test_utils.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/tests/test_utils.cc b/tensorflow/compiler/xla/tests/test_utils.cc
index 60ada58b2a..776f93d9f7 100644
--- a/tensorflow/compiler/xla/tests/test_utils.cc
+++ b/tensorflow/compiler/xla/tests/test_utils.cc
@@ -203,7 +203,6 @@ enum class ConstantType { kUnknown, kZero, kOne };
// Return the constant type required by this computation, if known.
ConstantType GetInitValue(const HloComputation& computation) {
- // TODO(b/77635120): Add init values, for min, max, and their arg variants.
const HloInstruction* const root = computation.root_instruction();
if (computation.num_parameters() != 2 || root->operand_count() != 2 ||
root->operand(0)->opcode() != HloOpcode::kParameter ||
@@ -228,10 +227,10 @@ bool NeedsInitValue(const HloUse& use) {
const HloInstruction* const instruction = use.instruction;
const HloOpcode opcode = instruction->opcode();
const int64 op_num = use.operand_number;
- return ((opcode == HloOpcode::kReduceWindow && op_num == 1) ||
- (opcode == HloOpcode::kSelectAndScatter && op_num == 2) ||
- (opcode == HloOpcode::kReduce &&
- op_num >= instruction->operand_count() / 2));
+ return (
+ ((opcode == HloOpcode::kReduce || opcode == HloOpcode::kReduceWindow) &&
+ op_num == 1) ||
+ (opcode == HloOpcode::kSelectAndScatter && op_num == 2));
}
// Generate random values that are constrained to the input_shape minus the