1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
package(default_visibility = [
"//visibility:public",
])
licenses(["notice"]) # Apache 2.0
load("//tensorflow:tensorflow.bzl", "py_test")
load("//tensorflow/contrib/lite:special_rules.bzl", "tflite_portable_test_suite")
py_binary(
name = "upgrade_schema",
srcs = [
"upgrade_schema.py",
],
data = [
"schema_v0.fbs",
"schema_v1.fbs",
"schema_v2.fbs",
"schema_v3.fbs",
"@flatbuffers//:flatc",
],
deps = [
"//tensorflow:tensorflow_py",
"//tensorflow/python:platform",
],
)
# TODO(wvo): re-enable this test once latest FlatBuffers has landed.
py_test(
name = "upgrade_schema_test",
size = "small",
srcs = ["upgrade_schema_test.py"],
srcs_version = "PY2AND3",
tags = [
"manual",
"no_oss",
"no_pip",
"notap",
],
deps = [
":upgrade_schema",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_test_lib",
],
)
exports_files([
"schema_v0.fbs",
"schema_v1.fbs",
"schema_v2.fbs",
"schema_v3.fbs",
])
load("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
# Generic schema for inference on device.
flatbuffer_cc_library(
name = "schema_fbs",
srcs = ["schema.fbs"],
)
# Generic schema for inference on device (but with reflections makes bigger).
flatbuffer_cc_library(
name = "schema_fbs_with_reflection",
srcs = ["schema.fbs"],
flatc_args = [
"--reflect-types",
"--reflect-names",
"--no-union-value-namespacing",
"--gen-object-api",
],
gen_reflections = True,
out_prefix = "reflection/",
)
# Schema test to make sure we don't introduce backward incompatible changes
# to schemas.
cc_test(
name = "flatbuffer_compatibility_test",
size = "small",
srcs = ["flatbuffer_compatibility_test.cc"],
data = [
"schema.fbs",
"schema_v3.fbs",
],
tags = [
"no_oss",
"tflite_not_portable_android",
"tflite_not_portable_ios",
],
deps = [
"//tensorflow/core:lib_platform",
"@com_google_googletest//:gtest",
"@flatbuffers//:flatc_library",
],
)
tflite_portable_test_suite()
|