Skip to content

Use the Java Op generator #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion tensorflow-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<properties>
<!-- Match version used by TensorFlow, in tensorflow/workspace.bzl -->
<protobuf.version>3.8.0</protobuf.version>
<protobuf.version>3.9.2</protobuf.version>

<native.classifier>${javacpp.platform}${javacpp.platform.extension}</native.classifier>
<javacpp.build.skip>false</javacpp.build.skip> <!-- To skip execution of build.sh: -Djavacpp.build.skip=true -->
Expand Down
35 changes: 0 additions & 35 deletions tensorflow-core/tensorflow-core-api/BUILD
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
load("@org_tensorflow//tensorflow:tensorflow.bzl", "tf_copts", "tf_cc_binary")
load("@rules_java//java:defs.bzl", "java_proto_library")

tf_cc_binary(
name = "java_op_generator",
linkopts = select({
"@org_tensorflow//tensorflow:windows": [],
"//conditions:default": ["-lm"],
}),
deps = [
":java_op_gen_lib",
],
)

cc_library(
name = "java_op_gen_lib",
srcs = [
"src/bazel/op_generator/op_gen_main.cc",
"src/bazel/op_generator/op_generator.cc",
"src/bazel/op_generator/op_specs.cc",
"src/bazel/op_generator/source_writer.cc",
],
hdrs = [
"src/bazel/op_generator/java_defs.h",
"src/bazel/op_generator/op_generator.h",
"src/bazel/op_generator/op_specs.h",
"src/bazel/op_generator/source_writer.h",
],
copts = tf_copts(),
deps = [
"@org_tensorflow//tensorflow/core:framework",
"@org_tensorflow//tensorflow/core:lib",
"@org_tensorflow//tensorflow/core:op_gen_lib",
"@org_tensorflow//tensorflow/core:protos_all_cc",
"@com_googlesource_code_re2//:re2",
],
)

tf_cc_binary(
name = "java_op_exporter",
linkopts = select({
Expand Down
7 changes: 0 additions & 7 deletions tensorflow-core/tensorflow-core-api/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ bazel build $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \
@org_tensorflow//tensorflow:tensorflow_cc \
@org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate \
:java_proto_gen_sources \
:java_op_generator \
:java_op_exporter \
:java_api_import \
:custom_ops_test
Expand Down Expand Up @@ -80,12 +79,6 @@ fi
GEN_SRCS_DIR=src/gen/java
mkdir -p $GEN_SRCS_DIR

# Generate Java operator wrappers
$BAZEL_BIN/java_op_generator \
--output_dir=$GEN_SRCS_DIR \
--api_dirs=$BAZEL_SRCS/external/org_tensorflow/tensorflow/core/api_def/base_api,src/bazel/api_def \
$TENSORFLOW_LIB

GEN_RESOURCE_DIR=src/gen/resources/org/tensorflow/op
mkdir -p $GEN_RESOURCE_DIR

Expand Down
2 changes: 1 addition & 1 deletion tensorflow-core/tensorflow-core-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
<goals>
<goal>java</goal>
</goals>
<!-- <phase>generate-sources</phase>-->
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
Expand Down
286 changes: 0 additions & 286 deletions tensorflow-core/tensorflow-core-api/src/bazel/op_generator/java_defs.h

This file was deleted.

Loading