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

Method CopySubgraphNodes

tensorflow/compiler/jit/encapsulate_subgraphs_pass.cc:691–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689bool IsInSubgraph(const string& func_id) { return !func_id.empty(); }
690
691Status Encapsulator::CopySubgraphNodes(
692 std::unordered_map<const Node*, Node*>* node_images) {
693 for (Node* node : graph_in_->op_nodes()) {
694 string func_id;
695 TF_RETURN_IF_ERROR(GetFunctionNameAttr(node, &func_id));
696 if (!IsInSubgraph(func_id)) continue;
697
698 Subgraph& subgraph = subgraphs_[func_id];
699 Node* image = subgraph.MakeNodeImage(graph_in_, node);
700 image->ClearAttr(group_attribute_);
701 (*node_images)[node] = image;
702 }
703 return Status::OK();
704}
705
706Status Encapsulator::CopySubgraphEdges(
707 const std::unordered_map<const Node*, Node*>& node_images,

Callers

nothing calls this directly

Calls 4

op_nodesMethod · 0.80
ClearAttrMethod · 0.80
IsInSubgraphFunction · 0.70
MakeNodeImageMethod · 0.45

Tested by

no test coverage detected