aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_verifier.cc
diff options
context:
space:
mode:
authorGravatar Michael Kuperstein <mkuper@google.com>2018-08-29 16:43:42 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-29 16:48:33 -0700
commit24af42fce7e123b162899cbcc81769f919b0029a (patch)
tree610c9b77c30c60a9d51abff94ccd0b098af1a0c4 /tensorflow/compiler/xla/service/hlo_verifier.cc
parent7db159e208ec65824779281277fa3b7fc4cd857b (diff)
Automated rollback of commit 065f9b833ffbb3b2f03d63febb186275674ba133
PiperOrigin-RevId: 210816152
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_verifier.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_verifier.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_verifier.cc b/tensorflow/compiler/xla/service/hlo_verifier.cc
index f1b29c2559..3f3cb2fa54 100644
--- a/tensorflow/compiler/xla/service/hlo_verifier.cc
+++ b/tensorflow/compiler/xla/service/hlo_verifier.cc
@@ -288,14 +288,13 @@ Status ShapeVerifier::HandleGetTupleElement(HloInstruction* get_tuple_element) {
}
Status ShapeVerifier::HandleReduce(HloInstruction* reduce) {
- if (!ShapeUtil::IsArray(reduce->shape())) {
- return InvalidArgument("Variadic reduce is not supported.");
+ std::vector<const Shape*> operand_shapes;
+ for (const HloInstruction* operand : reduce->operands()) {
+ operand_shapes.push_back(&operand->shape());
}
- return CheckShape(
- reduce,
- ShapeInference::InferReduceShape(
- {&reduce->operand(0)->shape(), &reduce->operand(1)->shape()},
- reduce->dimensions(), reduce->to_apply()->ComputeProgramShape()));
+ return CheckShape(reduce, ShapeInference::InferReduceShape(
+ operand_shapes, reduce->dimensions(),
+ reduce->to_apply()->ComputeProgramShape()));
}
Status ShapeVerifier::HandleBitcast(HloInstruction* bitcast) {