TODO(b/139320642): Add test when fused op is supported.
| 1878 | |
| 1879 | // TODO(b/139320642): Add test when fused op is supported. |
| 1880 | tensorflow::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. |
| 1910 | tensorflow::Status ConvertTransposeConvOperator( |
nothing calls this directly
no test coverage detected