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

Function ConvertStridedSliceOperator

tensorflow/lite/toco/import_tensorflow.cc:1474–1501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1472}
1473
1474tensorflow::Status ConvertStridedSliceOperator(
1475 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,
1476 const ModelFlags& model_flags, Model* model) {
1477 CHECK_EQ(node.op(), "StridedSlice");
1478 // TODO(soroosh): The 4th input (strides) should be e optional, to be
1479 // consistent with TF.
1480 TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 4));
1481
1482 auto* op = new StridedSliceOperator;
1483 for (const auto& input : node.input()) {
1484 op->inputs.push_back(input);
1485 }
1486 op->outputs.push_back(node.name());
1487
1488 op->begin_mask =
1489 HasAttr(node, "begin_mask") ? GetIntAttr(node, "begin_mask") : 0;
1490 op->ellipsis_mask =
1491 HasAttr(node, "ellipsis_mask") ? GetIntAttr(node, "ellipsis_mask") : 0;
1492 op->end_mask = HasAttr(node, "end_mask") ? GetIntAttr(node, "end_mask") : 0;
1493 op->new_axis_mask =
1494 HasAttr(node, "new_axis_mask") ? GetIntAttr(node, "new_axis_mask") : 0;
1495 op->shrink_axis_mask = HasAttr(node, "shrink_axis_mask")
1496 ? GetIntAttr(node, "shrink_axis_mask")
1497 : 0;
1498
1499 model->operators.emplace_back(op);
1500 return tensorflow::Status::OK();
1501}
1502
1503tensorflow::Status ConvertPlaceholderOperator(
1504 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,

Callers

nothing calls this directly

Calls 8

CheckInputsCountFunction · 0.85
HasAttrFunction · 0.85
GetIntAttrFunction · 0.85
nameMethod · 0.65
opMethod · 0.45
inputMethod · 0.45
push_backMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected