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

Function CreateReplicaGroups

tensorflow/compiler/xla/service/hlo_parser.cc:414–424  ·  view source on GitHub ↗

Creates replica groups from the provided nested array. groups[i] represents the replica ids for group 'i'.

Source from the content-addressed store, hash-verified

412// Creates replica groups from the provided nested array. groups[i] represents
413// the replica ids for group 'i'.
414std::vector<ReplicaGroup> CreateReplicaGroups(
415 absl::Span<const std::vector<int64>> groups) {
416 std::vector<ReplicaGroup> replica_groups;
417 absl::c_transform(groups, std::back_inserter(replica_groups),
418 [](const std::vector<int64>& ids) {
419 ReplicaGroup group;
420 *group.mutable_replica_ids() = {ids.begin(), ids.end()};
421 return group;
422 });
423 return replica_groups;
424}
425
426bool HloParserImpl::Error(LocTy loc, absl::string_view msg) {
427 auto line_col = lexer_.GetLineAndColumn(loc);

Callers 2

ParseInstructionRhsMethod · 0.70

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected