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

Method FromProto

tensorflow/core/profiler/internal/tfprof_node.h:436–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434 }
435
436 void FromProto(const ProfileNode& node, const ProfileProto& profile,
437 const std::map<int64, string>* id_to_string) {
438 node_.Clear();
439 node_.MergeFrom(node);
440
441 call_stack_.reset(new CallStack(node.trace(), id_to_string));
442
443 op_types_.clear();
444 op_types_.insert(node_.op_types().begin(), node_.op_types().end());
445
446 shape_.clear();
447 for (int64 s : node_.shape()) {
448 shape_.push_back(s);
449 }
450
451 execs_.clear();
452 for (const auto& exec_pb : node.execs()) {
453 auto& exec = execs_[exec_pb.first];
454 exec.FromProto(exec_pb.second);
455 }
456
457 inputs_.clear();
458 for (const auto& inp : node.inputs()) {
459 inputs_[inp.first] = profile.nodes().at(inp.second).name();
460 }
461
462 input_shapes_.clear();
463 for (const auto& s : node.input_shapes()) {
464 auto& shape = input_shapes_[s.first];
465 for (const int64 d : s.second.int64_values()) {
466 shape.push_back(d);
467 }
468 }
469
470 output_shapes_.clear();
471 for (const auto& s : node.output_shapes()) {
472 auto& shape = output_shapes_[s.first];
473 for (const int64 d : s.second.int64_values()) {
474 shape.push_back(d);
475 }
476 }
477
478 src_output_idx_.clear();
479 for (const auto& s : node.src_output_index()) {
480 src_output_idx_[profile.nodes().at(s.first).name()] = s.second;
481 }
482 }
483
484 const std::map<int32, string>& inputs() const { return inputs_; }
485

Callers

nothing calls this directly

Calls 15

input_shapesMethod · 0.80
nameMethod · 0.65
ClearMethod · 0.45
resetMethod · 0.45
traceMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
shapeMethod · 0.45
push_backMethod · 0.45
FromProtoMethod · 0.45

Tested by

no test coverage detected