Skip to content

Commit f433601

Browse files
committed
Automated Code Change
PiperOrigin-RevId: 867127954
1 parent 4f68d0b commit f433601

7 files changed

Lines changed: 69 additions & 98 deletions

File tree

build_common.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,6 @@ function install_tensorflow() {
6262
"${PYTHON_BIN_PATH}" -c 'import tensorflow as tf; print(tf.version.VERSION)'
6363
}
6464

65-
function build_dynamic_libraries() {
66-
# Explicitly build the dynamic library targets that are needed for the wheel.
67-
# These are required by the stamp_wheel function.
68-
bazel build //struct2tensor/ops:_decode_proto_map_op.so || exit 1;
69-
bazel build //struct2tensor/ops:_decode_proto_sparse_op.so || exit 1;
70-
bazel build //struct2tensor/ops:_run_length_before_op.so || exit 1;
71-
bazel build //struct2tensor/ops:_equi_join_any_indices_op.so || exit 1;
72-
bazel build //struct2tensor/ops:_equi_join_indices_op.so || exit 1;
73-
bazel build //struct2tensor/ops:_parquet_dataset_op.so || exit 1;
74-
75-
RUNFILES_DIR=$(pwd)
76-
cp -f bazel-bin/struct2tensor/ops/*.so ${RUNFILES_DIR}/struct2tensor/ops/
77-
78-
}
79-
8065
set -x
8166

8267
for i in "$@"; do
@@ -131,8 +116,6 @@ if [[ ("${TF_VERSION}" == "NIGHTLY_TF") || ("${TF_VERSION}" == "NIGHTLY_TF_2") ]
131116

132117
fi
133118

134-
build_dynamic_libraries
135-
136119
# :build_pip_package builds and links struct2tensor ops against a TF
137120
# installation and packages the result dynamic libraries.
138121
bazel run -c opt \

struct2tensor/benchmarks/BUILD

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
# limitations under the License.
1414

1515
load("@rules_cc//cc:cc_test.bzl", "cc_test")
16-
load("//struct2tensor:struct2tensor.bzl", "py_proto_library")
16+
17+
# Placeholder: load py_proto_library
18+
# Placeholder: load py_binary
19+
# Placeholder: load py_library
20+
# Placeholder: load py_test
21+
load("//third_party/protobuf/bazel:proto_library.bzl", "proto_library")
22+
load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", "cc_proto_library")
1723

1824
licenses(["notice"])
1925

@@ -29,28 +35,26 @@ py_proto_library(
2935
deps = [":benchmark_proto"],
3036
)
3137

32-
# Use native cc_proto_library instead of custom macro since we already have proto_library defined
3338
cc_proto_library(
3439
name = "benchmark_cc_proto",
3540
deps = [":benchmark_proto"],
3641
)
3742

38-
# Google-internal benchmark - commented out for OSS
39-
# cc_test(
40-
# name = "serialization_benchmark",
41-
# srcs = ["serialization_benchmark.cc"],
42-
# deps = [
43-
# ":benchmark_cc_proto",
44-
# "//testing/base/public:gunit",
45-
# "@com_google_absl//absl/flags:flag",
46-
# "@com_google_absl//absl/flags:parse",
47-
# "@com_google_absl//absl/random",
48-
# "@com_google_absl//absl/random:distributions",
49-
# "@com_google_protobuf//:protobuf",
50-
# "@org_tensorflow//tensorflow/core:feature_util",
51-
# "@org_tensorflow//tensorflow/core:protos_all_cc",
52-
# ],
53-
# )
43+
cc_test(
44+
name = "serialization_benchmark",
45+
srcs = ["serialization_benchmark.cc"],
46+
deps = [
47+
":benchmark_cc_proto",
48+
"//testing/base/public:gunit",
49+
"@com_google_absl//absl/flags:flag",
50+
"@com_google_absl//absl/flags:parse",
51+
"@com_google_absl//absl/random",
52+
"@com_google_absl//absl/random:distributions",
53+
"@com_google_protobuf//:protobuf",
54+
"@org_tensorflow//tensorflow/core:feature_util",
55+
"@org_tensorflow//tensorflow/core:protos_all_cc",
56+
],
57+
)
5458

5559
py_library(
5660
name = "struct2tensor_benchmark_lib",
@@ -59,11 +63,10 @@ py_library(
5963
":benchmark_proto_py_pb2",
6064
":struct2tensor_benchmark_util",
6165
"//struct2tensor",
62-
# Google-internal dependencies - not available in OSS
63-
# "//testing/pybase",
64-
# "//testing/pybase:parameterized",
65-
# "//third_party/py/cpuinfo",
66-
# "//third_party/py/psutil",
66+
"//testing/pybase",
67+
"//testing/pybase:parameterized",
68+
"//third_party/py/cpuinfo",
69+
"//third_party/py/psutil",
6770
],
6871
)
6972

@@ -109,10 +112,9 @@ py_library(
109112
name = "struct2tensor_benchmark_util",
110113
srcs = ["struct2tensor_benchmark_util.py"],
111114
deps = [
112-
# Google-internal dependencies - not available in OSS
113-
# "//file/colossus/public:cns",
114-
# "//third_party/py/cpuinfo",
115-
# "//third_party/py/psutil",
115+
"//file/colossus/public:cns",
116+
"//third_party/py/cpuinfo",
117+
"//third_party/py/psutil",
116118
"@absl_py//absl/flags",
117119
"@absl_py//absl/testing:parameterized",
118120
],

struct2tensor/kernels/parquet/BUILD

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -99,40 +99,38 @@ cc_library(
9999
],
100100
)
101101

102-
# Test file parent_indices_builder_test.cc does not exist, commenting out
103-
# cc_test(
104-
# name = "parent_indices_builder_test",
105-
# srcs = ["parent_indices_builder_test.cc"],
106-
# deps = [
107-
# ":parent_indices_builder_lib",
108-
# "@com_google_googletest//:gtest_main", # Replaces Google-internal //testing/base/public:gunit_main
109-
# "@org_tensorflow//tensorflow/core:lib",
110-
# "@org_tensorflow//tensorflow/core:test",
111-
# ],
112-
# )
102+
cc_test(
103+
name = "parent_indices_builder_test",
104+
srcs = ["parent_indices_builder_test.cc"],
105+
deps = [
106+
":parent_indices_builder_lib",
107+
"//testing/base/public:gunit_main",
108+
"@org_tensorflow//tensorflow/core:lib",
109+
"@org_tensorflow//tensorflow/core:test",
110+
],
111+
)
113112

114-
# Test file parquet_reader_test.cc does not exist, commenting out
115-
# cc_test(
116-
# name = "parquet_reader_test",
117-
# srcs = ["parquet_reader_test.cc"],
118-
# data = [
119-
# "//struct2tensor/testdata/parquet_testdata",
120-
# ],
121-
# deps = [
122-
# ":parquet_reader_lib",
123-
# "@com_google_googletest//:gtest_main", # Replaces Google-internal //testing/base/public:gunit_main
124-
# "@org_tensorflow//tensorflow/core:framework",
125-
# ],
126-
# )
127-
# Test file parquet_reader_util_test.cc does not exist, commenting out
128-
# cc_test(
129-
# name = "parquet_reader_util_test",
130-
# srcs = ["parquet_reader_util_test.cc"],
131-
# data = [
132-
# "//struct2tensor/testdata/parquet_testdata",
133-
# ],
134-
# deps = [
135-
# ":parquet_reader_util_lib",
136-
# "@com_google_googletest//:gtest_main", # Replaces Google-internal //testing/base/public:gunit_main
137-
# ],
138-
# )
113+
cc_test(
114+
name = "parquet_reader_test",
115+
srcs = ["parquet_reader_test.cc"],
116+
data = [
117+
"//struct2tensor/testdata/parquet_testdata",
118+
],
119+
deps = [
120+
":parquet_reader_lib",
121+
"//testing/base/public:gunit_main",
122+
"@org_tensorflow//tensorflow/core:framework",
123+
],
124+
)
125+
126+
cc_test(
127+
name = "parquet_reader_util_test",
128+
srcs = ["parquet_reader_util_test.cc"],
129+
data = [
130+
"//struct2tensor/testdata/parquet_testdata",
131+
],
132+
deps = [
133+
":parquet_reader_util_lib",
134+
"//testing/base/public:gunit_main",
135+
],
136+
)

struct2tensor/struct2tensor.bzl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,3 @@ def s2t_proto_library_py(name, proto_library, srcs = [], deps = [], oss_deps = [
181181
visibility = visibility,
182182
testonly = testonly,
183183
)
184-
185-
def py_proto_library(name, deps, visibility = None, **kwargs):
186-
"""Simple wrapper for py_proto_library using custom rule.
187-
188-
This macro provides OSS compatibility for py_proto_library targets.
189-
"""
190-
_py_proto_library_rule(
191-
name = name,
192-
deps = deps,
193-
visibility = visibility,
194-
**kwargs
195-
)

struct2tensor/test/test_any.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ syntax = "proto3";
1616

1717
package struct2tensor.test;
1818

19-
import "struct2tensor/test/any.proto";
19+
import "google/protobuf/any.proto";
2020

2121
message MessageWithAny {
2222
google.protobuf.Any my_any = 1;

struct2tensor/tools/BUILD

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ py_library(
2727
deps = [
2828
"//struct2tensor",
2929
"//struct2tensor:struct2tensor_expression_impl",
30-
# Google-internal dependencies - not available in OSS
31-
# "//third_party/py/absl:app",
32-
# "//third_party/py/tensorflow_docs/api_generator:generate_lib",
33-
# "//third_party/py/tensorflow_docs/api_generator:public_api",
34-
# "//third_party/py/yaml",
30+
"//third_party/py/absl:app",
31+
"//third_party/py/tensorflow_docs/api_generator:generate_lib",
32+
"//third_party/py/tensorflow_docs/api_generator:public_api",
33+
"//third_party/py/yaml",
3534
"@absl_py//absl/flags",
3635
],
3736
)

struct2tensor/tools/docker_build/build_manylinux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,4 @@ set -x
117117
setup_environment && \
118118
bazel_build && \
119119
stamp_wheel
120+

0 commit comments

Comments
 (0)