| 1361 | } |
| 1362 | |
| 1363 | tensorflow::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 | |
| 1388 | static constexpr int kAnyNumInputs = -1; |
| 1389 |
nothing calls this directly
no test coverage detected