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

Function ConvertReduceOperator

tensorflow/lite/toco/import_tensorflow.cc:1862–1877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1860
1861template <typename T>
1862tensorflow::Status ConvertReduceOperator(
1863 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,
1864 const ModelFlags& model_flags, Model* model) {
1865 TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 2));
1866 auto* op = new T;
1867 op->inputs.push_back(node.input(0));
1868 op->inputs.push_back(node.input(1));
1869 op->outputs.push_back(node.name());
1870 model->operators.emplace_back(op);
1871 if (HasAttr(node, "keepdims")) {
1872 op->keep_dims = GetBoolAttr(node, "keepdims");
1873 } else if (HasAttr(node, "keep_dims")) {
1874 op->keep_dims = GetBoolAttr(node, "keep_dims");
1875 }
1876 return tensorflow::Status::OK();
1877}
1878
1879// TODO(b/139320642): Add test when fused op is supported.
1880tensorflow::Status ConvertSvdfOperator(

Callers

nothing calls this directly

Calls 7

CheckInputsCountFunction · 0.85
HasAttrFunction · 0.85
GetBoolAttrFunction · 0.70
nameMethod · 0.65
push_backMethod · 0.45
inputMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected