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

Method SerializeToString

tensorflow/core/profiler/internal/tfprof_stats.cc:326–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void TFStats::SerializeToString(string* content) {
327 ProfileProto profile;
328 for (const auto& entry : id_to_string_) {
329 (*profile.mutable_id_to_string())[entry.first] = entry.second;
330 }
331 for (auto it = nodes_map_.begin(); it != nodes_map_.end(); it++) {
332 if (it->second->id() < 0) {
333 continue;
334 }
335 (*profile.mutable_nodes())[it->second->id()].MergeFrom(
336 it->second->ToProto(nodes_map_));
337 }
338
339 profile.set_has_trace(has_code_traces_);
340 profile.set_miss_accelerator_stream(miss_accelerator_stream_);
341 for (int64 s : steps_) {
342 profile.add_steps(s);
343 }
344 *content = profile.SerializeAsString();
345}
346
347void TFStats::WriteProfile(const string& filename) {
348 string content;

Callers 1

SerializeToStringFunction · 0.45

Calls 5

beginMethod · 0.45
endMethod · 0.45
idMethod · 0.45
ToProtoMethod · 0.45
SerializeAsStringMethod · 0.45

Tested by

no test coverage detected