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

Method HandleCollectivePermute

tensorflow/compiler/xla/service/hlo_verifier.cc:282–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282Status ShapeVerifier::HandleCollectivePermute(HloInstruction* hlo) {
283 // A source or target cannot appear twice in the collective-permute's
284 // source-target pairs.
285 absl::flat_hash_set<int64> seen_sources;
286 absl::flat_hash_set<int64> seen_targets;
287 for (const auto& p : hlo->source_target_pairs()) {
288 if (!seen_sources.insert(p.first).second) {
289 return InternalError(
290 "Source %d appears more than once in instruction's source-target "
291 "pairs: %s",
292 p.first, hlo->ToString());
293 }
294 if (!seen_targets.insert(p.second).second) {
295 return InternalError(
296 "Target %d appears more than once in instruction's source-target "
297 "pairs: %s",
298 p.second, hlo->ToString());
299 }
300 }
301 return CheckShape(hlo, ShapeInference::InferCollectivePermuteShape(
302 hlo->operand(0)->shape()));
303}
304
305Status ShapeVerifier::HandleReducePrecision(HloInstruction* reduce_precision) {
306 return CheckShape(reduce_precision, ShapeInference::InferReducePrecisionShape(

Callers 1

VisitMethod · 0.45

Calls 5

InternalErrorFunction · 0.50
insertMethod · 0.45
ToStringMethod · 0.45
shapeMethod · 0.45
operandMethod · 0.45

Tested by

no test coverage detected