16d3f15320
ARM CI / build (3.10) (push) Has been cancelled
cffconvert / validate (push) Has been cancelled
Creates a GitHub Issue when a PR Rolled back via Commit to Master / create-issue-on-pr-rollback (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
93 lines
2.8 KiB
Python
93 lines
2.8 KiB
Python
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
# ==============================================================================
|
|
|
|
load("@xla//third_party/rules_python/python:py_binary.bzl", "py_binary")
|
|
load("@xla//third_party/rules_python/python:py_library.bzl", "py_library")
|
|
load("//tensorflow:tensorflow.bzl", "py_test")
|
|
load("//tensorflow:tensorflow.default.bzl", "pybind_extension")
|
|
|
|
package(
|
|
# copybara:uncomment default_applicable_licenses = ["//tensorflow:LICENSE"],
|
|
default_visibility = [
|
|
"//visibility:public",
|
|
],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
py_binary(
|
|
name = "modify_model_interface",
|
|
srcs = ["modify_model_interface.py"],
|
|
strict_deps = True,
|
|
deps = [
|
|
":modify_model_interface_constants",
|
|
":modify_model_interface_lib",
|
|
"@absl_py//absl:app",
|
|
"@absl_py//absl/flags",
|
|
],
|
|
)
|
|
|
|
py_library(
|
|
name = "modify_model_interface_lib",
|
|
srcs = ["modify_model_interface_lib.py"],
|
|
strict_deps = True,
|
|
deps = [
|
|
":_pywrap_modify_model_interface",
|
|
":modify_model_interface_constants",
|
|
"//tensorflow/lite/python:schema_py",
|
|
],
|
|
)
|
|
|
|
# Use --config=disable_tf_lite_py when running this test under github.
|
|
py_test(
|
|
name = "modify_model_interface_lib_test",
|
|
srcs = ["modify_model_interface_lib_test.py"],
|
|
strict_deps = True,
|
|
deps = [
|
|
":modify_model_interface_lib",
|
|
#internal proto upb dep
|
|
"//third_party/py/numpy",
|
|
"//tensorflow:tensorflow_py",
|
|
"//tensorflow/lite/python:lite",
|
|
"//tensorflow/python/framework:test_lib",
|
|
"//tensorflow/python/platform:client_testlib",
|
|
],
|
|
)
|
|
|
|
py_library(
|
|
name = "modify_model_interface_constants",
|
|
srcs = ["modify_model_interface_constants.py"],
|
|
strict_deps = True,
|
|
deps = ["//tensorflow/python/framework:dtypes"],
|
|
)
|
|
|
|
pybind_extension(
|
|
name = "_pywrap_modify_model_interface",
|
|
srcs = ["modify_model_interface.cc"],
|
|
common_lib_packages = [
|
|
"litert/python",
|
|
"tensorflow/lite/python",
|
|
],
|
|
enable_stub_generation = True,
|
|
pytype_srcs = [
|
|
"_pywrap_modify_model_interface.pyi",
|
|
],
|
|
wrap_py_init = True,
|
|
deps = [
|
|
"//tensorflow/lite/schema:schema_fbs",
|
|
"//tensorflow/lite/tools/optimize:modify_model_interface",
|
|
"@pybind11",
|
|
],
|
|
)
|