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

Method DebugString

tensorflow/core/framework/resource_mgr.cc:139–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139string ResourceMgr::DebugString() const {
140 mutex_lock l(mu_);
141 struct Line {
142 const string* container;
143 const string type;
144 const string* resource;
145 const string detail;
146 };
147 std::vector<Line> lines;
148 for (const auto& p : containers_) {
149 const string& container = p.first;
150 for (const auto& q : *p.second) {
151 const Key& key = q.first;
152 const char* type = DebugTypeName(key.first);
153 const string& resource = key.second;
154 Line l{&container, port::Demangle(type), q.second.name.get(),
155 q.second.resource->DebugString()};
156 lines.push_back(l);
157 }
158 }
159 std::vector<string> text;
160 text.reserve(lines.size());
161 for (const Line& line : lines) {
162 text.push_back(strings::Printf(
163 "%-20s | %-40s | %-40s | %-s", line.container->c_str(),
164 line.type.c_str(), line.resource->c_str(), line.detail.c_str()));
165 }
166 std::sort(text.begin(), text.end());
167 return absl::StrJoin(text, "\n");
168}
169
170Status ResourceMgr::DoCreate(const string& container, TypeIndex type,
171 const string& name, ResourceBase* resource) {

Callers

nothing calls this directly

Calls 13

PrintfFunction · 0.85
sortFunction · 0.85
containerFunction · 0.85
nameFunction · 0.85
c_strMethod · 0.80
DemangleFunction · 0.50
StrCatFunction · 0.50
getMethod · 0.45
push_backMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected