Files
wehub-resource-sync 8a852e4b4e
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s
chore: import upstream snapshot with attribution
2026-07-13 12:14:16 +08:00

137 lines
3.6 KiB
Python

load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_native_cc_binary")
load("//tensorflow/core/platform:build_config.bzl", "tf_proto_library")
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:LICENSE"],
# copybara:uncomment_begin(google-only)
# default_visibility = [
# ":friends",
# "//tensorflow:__pkg__",
# ],
# copybara:uncomment_end_and_comment_begin
default_visibility = [
"//visibility:public",
],
# copybara:comment_end
licenses = ["notice"],
)
package_group(
name = "friends",
packages = [
"//learning/brain/mlir/quantization/...",
"//tensorflow/compiler/mlir/...",
"//tensorflow/lite/tools/optimize/...",
],
)
tf_proto_library(
name = "quantization_info_proto",
srcs = [
"quantization_info.proto",
],
)
cc_library(
name = "quantization_passes",
srcs = [
"import_quant_stats_pass.cc",
],
hdrs = [
"quantization_passes.h",
],
deps = [
":quantization_info_proto_cc",
"//tensorflow/compiler/mlir/lite/quantization/ir:QuantOps",
"//tensorflow/compiler/mlir/tensorflow:import_utils",
"//tensorflow/compiler/mlir/tensorflow:location_utils",
"@com_google_absl//absl/strings",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:Support",
],
alwayslink = 1,
)
tf_native_cc_binary(
name = "op_quant_spec_getters_gen",
srcs = [
"tools/op_quant_spec_getters_gen.cc",
],
deps = [
"@llvm-project//llvm:Support",
"@llvm-project//llvm:TableGen",
"@llvm-project//mlir:TableGen",
],
)
tf_native_cc_binary(
name = "tflite_op_coverage_spec_getters_gen",
srcs = [
"tools/tflite_op_coverage_spec_getters_gen.cc",
],
deps = [
"@com_google_absl//absl/strings",
"@llvm-project//llvm:Support",
"@llvm-project//llvm:TableGen",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:TableGen",
"@tsl//tsl/platform:regexp",
"@xla//xla/tsl/platform:logging",
],
)
cc_library(
name = "numerical_utils",
srcs = ["numerical_utils.cc"],
hdrs = ["numerical_utils.h"],
deps = [
"@com_google_absl//absl/types:optional",
],
)
cc_library(
name = "device_target",
srcs = ["device_target.cc"],
hdrs = ["device_target.h"],
deps = [
":numerical_utils",
"//tensorflow/compiler/mlir/lite/quantization/ir:QuantOps",
"@com_google_absl//absl/types:optional",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:Support",
],
)
cc_library(
name = "quantization_context",
srcs = ["quantization_context.cc"],
hdrs = ["quantization_context.h"],
deps = [
":device_target",
"//tensorflow/compiler/mlir/lite/quantization/common/quantization_lib",
"//tensorflow/compiler/mlir/lite/quantization/ir:QuantOps",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:Support",
],
)
tf_cc_test(
name = "numerical_utils_test",
srcs = ["numerical_utils_test.cc"],
deps = [
":numerical_utils",
"@com_google_absl//absl/types:optional",
"@com_google_googletest//:gtest_main",
],
)