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

Method IsElementwiseImpl

tensorflow/compiler/xla/service/hlo_instructions.cc:1111–1125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1109}
1110
1111bool HloMapInstruction::IsElementwiseImpl(
1112 const absl::optional<int64>& operand_idx) const {
1113 if (!dimensions().empty()) {
1114 // Check that the map is executed in elementwise compatible dimensions.
1115 if (dimensions().size() != shape().dimensions_size()) {
1116 return false;
1117 }
1118 for (int i = 0; i < dimensions().size(); ++i) {
1119 if (dimensions()[i] != i) {
1120 return false;
1121 }
1122 }
1123 }
1124 return true;
1125}
1126
1127std::vector<string> HloMapInstruction::ExtraAttributesToStringImpl(
1128 const HloPrintOptions& options) const {

Callers

nothing calls this directly

Calls 15

ContainsKeyFunction · 0.85
dimensions_sizeMethod · 0.80
opcodeMethod · 0.80
IsElementwiseMethod · 0.80
shapeFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
has_valueMethod · 0.45
push_backMethod · 0.45
valueMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected