[XLA] Remove dead opcode kIndex.

PiperOrigin-RevId: 173987428
This commit is contained in:
Justin Lebar 2017-10-30 19:57:47 -07:00 committed by TensorFlower Gardener
parent a4b5356e47
commit 6d1263cdf8
11 changed files with 0 additions and 35 deletions

View File

@ -849,7 +849,6 @@ ColorScheme HloDotDumper::GetInstructionColor(const HloInstruction* instr) {
case HloOpcode::kGe: case HloOpcode::kGe:
case HloOpcode::kGt: case HloOpcode::kGt:
case HloOpcode::kImag: case HloOpcode::kImag:
case HloOpcode::kIndex:
case HloOpcode::kIsFinite: case HloOpcode::kIsFinite:
case HloOpcode::kLe: case HloOpcode::kLe:
case HloOpcode::kLog: case HloOpcode::kLog:

View File

@ -1164,7 +1164,6 @@ std::unique_ptr<HloInstruction> HloInstruction::CloneWithNewOperands(
break; break;
case HloOpcode::kRecv: case HloOpcode::kRecv:
case HloOpcode::kSend: case HloOpcode::kSend:
case HloOpcode::kIndex:
case HloOpcode::kTrace: case HloOpcode::kTrace:
LOG(FATAL) << "Not yet implemented, clone: " << HloOpcodeString(opcode_); LOG(FATAL) << "Not yet implemented, clone: " << HloOpcodeString(opcode_);
} }
@ -1551,7 +1550,6 @@ bool HloInstruction::IdenticalSlowPath(
return dimensions() == other.dimensions(); return dimensions() == other.dimensions();
// These opcodes are not yet supported. // These opcodes are not yet supported.
case HloOpcode::kIndex:
case HloOpcode::kInfeed: case HloOpcode::kInfeed:
case HloOpcode::kOutfeed: case HloOpcode::kOutfeed:
case HloOpcode::kSort: case HloOpcode::kSort:
@ -2277,7 +2275,6 @@ Status HloInstruction::Visit(DfsHloVisitor* visitor) {
return visitor->HandleRecv(this); return visitor->HandleRecv(this);
// These opcodes are not handled here. // These opcodes are not handled here.
case HloOpcode::kIndex:
case HloOpcode::kTrace: case HloOpcode::kTrace:
break; break;
} }

View File

@ -74,7 +74,6 @@ HLO_MATCHER(Fusion);
HLO_MATCHER(Ge); HLO_MATCHER(Ge);
HLO_MATCHER(GetTupleElement); HLO_MATCHER(GetTupleElement);
HLO_MATCHER(Gt); HLO_MATCHER(Gt);
HLO_MATCHER(Index);
HLO_MATCHER(Infeed); HLO_MATCHER(Infeed);
HLO_MATCHER(IsFinite); HLO_MATCHER(IsFinite);
HLO_MATCHER(Le); HLO_MATCHER(Le);

View File

@ -95,8 +95,6 @@ string HloOpcodeString(HloOpcode opcode) {
return "greater-than"; return "greater-than";
case HloOpcode::kImag: case HloOpcode::kImag:
return "imag"; return "imag";
case HloOpcode::kIndex:
return "index";
case HloOpcode::kInfeed: case HloOpcode::kInfeed:
return "infeed"; return "infeed";
case HloOpcode::kIsFinite: case HloOpcode::kIsFinite:
@ -218,7 +216,6 @@ StatusOr<HloOpcode> StringToHloOpcode(const string& opcode_name) {
{"greater-than-or-equal-to", HloOpcode::kGe}, {"greater-than-or-equal-to", HloOpcode::kGe},
{"get-tuple-element", HloOpcode::kGetTupleElement}, {"get-tuple-element", HloOpcode::kGetTupleElement},
{"greater-than", HloOpcode::kGt}, {"greater-than", HloOpcode::kGt},
{"index", HloOpcode::kIndex},
{"infeed", HloOpcode::kInfeed}, {"infeed", HloOpcode::kInfeed},
{"is-finite", HloOpcode::kIsFinite}, {"is-finite", HloOpcode::kIsFinite},
{"less-than-or-equal-to", HloOpcode::kLe}, {"less-than-or-equal-to", HloOpcode::kLe},

View File

@ -61,7 +61,6 @@ enum class HloOpcode {
kGetTupleElement, kGetTupleElement,
kGt, kGt,
kImag, kImag,
kIndex,
kInfeed, kInfeed,
kIsFinite, kIsFinite,
kLe, kLe,

View File

@ -71,7 +71,6 @@ Status InlinerVisitor::HandleMap(HloInstruction* map) {
// profitability model for inlining is defined. // profitability model for inlining is defined.
if (hlo_query::AllOperandsAreParameters(root)) { if (hlo_query::AllOperandsAreParameters(root)) {
if (root.opcode() == HloOpcode::kFusion || if (root.opcode() == HloOpcode::kFusion ||
root.opcode() == HloOpcode::kIndex ||
root.opcode() == HloOpcode::kParameter || root.opcode() == HloOpcode::kParameter ||
root.opcode() == HloOpcode::kTrace) { root.opcode() == HloOpcode::kTrace) {
// Cloning not supported for these instructions. // Cloning not supported for these instructions.

View File

@ -99,7 +99,6 @@ namespace xla {
case HloOpcode::kDot: case HloOpcode::kDot:
case HloOpcode::kExp: case HloOpcode::kExp:
case HloOpcode::kFusion: case HloOpcode::kFusion:
case HloOpcode::kIndex:
case HloOpcode::kLog: case HloOpcode::kLog:
case HloOpcode::kMap: case HloOpcode::kMap:
case HloOpcode::kParameter: case HloOpcode::kParameter:

View File

@ -97,8 +97,6 @@ BinaryOperation OpcodeToBinaryOperation(HloOpcode opcode) {
return BINOP_ADD; return BINOP_ADD;
case HloOpcode::kSubtract: case HloOpcode::kSubtract:
return BINOP_SUB; return BINOP_SUB;
case HloOpcode::kIndex:
return BINOP_INDEX;
case HloOpcode::kDivide: case HloOpcode::kDivide:
return BINOP_DIV; return BINOP_DIV;
case HloOpcode::kEq: case HloOpcode::kEq:
@ -830,17 +828,6 @@ ShapeInference::InferDegenerateDimensionBroadcastShape(
broadcast_dimensions)); broadcast_dimensions));
return ShapeUtil::ChangeElementType(shape, PRED); 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: default:
return Unimplemented( return Unimplemented(
"not yet implemented; infer binary op shape: %s; lhs: %s; rhs: %s", "not yet implemented; infer binary op shape: %s; lhs: %s; rhs: %s",

View File

@ -96,8 +96,6 @@ HloOpcode BinaryOperationToHloOpcode(BinaryOperation binop) {
return HloOpcode::kAdd; return HloOpcode::kAdd;
case BINOP_SUB: case BINOP_SUB:
return HloOpcode::kSubtract; return HloOpcode::kSubtract;
case BINOP_INDEX:
return HloOpcode::kIndex;
case BINOP_DIV: case BINOP_DIV:
return HloOpcode::kDivide; return HloOpcode::kDivide;
case BINOP_EQ: case BINOP_EQ:

View File

@ -405,7 +405,6 @@ bool HloParser::ParseInstruction(HloComputation::Builder* builder,
case HloOpcode::kInfeed: case HloOpcode::kInfeed:
case HloOpcode::kOutfeed: case HloOpcode::kOutfeed:
case HloOpcode::kBatchNormGrad: case HloOpcode::kBatchNormGrad:
case HloOpcode::kIndex:
case HloOpcode::kTrace: case HloOpcode::kTrace:
return TokenError(StrCat("parsing not yet implemented for op: ", return TokenError(StrCat("parsing not yet implemented for op: ",
HloOpcodeString(opcode))); HloOpcodeString(opcode)));

View File

@ -700,14 +700,6 @@ enum BinaryOperation {
// Dot product, matrix multiply. // Dot product, matrix multiply.
BINOP_DOT = 12; 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. // Element-wise maximum.
BINOP_MAX = 14; BINOP_MAX = 14;