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

Function ConvertConcatOperator

tensorflow/lite/toco/import_tensorflow.cc:1338–1361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1336}
1337
1338tensorflow::Status ConvertConcatOperator(
1339 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,
1340 const ModelFlags& model_flags, Model* model) {
1341 Operator* op = nullptr;
1342 if (node.op() == "Concat") {
1343 op = new TensorFlowConcatOperator;
1344 } else if (node.op() == "ConcatV2") {
1345 op = new TensorFlowConcatV2Operator;
1346 } else {
1347 LOG(FATAL) << "Expected Concat or ConcatV2";
1348 }
1349 const int num_inputs = GetInputsCount(node, tf_import_flags);
1350 QCHECK_GE(num_inputs, 2)
1351 << node.op()
1352 << " node expects at least 2 inputs other than control dependencies: "
1353 << node.DebugString();
1354 CHECK_EQ(num_inputs, 1 + GetIntAttr(node, "N"));
1355 for (int i = 0; i < num_inputs; ++i) {
1356 op->inputs.push_back(node.input(i));
1357 }
1358 op->outputs.push_back(node.name());
1359 model->operators.emplace_back(op);
1360 return tensorflow::Status::OK();
1361}
1362
1363tensorflow::Status ConvertMirrorPadOperator(
1364 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,

Callers

nothing calls this directly

Calls 8

GetInputsCountFunction · 0.85
GetIntAttrFunction · 0.85
nameMethod · 0.65
opMethod · 0.45
DebugStringMethod · 0.45
push_backMethod · 0.45
inputMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected