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

Function FindDynamicStitchNode

serving/processor/framework/graph_optimizer.cc:968–1003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

966}
967
968Node* FindDynamicStitchNode(Node* gather_node) {
969 // Supported pattern:
970 //
971 // KvResourceGather
972 // |
973 // Identity
974 // |
975 // ...
976 // |
977 // Identity
978 // |
979 // ParallelDynamicStitch
980 //
981 if (gather_node->num_outputs() != 1) {
982 LOG(FATAL) << "Gather node has more than one edge, "
983 << gather_node->DebugString();
984 }
985
986 for (const Edge* edge : gather_node->out_edges()) {
987 Node* dest = edge->dst();
988 while (dest->op_def().name() == "Identity") {
989 Node* tmp = nullptr;
990 for (const Edge* e : dest->out_edges()) {
991 tmp = e->dst();
992 break;
993 }
994 dest = tmp;
995 }
996
997 if (IsDynamicStitchOp(dest)) {
998 return dest;
999 }
1000 }
1001
1002 return nullptr;
1003}
1004
1005Node* CheckDynamicStitchNode(std::vector<Node*> gather_nodes) {
1006 Node* ds_node = nullptr;

Callers 1

CheckDynamicStitchNodeFunction · 0.85

Calls 6

IsDynamicStitchOpFunction · 0.85
nameMethod · 0.65
num_outputsMethod · 0.45
DebugStringMethod · 0.45
dstMethod · 0.45
op_defMethod · 0.45

Tested by

no test coverage detected