aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_instructions.cc
diff options
context:
space:
mode:
authorGravatar Michael Kuperstein <mkuper@google.com>2018-10-09 19:41:35 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-09 19:46:05 -0700
commit58fcfc98cd59ae3952399fc55380b8733df08df9 (patch)
tree24d5ac5d6691e73c227f5afa5ef68ba2ecba4ec0 /tensorflow/compiler/xla/service/hlo_instructions.cc
parent93eef55c4d04af24a6c8080f34629db179634f07 (diff)
[XLA] Add documentation and HLO-level support for multi-value sort.
No support in any of the backends, and not yet exposed through XlaBuilder. PiperOrigin-RevId: 216465753
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_instructions.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_instructions.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_instructions.cc b/tensorflow/compiler/xla/service/hlo_instructions.cc
index 2ec233eaec..179ace2cdb 100644
--- a/tensorflow/compiler/xla/service/hlo_instructions.cc
+++ b/tensorflow/compiler/xla/service/hlo_instructions.cc
@@ -600,11 +600,11 @@ std::unique_ptr<HloInstruction> HloReduceInstruction::CloneWithNewOperandsImpl(
HloSortInstruction::HloSortInstruction(const Shape& shape, int64 dimension,
HloInstruction* keys,
- HloInstruction* values)
+ absl::Span<HloInstruction* const> values)
: HloInstruction(HloOpcode::kSort, shape), dimensions_({dimension}) {
AppendOperand(keys);
- if (values) {
- AppendOperand(values);
+ for (auto* value : values) {
+ AppendOperand(value);
}
}
@@ -633,9 +633,8 @@ std::unique_ptr<HloInstruction> HloSortInstruction::CloneWithNewOperandsImpl(
const Shape& shape, absl::Span<HloInstruction* const> new_operands,
HloCloneContext* context) const {
HloInstruction* keys = new_operands[0];
- HloInstruction* values = new_operands.size() == 2 ? new_operands[1] : nullptr;
return absl::make_unique<HloSortInstruction>(shape, dimensions(0), keys,
- values);
+ new_operands.subspan(1));
}
HloTransposeInstruction::HloTransposeInstruction(