diff --git a/tensorflow/lite/tools/BUILD b/tensorflow/lite/tools/BUILD index 22fa1ff1cea..078f139f19b 100644 --- a/tensorflow/lite/tools/BUILD +++ b/tensorflow/lite/tools/BUILD @@ -319,6 +319,7 @@ cc_library( hdrs = ["list_flex_ops.h"], deps = [ "//tensorflow/lite:framework", + "//tensorflow/lite/schema:schema_utils", "@jsoncpp_git//:jsoncpp", ], ) diff --git a/tensorflow/lite/tools/list_flex_ops_no_kernel.cc b/tensorflow/lite/tools/list_flex_ops_no_kernel.cc index 68d40be1c9c..e90e3d75f22 100644 --- a/tensorflow/lite/tools/list_flex_ops_no_kernel.cc +++ b/tensorflow/lite/tools/list_flex_ops_no_kernel.cc @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "json/json.h" +#include "tensorflow/lite/schema/schema_utils.h" #include "tensorflow/lite/tools/list_flex_ops.h" namespace tflite { @@ -40,7 +41,7 @@ void AddFlexOpsFromModel(const tflite::Model* model, OpKernelSet* flex_ops) { for (int i = 0; i < operators->size(); ++i) { const tflite::Operator* op = operators->Get(i); const tflite::OperatorCode* opcode = opcodes->Get(op->opcode_index()); - if (opcode->builtin_code() != tflite::BuiltinOperator_CUSTOM || + if (tflite::GetBuiltinCode(opcode) != tflite::BuiltinOperator_CUSTOM || !tflite::IsFlexOp(opcode->custom_code()->c_str())) { continue; }