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

Function ConvertSvdfOperator

tensorflow/lite/toco/import_tensorflow.cc:1880–1907  ·  view source on GitHub ↗

TODO(b/139320642): Add test when fused op is supported.

Source from the content-addressed store, hash-verified

1878
1879// TODO(b/139320642): Add test when fused op is supported.
1880tensorflow::Status ConvertSvdfOperator(
1881 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,
1882 const ModelFlags& model_flags, Model* model) {
1883 CHECK_EQ(node.op(), "Svdf");
1884 const int input_size = GetInputsCount(node, tf_import_flags);
1885 QCHECK(input_size == 4 || input_size == 5)
1886 << "Svdf node expects 3 or 4 inputs other than control dependencies: "
1887 << node.DebugString();
1888 bool has_bias = (input_size == 5);
1889 auto* op = new SvdfOperator;
1890 int index = 0;
1891 op->inputs.push_back(node.input(index++));
1892 op->inputs.push_back(node.input(index++));
1893 op->inputs.push_back(node.input(index++));
1894 if (has_bias) {
1895 op->inputs.push_back(node.input(index++));
1896 }
1897 op->inputs.push_back(node.input(index));
1898 op->outputs.push_back(node.name());
1899 if (node.attr().at("ActivationFunction").s() == "Relu") {
1900 op->fused_activation_function = FusedActivationFunctionType::kRelu;
1901 } else {
1902 op->fused_activation_function = FusedActivationFunctionType::kNone;
1903 }
1904 op->rank = node.attr().at("Rank").i();
1905 model->operators.emplace_back(op);
1906 return tensorflow::Status::OK();
1907}
1908
1909// This is just bare bones support to get the shapes to propagate.
1910tensorflow::Status ConvertTransposeConvOperator(

Callers

nothing calls this directly

Calls 10

GetInputsCountFunction · 0.85
attrMethod · 0.80
nameMethod · 0.65
opMethod · 0.45
DebugStringMethod · 0.45
push_backMethod · 0.45
inputMethod · 0.45
atMethod · 0.45
iMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected