| # Copyright 2024 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| load("@rules_cc//cc:defs.bzl", "cc_binary") |
| |
| package( |
| default_visibility = ["//:__subpackages__"], |
| ) |
| |
| # Generates a header that embeds the content of schema.fbs as a byte array |
| # `schema_fbs[]` and length as `schema_fbs_len`. |
| genrule( |
| name = "schema_fbs_embed", |
| srcs = ["@org_tensorflow//tensorflow/lite/schema:schema.fbs"], |
| outs = ["schema_fbs_embed-inl.h"], |
| cmd = """ |
| xxd -name schema_fbs -include $(<) > $(@) |
| """, |
| ) |
| |
| cc_binary( |
| name = "tflite_to_json", |
| srcs = [ |
| "tflite_to_json.cc", |
| ":schema_fbs_embed", |
| ], |
| deps = [ |
| "//common:log", |
| "@flatbuffers", |
| "@org_tensorflow//tensorflow/lite:framework", |
| "@org_tensorflow//tensorflow/lite/tools:command_line_flags", |
| ], |
| ) |
| |
| cc_binary( |
| name = "op_compat_test", |
| testonly = True, |
| srcs = [ |
| "op_compat_test.cc", |
| ], |
| deps = [ |
| "//common:log", |
| "//common:single_op_model_builder", |
| "//common/test_util:stable_delegate_env", |
| "@com_google_googletest//:gtest", |
| "@org_tensorflow//tensorflow/lite:framework", |
| "@org_tensorflow//tensorflow/lite/kernels:builtin_ops", |
| "@org_tensorflow//tensorflow/lite/tools:utils", |
| ], |
| ) |