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

Method ToString

tensorflow/compiler/xla/service/hlo_sharding.cc:87–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87string HloSharding::ToString() const {
88 if (IsTuple()) {
89 std::vector<string> parts;
90 parts.reserve(tuple_elements_.size());
91 for (const HloSharding& element : tuple_elements_) {
92 parts.push_back(element.ToString());
93 }
94 return StrCat("{", absl::StrJoin(parts, ", "), "}");
95 }
96
97 if (replicated_) {
98 return "{replicated}";
99 }
100 if (maximal_) {
101 return StrCat(
102 "{maximal device=", static_cast<int64>(*tile_assignment_.begin()), "}");
103 }
104 return StrCat("{devices=[", StrJoin(tile_assignment_.dimensions(), ","), "]",
105 StrJoin(tile_assignment_, ","), "}");
106}
107
108bool HloSharding::UsesDevice(int64 device) const {
109 if (IsTuple()) {

Callers 4

TupleMethod · 0.45
SingleTupleMethod · 0.45
ValidateTupleMethod · 0.45
hlo_sharding.ccFile · 0.45

Calls 6

StrCatFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
dimensionsMethod · 0.45

Tested by

no test coverage detected