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

Function CreateConcatOp

serving/processor/framework/graph_optimizer.cc:2033–2056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2031}
2032
2033Status CreateConcatOp(const std::string& name,
2034 DataType type,
2035 std::vector<SrcInfo> input_info,
2036 Graph* graph, Node** concat_op) {
2037 NodeDef def;
2038 def.set_name(name);
2039 def.set_op("Concat");
2040 AttrValue attr_T;
2041 attr_T.set_type(type);
2042 def.mutable_attr()->insert({"T", attr_T});
2043 AttrValue attr_N;
2044 attr_N.set_i(input_info.size() - 1);
2045 def.mutable_attr()->insert({"N", attr_N});
2046 Status status;
2047 *concat_op = graph->AddNode(def, &status);
2048 TF_RETURN_IF_ERROR(status);
2049
2050 for (size_t i = 0; i < input_info.size(); ++i) {
2051 graph->AddEdge(input_info[i].src_node, input_info[i].src_slot,
2052 *concat_op, i);
2053 }
2054
2055 return status;
2056}
2057
2058}
2059

Callers 1

CreateIncrRestoreOpMethod · 0.85

Calls 6

set_opMethod · 0.80
set_nameMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45
AddNodeMethod · 0.45
AddEdgeMethod · 0.45

Tested by

no test coverage detected