mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 00:20:20 +01:00
[XLA] Remove dead opcode kIndex.
PiperOrigin-RevId: 173987428
This commit is contained in:
parent
a4b5356e47
commit
6d1263cdf8
|
|
@ -849,7 +849,6 @@ ColorScheme HloDotDumper::GetInstructionColor(const HloInstruction* instr) {
|
|||
case HloOpcode::kGe:
|
||||
case HloOpcode::kGt:
|
||||
case HloOpcode::kImag:
|
||||
case HloOpcode::kIndex:
|
||||
case HloOpcode::kIsFinite:
|
||||
case HloOpcode::kLe:
|
||||
case HloOpcode::kLog:
|
||||
|
|
|
|||
|
|
@ -1164,7 +1164,6 @@ std::unique_ptr<HloInstruction> HloInstruction::CloneWithNewOperands(
|
|||
break;
|
||||
case HloOpcode::kRecv:
|
||||
case HloOpcode::kSend:
|
||||
case HloOpcode::kIndex:
|
||||
case HloOpcode::kTrace:
|
||||
LOG(FATAL) << "Not yet implemented, clone: " << HloOpcodeString(opcode_);
|
||||
}
|
||||
|
|
@ -1551,7 +1550,6 @@ bool HloInstruction::IdenticalSlowPath(
|
|||
return dimensions() == other.dimensions();
|
||||
|
||||
// These opcodes are not yet supported.
|
||||
case HloOpcode::kIndex:
|
||||
case HloOpcode::kInfeed:
|
||||
case HloOpcode::kOutfeed:
|
||||
case HloOpcode::kSort:
|
||||
|
|
@ -2277,7 +2275,6 @@ Status HloInstruction::Visit(DfsHloVisitor* visitor) {
|
|||
return visitor->HandleRecv(this);
|
||||
|
||||
// These opcodes are not handled here.
|
||||
case HloOpcode::kIndex:
|
||||
case HloOpcode::kTrace:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ HLO_MATCHER(Fusion);
|
|||
HLO_MATCHER(Ge);
|
||||
HLO_MATCHER(GetTupleElement);
|
||||
HLO_MATCHER(Gt);
|
||||
HLO_MATCHER(Index);
|
||||
HLO_MATCHER(Infeed);
|
||||
HLO_MATCHER(IsFinite);
|
||||
HLO_MATCHER(Le);
|
||||
|
|
|
|||
|
|
@ -95,8 +95,6 @@ string HloOpcodeString(HloOpcode opcode) {
|
|||
return "greater-than";
|
||||
case HloOpcode::kImag:
|
||||
return "imag";
|
||||
case HloOpcode::kIndex:
|
||||
return "index";
|
||||
case HloOpcode::kInfeed:
|
||||
return "infeed";
|
||||
case HloOpcode::kIsFinite:
|
||||
|
|
@ -218,7 +216,6 @@ StatusOr<HloOpcode> StringToHloOpcode(const string& opcode_name) {
|
|||
{"greater-than-or-equal-to", HloOpcode::kGe},
|
||||
{"get-tuple-element", HloOpcode::kGetTupleElement},
|
||||
{"greater-than", HloOpcode::kGt},
|
||||
{"index", HloOpcode::kIndex},
|
||||
{"infeed", HloOpcode::kInfeed},
|
||||
{"is-finite", HloOpcode::kIsFinite},
|
||||
{"less-than-or-equal-to", HloOpcode::kLe},
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ enum class HloOpcode {
|
|||
kGetTupleElement,
|
||||
kGt,
|
||||
kImag,
|
||||
kIndex,
|
||||
kInfeed,
|
||||
kIsFinite,
|
||||
kLe,
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ Status InlinerVisitor::HandleMap(HloInstruction* map) {
|
|||
// profitability model for inlining is defined.
|
||||
if (hlo_query::AllOperandsAreParameters(root)) {
|
||||
if (root.opcode() == HloOpcode::kFusion ||
|
||||
root.opcode() == HloOpcode::kIndex ||
|
||||
root.opcode() == HloOpcode::kParameter ||
|
||||
root.opcode() == HloOpcode::kTrace) {
|
||||
// Cloning not supported for these instructions.
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ namespace xla {
|
|||
case HloOpcode::kDot:
|
||||
case HloOpcode::kExp:
|
||||
case HloOpcode::kFusion:
|
||||
case HloOpcode::kIndex:
|
||||
case HloOpcode::kLog:
|
||||
case HloOpcode::kMap:
|
||||
case HloOpcode::kParameter:
|
||||
|
|
|
|||
|
|
@ -97,8 +97,6 @@ BinaryOperation OpcodeToBinaryOperation(HloOpcode opcode) {
|
|||
return BINOP_ADD;
|
||||
case HloOpcode::kSubtract:
|
||||
return BINOP_SUB;
|
||||
case HloOpcode::kIndex:
|
||||
return BINOP_INDEX;
|
||||
case HloOpcode::kDivide:
|
||||
return BINOP_DIV;
|
||||
case HloOpcode::kEq:
|
||||
|
|
@ -830,17 +828,6 @@ ShapeInference::InferDegenerateDimensionBroadcastShape(
|
|||
broadcast_dimensions));
|
||||
return ShapeUtil::ChangeElementType(shape, PRED);
|
||||
}
|
||||
case BINOP_INDEX:
|
||||
if (ShapeUtil::Rank(lhs) > 0 && ShapeUtil::Rank(rhs) == 0) {
|
||||
tensorflow::gtl::ArraySlice<int64> dimensions =
|
||||
AsInt64Slice(lhs.dimensions());
|
||||
dimensions.pop_front();
|
||||
return ShapeUtil::MakeShape(lhs.element_type(), dimensions);
|
||||
}
|
||||
return Unimplemented("cannot infer shape for operation: %s <%s> %s",
|
||||
ShapeUtil::HumanString(lhs).c_str(),
|
||||
BinaryOperation_Name(operation).c_str(),
|
||||
ShapeUtil::HumanString(rhs).c_str());
|
||||
default:
|
||||
return Unimplemented(
|
||||
"not yet implemented; infer binary op shape: %s; lhs: %s; rhs: %s",
|
||||
|
|
|
|||
|
|
@ -96,8 +96,6 @@ HloOpcode BinaryOperationToHloOpcode(BinaryOperation binop) {
|
|||
return HloOpcode::kAdd;
|
||||
case BINOP_SUB:
|
||||
return HloOpcode::kSubtract;
|
||||
case BINOP_INDEX:
|
||||
return HloOpcode::kIndex;
|
||||
case BINOP_DIV:
|
||||
return HloOpcode::kDivide;
|
||||
case BINOP_EQ:
|
||||
|
|
|
|||
|
|
@ -405,7 +405,6 @@ bool HloParser::ParseInstruction(HloComputation::Builder* builder,
|
|||
case HloOpcode::kInfeed:
|
||||
case HloOpcode::kOutfeed:
|
||||
case HloOpcode::kBatchNormGrad:
|
||||
case HloOpcode::kIndex:
|
||||
case HloOpcode::kTrace:
|
||||
return TokenError(StrCat("parsing not yet implemented for op: ",
|
||||
HloOpcodeString(opcode)));
|
||||
|
|
|
|||
|
|
@ -700,14 +700,6 @@ enum BinaryOperation {
|
|||
// Dot product, matrix multiply.
|
||||
BINOP_DOT = 12;
|
||||
|
||||
// Indexes into the LHS with the RHS.
|
||||
//
|
||||
// If the RHS is higher-rank, this is a gather operation.
|
||||
//
|
||||
// Note: currently out of bounds indices may crash the underlying XLA
|
||||
// machine.
|
||||
BINOP_INDEX = 13;
|
||||
|
||||
// Element-wise maximum.
|
||||
BINOP_MAX = 14;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user