Skip to content

Commit

Permalink
fix CI code style errors
Browse files Browse the repository at this point in the history
fix CI BUILD file style errors
  • Loading branch information
ddavis-2015 committed Oct 21, 2024
1 parent 821dfdf commit d96b614
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 34 deletions.
3 changes: 2 additions & 1 deletion tensorflow/compiler/mlir/lite/core/api/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_copts",
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/core/api/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_copts",
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/kernels/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_copts",
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/kernels/internal/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("//tensorflow/lite:build_def.bzl", "tflite_copts")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_copts",
)
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/lite/micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ tflm_cc_library(
":micro_graph",
":micro_log",
":micro_profiler",
"//tensorflow/lite/c:common",
"//tensorflow/lite:type_to_tflitetype",
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro/kernels:decompress",
],
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/arena_allocator/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/benchmarks/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Description:
# TensorFlow Lite microcontroller benchmarks.

load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_binary",
"tflm_cc_library",
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/compression/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/lite/micro/compression/model_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def values(self):

@property
def channel_count(self):
if (self.tensor.quantization is None or
self.tensor.quantization.scale is None):
if (self.tensor.quantization is None
or self.tensor.quantization.scale is None):
return 1
return len(self.tensor.quantization.scale)

Expand Down
17 changes: 7 additions & 10 deletions tensorflow/lite/micro/compression/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ def unpack_subgraphs(subgraphs):
def unpack_metadata(metadata):
if metadata is None:
return None
return [{
"name": _decode_name(m.name),
"buffer": m.buffer
} for m in metadata]
return [{"name": _decode_name(m.name), "buffer": m.buffer} for m in metadata]


def unpack_lut_tensors(lut_tensors):
Expand Down Expand Up @@ -231,17 +228,17 @@ def create_dictionary(flatbuffer: memoryview) -> dict:

output = {
"description":
model.description,
model.description,
"version":
model.version,
model.version,
"operator_codes":
unpack_list(model.operatorCodes),
unpack_list(model.operatorCodes),
"metadata":
unpack_metadata(model.metadata),
unpack_metadata(model.metadata),
"subgraphs":
unpack_subgraphs(model.subgraphs),
unpack_subgraphs(model.subgraphs),
"buffers":
unpack_buffers(model, comp_metadata_index, comp_metadata_unpacked),
unpack_buffers(model, comp_metadata_index, comp_metadata_unpacked),
}

return output
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/examples/micro_speech/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# TensorFlow Lite microcontroller example.
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"generate_cc_arrays",
"tflm_cc_library",
"tflm_cc_test",
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/examples/person_detection/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Description:
# TensorFlow Lite for Microcontrollers Vision Example.
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"generate_cc_arrays",
"tflm_cc_binary",
"tflm_cc_library",
Expand Down
14 changes: 8 additions & 6 deletions tensorflow/lite/micro/kernels/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
"tflm_copts",
Expand Down Expand Up @@ -641,17 +642,18 @@ tflm_cc_test(
srcs = [
"decompress_test.cc",
],
target_compatible_with = select({
"//conditions:default": ["@platforms//:incompatible"],
"//:with_compression_enabled": [],
}),
deps = [
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_log",
"//tensorflow/lite/micro:micro_arena_constants",
"//tensorflow/lite/micro:micro_log",
"//tensorflow/lite/micro:test_helpers",
"//tensorflow/lite/micro/testing:micro_test",
],
target_compatible_with = select({
"//conditions:default": ["@platforms//:incompatible"],
"//:with_compression_enabled": [],
}),

)

tflm_cc_test(
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/kernels/testdata/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
)

Expand Down
5 changes: 2 additions & 3 deletions tensorflow/lite/micro/memory_arena_threshold_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ uint8_t test_conv_tensor_arena[kTestConvModelArenaSize];
constexpr int kTestConvModelTensorCount = 15;
constexpr int kTestConvModelNodeAndRegistrationCount = 7;

constexpr int kKeywordModelPersistentBufferDataSize =
#if defined(USE_TFLM_COMPRESSION)
920;
constexpr int kKeywordModelPersistentBufferDataSize = 920;
#else
840;
constexpr int kKeywordModelPersistentBufferDataSize = 840;
#endif

// NOTE: These values are measured on x86-64:
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/testing/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_library",
"tflm_cc_test",
)
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/tools/benchmarking/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//tensorflow/lite/micro:build_def.bzl",
load(
"//tensorflow/lite/micro:build_def.bzl",
"tflm_cc_binary",
"tflm_cc_library",
"tflm_defines",
Expand Down

0 comments on commit d96b614

Please sign in to comment.