From f9cf248cae06a9cb708d79fc0d4904023a461822 Mon Sep 17 00:00:00 2001 From: SeungHui Lee Date: Sat, 21 Oct 2023 02:53:50 -0400 Subject: [PATCH] [Draft][tflchef/circlechef] Use a dedicated type for custom operators On going draft to use a dedicated type for custom operators in the recipe. ONE-DCO-1.0-Signed-off-by: SeungHui Lee --- compiler/circlechef/core/src/ModelChef.cpp | 25 +++++++++-------- compiler/circlechef/proto/circlechef.proto | 1 + compiler/tflchef/core/src/CustomOp/AddV2.cpp | 2 +- compiler/tflchef/core/src/CustomOp/All.cpp | 2 +- .../core/src/CustomOp/BatchMatMulV2.cpp | 2 +- .../tflchef/core/src/CustomOp/BroadcastTo.cpp | 2 +- compiler/tflchef/core/src/CustomOp/Erf.cpp | 2 +- compiler/tflchef/core/src/CustomOp/MatMul.cpp | 2 +- .../core/src/CustomOp/MatrixBandPart.cpp | 2 +- .../core/src/CustomOp/MaxPoolWithArgmax.cpp | 2 +- compiler/tflchef/core/src/ModelChef.cpp | 27 ++++++++++--------- compiler/tflchef/proto/tflchef.proto | 1 + compiler/tflchef/tests/custom_erf/test.recipe | 3 ++- res/TensorFlowLiteRecipes/All_000/test.recipe | 3 ++- .../BatchMatMulV2_000/test.recipe | 3 ++- .../BatchMatMulV2_001/test.recipe | 3 ++- .../BroadcastTo_000/test.recipe | 3 ++- .../MatMul_000/test.recipe | 3 ++- .../MatrixBandPart_000/test.recipe | 3 ++- .../MaxPoolWithArgmax_000/test.recipe | 3 ++- .../MaxPoolWithArgmax_001/test.recipe | 3 ++- .../MaxPoolWithArgmax_002/test.recipe | 3 ++- .../Net_BroadcastTo_AddV2_000/test.recipe | 6 +++-- .../Net_BroadcastTo_AddV2_001/test.recipe | 6 +++-- .../Net_FC_Gelu_FC_000/test.recipe | 3 ++- .../test.recipe | 3 ++- .../Net_Gelu_000/test.recipe | 3 ++- .../Net_Gelu_001/test.recipe | 3 ++- 28 files changed, 75 insertions(+), 49 deletions(-) diff --git a/compiler/circlechef/core/src/ModelChef.cpp b/compiler/circlechef/core/src/ModelChef.cpp index 6c5206dfc3d..a2148488eeb 100644 --- a/compiler/circlechef/core/src/ModelChef.cpp +++ b/compiler/circlechef/core/src/ModelChef.cpp @@ -135,10 +135,11 @@ gather_builtincode_map(const ::circlechef::ModelRecipe &model_recipe) for (const auto &operation : model_recipe.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == circle::BuiltinOperator_CUSTOM) + if (operation.type() == "Custom") continue; + auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); + // Various operation version is unified as the highest version among them if (builtin_map.find(op_chef->code()) == builtin_map.end() || builtin_map[op_chef->code()] < operation.version()) @@ -151,10 +152,10 @@ gather_builtincode_map(const ::circlechef::ModelRecipe &model_recipe) const auto &graph = model_recipe.graph(g); for (const auto &operation : graph.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == circle::BuiltinOperator_CUSTOM) + if (operation.type() == "Custom") continue; + auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); // Various operation version is unified as the highest version among them if (builtin_map.find(op_chef->code()) == builtin_map.end() || builtin_map[op_chef->code()] < operation.version()) @@ -171,9 +172,8 @@ std::set gather_customcode_set(const ::circlechef::ModelRecipe &mod std::set customcode_set; for (const auto &operation : model_recipe.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == circle::BuiltinOperator_CUSTOM) - customcode_set.insert(operation.type()); + if (operation.type() == "Custom") + customcode_set.insert(operation.custom_code()); } // Add ops used in Graphs(subgraphs) @@ -182,9 +182,8 @@ std::set gather_customcode_set(const ::circlechef::ModelRecipe &mod const auto &graph = model_recipe.graph(g); for (const auto &operation : graph.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == circle::BuiltinOperator_CUSTOM) - customcode_set.insert(operation.type()); + if (operation.type() == "Custom") + customcode_set.insert(operation.custom_code()); } } @@ -418,7 +417,11 @@ template void cook_graph(const T &graph, CookParams &cp) { assert(operation.has_type()); - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); + std::string op_type = operation.type(); + if (op_type == "Custom") + op_type = operation.custom_code(); + + auto op_chef = op_chef_registry().lookup(op_type).create(&operation); // Create 'inputs' std::vector input_vec = as_dataset(operation.input()).map(lookup).vectorize(); diff --git a/compiler/circlechef/proto/circlechef.proto b/compiler/circlechef/proto/circlechef.proto index d5e08576f0b..c01923a1a2e 100644 --- a/compiler/circlechef/proto/circlechef.proto +++ b/compiler/circlechef/proto/circlechef.proto @@ -91,6 +91,7 @@ message Operation { repeated string input = 2; repeated string output = 3; optional int32 version = 4 [default = 1]; + optional string custom_code = 5; optional BatchMatMulOptions batch_matmul_options = 100; optional InstanceNormOptions instance_norm_options = 101; diff --git a/compiler/tflchef/core/src/CustomOp/AddV2.cpp b/compiler/tflchef/core/src/CustomOp/AddV2.cpp index 557c20bce11..eeb63b96f6a 100644 --- a/compiler/tflchef/core/src/CustomOp/AddV2.cpp +++ b/compiler/tflchef/core/src/CustomOp/AddV2.cpp @@ -29,7 +29,7 @@ AddV2Chef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "AddV2"); + assert(operation.custom_code() == "AddV2"); /** * REGISTER_OP("AddV2") diff --git a/compiler/tflchef/core/src/CustomOp/All.cpp b/compiler/tflchef/core/src/CustomOp/All.cpp index bbef5ecaa37..56a6630470c 100644 --- a/compiler/tflchef/core/src/CustomOp/All.cpp +++ b/compiler/tflchef/core/src/CustomOp/All.cpp @@ -29,7 +29,7 @@ AllChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "All"); + assert(operation.custom_code() == "All"); /** * REGISTER_OP("All") diff --git a/compiler/tflchef/core/src/CustomOp/BatchMatMulV2.cpp b/compiler/tflchef/core/src/CustomOp/BatchMatMulV2.cpp index 6d2c5b13b61..84d05150836 100644 --- a/compiler/tflchef/core/src/CustomOp/BatchMatMulV2.cpp +++ b/compiler/tflchef/core/src/CustomOp/BatchMatMulV2.cpp @@ -29,7 +29,7 @@ BatchMatMulV2Chef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "BatchMatMulV2"); + assert(operation.custom_code() == "BatchMatMulV2"); /** * REGISTER_OP("BatchMatMulV2") diff --git a/compiler/tflchef/core/src/CustomOp/BroadcastTo.cpp b/compiler/tflchef/core/src/CustomOp/BroadcastTo.cpp index dd458b376c7..5d43c72a31e 100644 --- a/compiler/tflchef/core/src/CustomOp/BroadcastTo.cpp +++ b/compiler/tflchef/core/src/CustomOp/BroadcastTo.cpp @@ -29,7 +29,7 @@ BroadcastToChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "BroadcastTo"); + assert(operation.custom_code() == "BroadcastTo"); /** * REGISTER_OP("BroadcastTo") diff --git a/compiler/tflchef/core/src/CustomOp/Erf.cpp b/compiler/tflchef/core/src/CustomOp/Erf.cpp index f611b68e1dc..2e2605b6689 100644 --- a/compiler/tflchef/core/src/CustomOp/Erf.cpp +++ b/compiler/tflchef/core/src/CustomOp/Erf.cpp @@ -29,7 +29,7 @@ ErfChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "Erf"); + assert(operation.custom_code() == "Erf"); /** * REGISTER_OP("Erf") diff --git a/compiler/tflchef/core/src/CustomOp/MatMul.cpp b/compiler/tflchef/core/src/CustomOp/MatMul.cpp index e7c707d3722..32110d9ecb3 100644 --- a/compiler/tflchef/core/src/CustomOp/MatMul.cpp +++ b/compiler/tflchef/core/src/CustomOp/MatMul.cpp @@ -29,7 +29,7 @@ MatMulChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "MatMul"); + assert(operation.custom_code() == "MatMul"); /** * REGISTER_OP("MatMul") diff --git a/compiler/tflchef/core/src/CustomOp/MatrixBandPart.cpp b/compiler/tflchef/core/src/CustomOp/MatrixBandPart.cpp index b2500322789..2efaa447b1f 100644 --- a/compiler/tflchef/core/src/CustomOp/MatrixBandPart.cpp +++ b/compiler/tflchef/core/src/CustomOp/MatrixBandPart.cpp @@ -29,7 +29,7 @@ MatrixBandPartChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "MatrixBandPart"); + assert(operation.custom_code() == "MatrixBandPart"); /** * REGISTER_OP("MatrixBandPart") diff --git a/compiler/tflchef/core/src/CustomOp/MaxPoolWithArgmax.cpp b/compiler/tflchef/core/src/CustomOp/MaxPoolWithArgmax.cpp index 290d3c2cace..d930819a26b 100644 --- a/compiler/tflchef/core/src/CustomOp/MaxPoolWithArgmax.cpp +++ b/compiler/tflchef/core/src/CustomOp/MaxPoolWithArgmax.cpp @@ -29,7 +29,7 @@ MaxPoolWithArgmaxChef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const { auto &operation = (*_operation); - assert(operation.type() == "MaxPoolWithArgmax"); + assert(operation.custom_code() == "MaxPoolWithArgmax"); /** * REGISTER_OP("MaxPoolWithArgmax") diff --git a/compiler/tflchef/core/src/ModelChef.cpp b/compiler/tflchef/core/src/ModelChef.cpp index 3afcd232d70..00dbaeed15c 100644 --- a/compiler/tflchef/core/src/ModelChef.cpp +++ b/compiler/tflchef/core/src/ModelChef.cpp @@ -141,10 +141,10 @@ gather_builtincode_map(const ::tflchef::ModelRecipe &model_recipe) for (const auto &operation : model_recipe.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == tflite::BuiltinOperator_CUSTOM) + if (operation.type() == "Custom") continue; + auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); // Various operation version is unified as the highest version among them if (builtin_map.find(op_chef->code()) == builtin_map.end() || builtin_map[op_chef->code()] < operation.version()) @@ -157,10 +157,10 @@ gather_builtincode_map(const ::tflchef::ModelRecipe &model_recipe) const auto &graph = model_recipe.graph(g); for (const auto &operation : graph.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == tflite::BuiltinOperator_CUSTOM) + if (operation.type() == "Custom") continue; + auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); // Various operation version is unified as the highest version among them if (builtin_map.find(op_chef->code()) == builtin_map.end() || builtin_map[op_chef->code()] < operation.version()) @@ -177,9 +177,8 @@ std::set gather_customcode_set(const ::tflchef::ModelRecipe &model_ std::set customcode_set; for (const auto &operation : model_recipe.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == tflite::BuiltinOperator_CUSTOM) - customcode_set.insert(operation.type()); + if (operation.type() == "Custom") + customcode_set.insert(operation.custom_code()); } // Add ops used in Graphs(subgraphs) @@ -188,9 +187,8 @@ std::set gather_customcode_set(const ::tflchef::ModelRecipe &model_ const auto &graph = model_recipe.graph(g); for (const auto &operation : graph.operation()) { - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); - if (op_chef->code() == tflite::BuiltinOperator_CUSTOM) - customcode_set.insert(operation.type()); + if (operation.type() == "Custom") + customcode_set.insert(operation.custom_code()); } } @@ -619,7 +617,11 @@ template std::map cook_graph(const T &graph, { assert(operation.has_type()); - auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation); + std::string op_type = operation.type(); + if (op_type == "Custom") + op_type = operation.custom_code(); + + auto op_chef = op_chef_registry().lookup(op_type).create(&operation); // Create 'inputs' std::vector input_vec = as_dataset(operation.input()).map(lookup).vectorize(); @@ -650,7 +652,8 @@ template std::map cook_graph(const T &graph, // custom operator else { - auto op_it = std::find(custom_code_vec.begin(), custom_code_vec.end(), operation.type()); + auto op_it = + std::find(custom_code_vec.begin(), custom_code_vec.end(), operation.custom_code()); assert(op_it != custom_code_vec.end()); opcode_index = builtin_code_map.size(); opcode_index += std::distance(custom_code_vec.begin(), op_it); diff --git a/compiler/tflchef/proto/tflchef.proto b/compiler/tflchef/proto/tflchef.proto index 98ae2b23f94..94d85def9d7 100644 --- a/compiler/tflchef/proto/tflchef.proto +++ b/compiler/tflchef/proto/tflchef.proto @@ -556,6 +556,7 @@ message Operation { repeated string input = 2; repeated string output = 3; optional int32 version = 4 [default = 1]; + optional string custom_code = 5; optional Conv2DOptions conv2d_options = 100; optional Pool2DOptions averagepool2d_options = 101; diff --git a/compiler/tflchef/tests/custom_erf/test.recipe b/compiler/tflchef/tests/custom_erf/test.recipe index ab093a30e30..8877b0ebc8b 100644 --- a/compiler/tflchef/tests/custom_erf/test.recipe +++ b/compiler/tflchef/tests/custom_erf/test.recipe @@ -9,9 +9,10 @@ operand { shape { dim: 1 dim: 3 dim: 3 dim: 2 } } operation { - type: "Erf" + type: "Custom" input: "ifm" output: "ofm" + custom_code: "Erf" } input: "ifm" output: "ofm" diff --git a/res/TensorFlowLiteRecipes/All_000/test.recipe b/res/TensorFlowLiteRecipes/All_000/test.recipe index 6e0da1a473d..38187222f32 100644 --- a/res/TensorFlowLiteRecipes/All_000/test.recipe +++ b/res/TensorFlowLiteRecipes/All_000/test.recipe @@ -18,13 +18,14 @@ operand { } } operation { - type: "All" + type: "Custom" all_options { keep_dims: false } input: "ifm" input: "All/reduction_indices" output: "ofm" + custom_code: "All" } input: "ifm" output: "ofm" diff --git a/res/TensorFlowLiteRecipes/BatchMatMulV2_000/test.recipe b/res/TensorFlowLiteRecipes/BatchMatMulV2_000/test.recipe index c6163af924c..9af38a66e27 100644 --- a/res/TensorFlowLiteRecipes/BatchMatMulV2_000/test.recipe +++ b/res/TensorFlowLiteRecipes/BatchMatMulV2_000/test.recipe @@ -14,10 +14,11 @@ operand { shape { dim: 1 dim: 2 dim: 4 dim: 4 } } operation { - type: "BatchMatMulV2" + type: "Custom" input: "ifm1" input: "ifm2" output: "ofm" + custom_code: "BatchMatMulV2" } input: "ifm1" input: "ifm2" diff --git a/res/TensorFlowLiteRecipes/BatchMatMulV2_001/test.recipe b/res/TensorFlowLiteRecipes/BatchMatMulV2_001/test.recipe index 9350ca8dc73..9c5ca9f5b9d 100644 --- a/res/TensorFlowLiteRecipes/BatchMatMulV2_001/test.recipe +++ b/res/TensorFlowLiteRecipes/BatchMatMulV2_001/test.recipe @@ -14,13 +14,14 @@ operand { shape { dim: 2 dim: 2 dim: 2 dim: 4 } } operation { - type: "BatchMatMulV2" + type: "Custom" batch_matmul_options { adj_x : true } input: "ifm1" input: "ifm2" output: "ofm" + custom_code: "BatchMatMulV2" } input: "ifm1" input: "ifm2" diff --git a/res/TensorFlowLiteRecipes/BroadcastTo_000/test.recipe b/res/TensorFlowLiteRecipes/BroadcastTo_000/test.recipe index 015e40bc433..4365e084639 100644 --- a/res/TensorFlowLiteRecipes/BroadcastTo_000/test.recipe +++ b/res/TensorFlowLiteRecipes/BroadcastTo_000/test.recipe @@ -15,10 +15,11 @@ operand { shape { dim: 1 dim: 2 dim: 3 } } operation { - type: "BroadcastTo" + type: "Custom" input: "bc_input" input: "bc_shape" output: "bc_ofm" + custom_code: "BroadcastTo" } input: "bc_input" output: "bc_ofm" diff --git a/res/TensorFlowLiteRecipes/MatMul_000/test.recipe b/res/TensorFlowLiteRecipes/MatMul_000/test.recipe index 6e7853aa098..69564f1988e 100644 --- a/res/TensorFlowLiteRecipes/MatMul_000/test.recipe +++ b/res/TensorFlowLiteRecipes/MatMul_000/test.recipe @@ -14,7 +14,7 @@ operand { shape { dim: 3 dim: 3 } } operation { - type: "MatMul" + type: "Custom" input: "ifm1" input: "ifm2" output: "ofm" @@ -22,6 +22,7 @@ operation { transpose_a: true transpose_b: false } + custom_code: "MatMul" } input: "ifm1" input: "ifm2" diff --git a/res/TensorFlowLiteRecipes/MatrixBandPart_000/test.recipe b/res/TensorFlowLiteRecipes/MatrixBandPart_000/test.recipe index 702aaf8ecc8..0d17289a7fa 100644 --- a/res/TensorFlowLiteRecipes/MatrixBandPart_000/test.recipe +++ b/res/TensorFlowLiteRecipes/MatrixBandPart_000/test.recipe @@ -27,11 +27,12 @@ operand { shape { dim: 4 dim: 4 } } operation { - type: "MatrixBandPart" + type: "Custom" input: "ifm" input: "MatrixBandPart/num_lower" input: "MatrixBandPart/num_upper" output: "ofm" + custom_code: "MatrixBandPart" } input: "ifm" output: "ofm" diff --git a/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_000/test.recipe b/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_000/test.recipe index 9218c20109e..d618a6fa10d 100644 --- a/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_000/test.recipe +++ b/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_000/test.recipe @@ -14,7 +14,7 @@ operand { shape { dim: 1 dim: 9 dim: 9 dim: 1 } } operation { - type: "MaxPoolWithArgmax" + type: "Custom" input: "ifm" output: "ofm" output: "argmax" @@ -27,6 +27,7 @@ operation { output_type: INT64 include_batch_in_index: false } + custom_code: "MaxPoolWithArgmax" } input: "ifm" output: "ofm" diff --git a/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_001/test.recipe b/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_001/test.recipe index 9c15a7c63b8..4b85f55ddf7 100644 --- a/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_001/test.recipe +++ b/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_001/test.recipe @@ -14,7 +14,7 @@ operand { shape { dim: 1 dim: 9 dim: 9 dim: 1 } } operation { - type: "MaxPoolWithArgmax" + type: "Custom" input: "ifm" output: "ofm" output: "argmax" @@ -27,6 +27,7 @@ operation { output_type: INT32 include_batch_in_index: false } + custom_code: "MaxPoolWithArgmax" } input: "ifm" output: "ofm" diff --git a/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_002/test.recipe b/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_002/test.recipe index 702e0163482..ad0ca7c6699 100644 --- a/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_002/test.recipe +++ b/res/TensorFlowLiteRecipes/MaxPoolWithArgmax_002/test.recipe @@ -14,7 +14,7 @@ operand { shape { dim: 1 dim: 8 dim: 8 dim: 2 } } operation { - type: "MaxPoolWithArgmax" + type: "Custom" input: "ifm" output: "ofm" output: "argmax" @@ -27,6 +27,7 @@ operation { output_type: INT64 include_batch_in_index: false } + custom_code: "MaxPoolWithArgmax" } input: "ifm" output: "ofm" diff --git a/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_000/test.recipe b/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_000/test.recipe index 5069aac0996..a3a1105df9d 100644 --- a/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_000/test.recipe +++ b/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_000/test.recipe @@ -15,10 +15,11 @@ operand { shape { dim: 1 dim: 2 dim: 3 } } operation { - type: "BroadcastTo" + type: "Custom" input: "bc_input" input: "bc_shape" output: "bc_ofm" + custom_code: "BroadcastTo" } operand { name: "reshape_data" @@ -53,10 +54,11 @@ operand { shape { dim: 1 dim: 2 dim: 3 } } operation { - type: "AddV2" + type: "Custom" input: "bc_ofm" input: "reshape_ofm" output: "ofm" + custom_code: "AddV2" } input: "bc_input" input: "reshape_data" diff --git a/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_001/test.recipe b/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_001/test.recipe index ca0ad8e03bd..2a637588171 100644 --- a/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_001/test.recipe +++ b/res/TensorFlowLiteRecipes/Net_BroadcastTo_AddV2_001/test.recipe @@ -15,10 +15,11 @@ operand { shape { dim: 1 dim: 2 dim: 3 } } operation { - type: "BroadcastTo" + type: "Custom" input: "bc_input" input: "bc_shape" output: "bc_ofm" + custom_code: "BroadcastTo" } operand { name: "reshape_data" @@ -53,10 +54,11 @@ operand { shape { dim: 1 dim: 2 dim: 3 } } operation { - type: "AddV2" + type: "Custom" input: "bc_ofm" input: "reshape_ofm" output: "ofm" + custom_code: "AddV2" } input: "bc_input" input: "reshape_data" diff --git a/res/TensorFlowLiteRecipes/Net_FC_Gelu_FC_000/test.recipe b/res/TensorFlowLiteRecipes/Net_FC_Gelu_FC_000/test.recipe index 9e53d18f9e1..db3c106e16a 100644 --- a/res/TensorFlowLiteRecipes/Net_FC_Gelu_FC_000/test.recipe +++ b/res/TensorFlowLiteRecipes/Net_FC_Gelu_FC_000/test.recipe @@ -101,9 +101,10 @@ operation { output: "fc2" } operation { - type: "Erf" + type: "Custom" input: "fc2" output: "erf" + custom_code: "Erf" } operation { type: "Add" diff --git a/res/TensorFlowLiteRecipes/Net_Gather_SparseToDense_AddV2_000/test.recipe b/res/TensorFlowLiteRecipes/Net_Gather_SparseToDense_AddV2_000/test.recipe index 804d293fc83..31a725193d4 100644 --- a/res/TensorFlowLiteRecipes/Net_Gather_SparseToDense_AddV2_000/test.recipe +++ b/res/TensorFlowLiteRecipes/Net_Gather_SparseToDense_AddV2_000/test.recipe @@ -99,10 +99,11 @@ operation { output: "ofm_sparse" } operation { - type: "AddV2" + type: "Custom" input: "ofm_sparse" input: "add_v2_2" output: "ofm_add_v2" + custom_code: "AddV2" } operation { type: "Cast" diff --git a/res/TensorFlowLiteRecipes/Net_Gelu_000/test.recipe b/res/TensorFlowLiteRecipes/Net_Gelu_000/test.recipe index ae7f823e8b9..73816c33dae 100644 --- a/res/TensorFlowLiteRecipes/Net_Gelu_000/test.recipe +++ b/res/TensorFlowLiteRecipes/Net_Gelu_000/test.recipe @@ -65,9 +65,10 @@ operation { } } operation { - type: "Erf" + type: "Custom" input: "mul_sqrt" output: "erf" + custom_code: "Erf" } operation { type: "Add" diff --git a/res/TensorFlowLiteRecipes/Net_Gelu_001/test.recipe b/res/TensorFlowLiteRecipes/Net_Gelu_001/test.recipe index 76337293a3c..957ccc1787c 100644 --- a/res/TensorFlowLiteRecipes/Net_Gelu_001/test.recipe +++ b/res/TensorFlowLiteRecipes/Net_Gelu_001/test.recipe @@ -65,9 +65,10 @@ operation { } } operation { - type: "Erf" + type: "Custom" input: "mul_sqrt" output: "erf" + custom_code: "Erf" } operation { type: "Add"