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

Function ConvertMirrorPadOperator

tensorflow/lite/toco/import_tensorflow.cc:1363–1386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1361}
1362
1363tensorflow::Status ConvertMirrorPadOperator(
1364 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,
1365 const ModelFlags& model_flags, Model* model) {
1366 if (node.op() != "MirrorPad") {
1367 LOG(FATAL) << "Expected MirrorPad.";
1368 }
1369 const int num_inputs = GetInputsCount(node, tf_import_flags);
1370 CHECK_EQ(num_inputs, 2);
1371 auto* op = new MirrorPadOperator;
1372 for (int i = 0; i < num_inputs; ++i) {
1373 op->inputs.push_back(node.input(i));
1374 }
1375 op->outputs.push_back(node.name());
1376 const auto mode = GetStringAttr(node, "mode");
1377 if (mode == "REFLECT") {
1378 op->mode = toco::MirrorPadMode::kReflect;
1379 } else if (mode == "SYMMETRIC") {
1380 op->mode = toco::MirrorPadMode::kSymmetric;
1381 }
1382
1383 model->operators.emplace_back(op);
1384
1385 return tensorflow::Status::OK();
1386}
1387
1388static constexpr int kAnyNumInputs = -1;
1389

Callers

nothing calls this directly

Calls 7

GetInputsCountFunction · 0.85
GetStringAttrFunction · 0.85
nameMethod · 0.65
opMethod · 0.45
push_backMethod · 0.45
inputMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected