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

Method InitFromGraph

tensorflow/core/graph/costmodel.cc:463–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461} // namespace
462
463void CostModel::InitFromGraph(const Graph& g) {
464 const int num_node_ids = g.num_node_ids();
465 slot_bytes_.reserve(num_node_ids);
466 count_.reserve(num_node_ids);
467 time_.reserve(num_node_ids);
468 max_mem_usage_.reserve(num_node_ids);
469 max_exec_time_.reserve(num_node_ids);
470 output_port_alloc_ids_.reserve(num_node_ids);
471
472 AddNodesToCostModel(g, this);
473 AssignSizes(g, this);
474 EstimateComputationCosts(g, this);
475 CheckInitialized(g);
476}
477
478void CostModel::AddToCostGraphDef(const Graph* graph,
479 CostGraphDef* cost_graph) const {

Callers 2

FindOrCreateCostModelMethod · 0.45
DoBuildPartitionsMethod · 0.45

Calls 5

AddNodesToCostModelFunction · 0.85
AssignSizesFunction · 0.85
EstimateComputationCostsFunction · 0.85
num_node_idsMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected