Skip to content

Commit 48c3bae

Browse files
Nick Kreegertensorflower-gardener
authored andcommitted
Split getter and setter functions in schema utility files.
This enables TFLite Micro to selectively include these setter functions in unit tests. The APIs used in creating the flatbuffer introduce new and delete symbols which can cause issues for libraries not fully building with --gc-sections in linker flags. PiperOrigin-RevId: 339324965 Change-Id: I720b8dab6d80a94a47b7c8c427067966e2c42943
1 parent 71aaef0 commit 48c3bae

37 files changed

+172
-107
lines changed

tensorflow/compiler/mlir/lite/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ cc_library(
671671
"//tensorflow/lite:string_util",
672672
"//tensorflow/lite/delegates/flex:allowlisted_flex_ops_lib",
673673
"//tensorflow/lite/kernels/internal:kernel_utils",
674+
"//tensorflow/lite/schema:schema_conversion_utils",
674675
"//tensorflow/lite/schema:schema_fbs",
675-
"//tensorflow/lite/schema:schema_utils",
676676
"//tensorflow/lite/tools/versioning",
677677
"@com_google_absl//absl/base:core_headers",
678678
"@com_google_absl//absl/container:flat_hash_map",

tensorflow/compiler/mlir/lite/flatbuffer_export.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ limitations under the License.
7474
#include "tensorflow/core/platform/status.h"
7575
#include "tensorflow/lite/delegates/flex/allowlisted_flex_ops.h"
7676
#include "tensorflow/lite/kernels/internal/kernel_utils.h"
77+
#include "tensorflow/lite/schema/schema_conversion_utils.h"
7778
#include "tensorflow/lite/schema/schema_generated.h"
78-
#include "tensorflow/lite/schema/schema_utils.h"
7979
#include "tensorflow/lite/string_util.h"
8080
#include "tensorflow/lite/tools/versioning/op_version.h"
8181
#include "tensorflow/lite/tools/versioning/runtime_version.h"

tensorflow/lite/core/api/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ cc_test(
9797
srcs = ["op_resolver_test.cc"],
9898
deps = [
9999
":api",
100-
"//tensorflow/lite/schema:schema_utils",
100+
"//tensorflow/lite/schema:schema_conversion_utils",
101101
"@com_google_googletest//:gtest",
102102
],
103103
)

tensorflow/lite/core/api/op_resolver_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818
#include <cstring>
1919

2020
#include <gtest/gtest.h>
21-
#include "tensorflow/lite/schema/schema_utils.h"
21+
#include "tensorflow/lite/schema/schema_conversion_utils.h"
2222

2323
namespace tflite {
2424
namespace {

tensorflow/lite/delegates/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ cc_test(
8585
"//tensorflow/lite/kernels:builtin_ops",
8686
"//tensorflow/lite/kernels:kernel_util",
8787
"//tensorflow/lite/kernels/internal:compatibility",
88+
"//tensorflow/lite/schema:schema_conversion_utils",
8889
"//tensorflow/lite/schema:schema_fbs",
89-
"//tensorflow/lite/schema:schema_utils",
9090
"//tensorflow/lite/testing:util",
9191
"//third_party/eigen3",
9292
"@com_google_googletest//:gtest",

tensorflow/lite/delegates/delegate_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ limitations under the License.
3030
#include "tensorflow/lite/kernels/internal/compatibility.h"
3131
#include "tensorflow/lite/kernels/kernel_util.h"
3232
#include "tensorflow/lite/kernels/register.h"
33+
#include "tensorflow/lite/schema/schema_conversion_utils.h"
3334
#include "tensorflow/lite/schema/schema_generated.h"
34-
#include "tensorflow/lite/schema/schema_utils.h"
3535
#include "tensorflow/lite/testing/util.h"
3636
#include "tensorflow/lite/util.h"
3737
#include "tensorflow/lite/version.h"

tensorflow/lite/delegates/xnnpack/BUILD

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ cc_library(
7676
"//tensorflow/lite:schema_fbs_version",
7777
"//tensorflow/lite/c:common",
7878
"//tensorflow/lite/kernels:builtin_ops",
79+
"//tensorflow/lite/schema:schema_conversion_utils",
7980
"//tensorflow/lite/schema:schema_fbs",
80-
"//tensorflow/lite/schema:schema_utils",
8181
"@FP16",
8282
"@com_google_googletest//:gtest",
8383
"@flatbuffers",
@@ -94,8 +94,8 @@ cc_library(
9494
"//tensorflow/lite:schema_fbs_version",
9595
"//tensorflow/lite/c:common",
9696
"//tensorflow/lite/kernels:builtin_ops",
97+
"//tensorflow/lite/schema:schema_conversion_utils",
9798
"//tensorflow/lite/schema:schema_fbs",
98-
"//tensorflow/lite/schema:schema_utils",
9999
"@FP16",
100100
"@com_google_googletest//:gtest",
101101
"@flatbuffers",
@@ -112,8 +112,8 @@ cc_library(
112112
"//tensorflow/lite:schema_fbs_version",
113113
"//tensorflow/lite/c:common",
114114
"//tensorflow/lite/kernels:builtin_ops",
115+
"//tensorflow/lite/schema:schema_conversion_utils",
115116
"//tensorflow/lite/schema:schema_fbs",
116-
"//tensorflow/lite/schema:schema_utils",
117117
"@FP16",
118118
"@com_google_googletest//:gtest",
119119
"@flatbuffers",
@@ -130,8 +130,8 @@ cc_library(
130130
"//tensorflow/lite:schema_fbs_version",
131131
"//tensorflow/lite/c:common",
132132
"//tensorflow/lite/kernels:builtin_ops",
133+
"//tensorflow/lite/schema:schema_conversion_utils",
133134
"//tensorflow/lite/schema:schema_fbs",
134-
"//tensorflow/lite/schema:schema_utils",
135135
"@FP16",
136136
"@com_google_googletest//:gtest",
137137
"@flatbuffers",
@@ -148,8 +148,8 @@ cc_library(
148148
"//tensorflow/lite:schema_fbs_version",
149149
"//tensorflow/lite/c:common",
150150
"//tensorflow/lite/kernels:builtin_ops",
151+
"//tensorflow/lite/schema:schema_conversion_utils",
151152
"//tensorflow/lite/schema:schema_fbs",
152-
"//tensorflow/lite/schema:schema_utils",
153153
"@com_google_googletest//:gtest",
154154
"@flatbuffers",
155155
],
@@ -165,8 +165,8 @@ cc_library(
165165
"//tensorflow/lite:schema_fbs_version",
166166
"//tensorflow/lite/c:common",
167167
"//tensorflow/lite/kernels:builtin_ops",
168+
"//tensorflow/lite/schema:schema_conversion_utils",
168169
"//tensorflow/lite/schema:schema_fbs",
169-
"//tensorflow/lite/schema:schema_utils",
170170
"@com_google_googletest//:gtest",
171171
"@flatbuffers",
172172
],
@@ -182,8 +182,8 @@ cc_library(
182182
"//tensorflow/lite:schema_fbs_version",
183183
"//tensorflow/lite/c:common",
184184
"//tensorflow/lite/kernels:builtin_ops",
185+
"//tensorflow/lite/schema:schema_conversion_utils",
185186
"//tensorflow/lite/schema:schema_fbs",
186-
"//tensorflow/lite/schema:schema_utils",
187187
"@com_google_googletest//:gtest",
188188
"@flatbuffers",
189189
],
@@ -199,8 +199,8 @@ cc_library(
199199
"//tensorflow/lite:schema_fbs_version",
200200
"//tensorflow/lite/c:common",
201201
"//tensorflow/lite/kernels:builtin_ops",
202+
"//tensorflow/lite/schema:schema_conversion_utils",
202203
"//tensorflow/lite/schema:schema_fbs",
203-
"//tensorflow/lite/schema:schema_utils",
204204
"@FP16",
205205
"@com_google_googletest//:gtest",
206206
"@flatbuffers",
@@ -217,8 +217,8 @@ cc_library(
217217
"//tensorflow/lite:schema_fbs_version",
218218
"//tensorflow/lite/c:common",
219219
"//tensorflow/lite/kernels:builtin_ops",
220+
"//tensorflow/lite/schema:schema_conversion_utils",
220221
"//tensorflow/lite/schema:schema_fbs",
221-
"//tensorflow/lite/schema:schema_utils",
222222
"@com_google_googletest//:gtest",
223223
"@flatbuffers",
224224
],
@@ -234,8 +234,8 @@ cc_library(
234234
"//tensorflow/lite:schema_fbs_version",
235235
"//tensorflow/lite/c:common",
236236
"//tensorflow/lite/kernels:builtin_ops",
237+
"//tensorflow/lite/schema:schema_conversion_utils",
237238
"//tensorflow/lite/schema:schema_fbs",
238-
"//tensorflow/lite/schema:schema_utils",
239239
"@com_google_googletest//:gtest",
240240
"@flatbuffers",
241241
],
@@ -251,8 +251,8 @@ cc_library(
251251
"//tensorflow/lite:schema_fbs_version",
252252
"//tensorflow/lite/c:common",
253253
"//tensorflow/lite/kernels:builtin_ops",
254+
"//tensorflow/lite/schema:schema_conversion_utils",
254255
"//tensorflow/lite/schema:schema_fbs",
255-
"//tensorflow/lite/schema:schema_utils",
256256
"@com_google_googletest//:gtest",
257257
"@flatbuffers",
258258
],
@@ -268,8 +268,8 @@ cc_library(
268268
"//tensorflow/lite:schema_fbs_version",
269269
"//tensorflow/lite/c:common",
270270
"//tensorflow/lite/kernels:builtin_ops",
271+
"//tensorflow/lite/schema:schema_conversion_utils",
271272
"//tensorflow/lite/schema:schema_fbs",
272-
"//tensorflow/lite/schema:schema_utils",
273273
"@com_google_googletest//:gtest",
274274
"@flatbuffers",
275275
],
@@ -285,8 +285,8 @@ cc_library(
285285
"//tensorflow/lite:schema_fbs_version",
286286
"//tensorflow/lite/c:common",
287287
"//tensorflow/lite/kernels:builtin_ops",
288+
"//tensorflow/lite/schema:schema_conversion_utils",
288289
"//tensorflow/lite/schema:schema_fbs",
289-
"//tensorflow/lite/schema:schema_utils",
290290
"@com_google_googletest//:gtest",
291291
"@flatbuffers",
292292
],

tensorflow/lite/delegates/xnnpack/binary_elementwise_tester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ limitations under the License.
2828
#include "tensorflow/lite/interpreter.h"
2929
#include "tensorflow/lite/kernels/register.h"
3030
#include "tensorflow/lite/model.h"
31+
#include "tensorflow/lite/schema/schema_conversion_utils.h"
3132
#include "tensorflow/lite/schema/schema_generated.h"
32-
#include "tensorflow/lite/schema/schema_utils.h"
3333
#include "tensorflow/lite/version.h"
3434

3535
namespace tflite {

tensorflow/lite/delegates/xnnpack/conv_2d_tester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ limitations under the License.
2727
#include "tensorflow/lite/interpreter.h"
2828
#include "tensorflow/lite/kernels/register.h"
2929
#include "tensorflow/lite/model.h"
30+
#include "tensorflow/lite/schema/schema_conversion_utils.h"
3031
#include "tensorflow/lite/schema/schema_generated.h"
31-
#include "tensorflow/lite/schema/schema_utils.h"
3232
#include "tensorflow/lite/version.h"
3333

3434
namespace tflite {

tensorflow/lite/delegates/xnnpack/depthwise_conv_2d_tester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ limitations under the License.
2727
#include "tensorflow/lite/interpreter.h"
2828
#include "tensorflow/lite/kernels/register.h"
2929
#include "tensorflow/lite/model.h"
30+
#include "tensorflow/lite/schema/schema_conversion_utils.h"
3031
#include "tensorflow/lite/schema/schema_generated.h"
31-
#include "tensorflow/lite/schema/schema_utils.h"
3232
#include "tensorflow/lite/version.h"
3333

3434
namespace tflite {

0 commit comments

Comments
 (0)