MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / HandleSelect

Method HandleSelect

tensorflow/compiler/xla/service/algebraic_simplifier.cc:4012–4026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4010}
4011
4012Status AlgebraicSimplifierVisitor::HandleSelect(HloInstruction* select) {
4013 // select(x, y, y) -> y.
4014 if (select->operand(1) == select->operand(2)) {
4015 return ReplaceInstruction(select, select->mutable_operand(1));
4016 }
4017 // select(true, x, y) -> x.
4018 if (IsAll(select->operand(0), true)) {
4019 return ReplaceInstruction(select, select->mutable_operand(1));
4020 }
4021 // select(false, x, y) -> y.
4022 if (IsAll(select->operand(0), false)) {
4023 return ReplaceInstruction(select, select->mutable_operand(2));
4024 }
4025 return Status::OK();
4026}
4027
4028Status AlgebraicSimplifierVisitor::HandleScatter(HloInstruction* scatter) {
4029 if (ShapeUtil::IsZeroElementArray(scatter->operand(2)->shape()) &&

Callers

nothing calls this directly

Calls 3

mutable_operandMethod · 0.80
IsAllFunction · 0.70
operandMethod · 0.45

Tested by

no test coverage detected