Skip to content

Refactor modules and integrate JavaCPP to map the C API #1

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 9 commits into from
Oct 4, 2019
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
  •  
  •  
  •  
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ migrated from Bazel to Maven, which is more familiar for most Java developers.

The following describes the layout of the repository and its different artifacts:

* `core`
* `tensorflow-core`
* All artifacts that build up the core language bindings of TensorFlow for Java.
* Those artifacts provide the minimal support required to use the TensorFlow runtime on a JVM.

* `utils`
* `tensorflow-utils`
* Utility libraries that do not depend on the TensorFlow runtime but are useful for machine learning purposes

* `frameworks`
* `tensorflow-frameworks`
* High-level APIs built on top of the core libraries for simplifying the usage of TensorFlow in Java.

* `starters`
* `tensorflow-starters`
* Artifacts aggregating others for simplifying dependency management with TensorFlow

*Note: Right now, only the `core` component is present*
*Note: Right now, only the `tensorflow-core` component is present*

## Building Sources

Expand All @@ -48,26 +48,27 @@ Note that in some cases, if a version of the TensorFlow runtime library is not f
this process will fetch TensorFlow sources and trigger a build of all the native code (which can take
many hours on a standard laptop). In this case, you will also need to have a valid environment for building
TensorFlow, including the [bazel](https://bazel.build/) build tool and a few python dependencies. Please
read [TensorFlow documentation](https://www.tensorflow.org/install) for more details.
read [TensorFlow documentation](https://www.tensorflow.org/install/source) for more details.

## Using Maven Artifacts

To include TensorFlow in your Maven application, you first need to add a dependency on both
`tensorflow-core` and `tensorflow-core-native` artifacts. The later could be included multiple times
for different targeted systems by their classifiers.
To include TensorFlow in your Maven application, you first need to add a dependency on either the
`tensorflow-core` or `tensorflow-core-platform` artifacts. The former could be included multiple times
for different targeted systems by their classifiers, while the later includes them as dependencies for
`linux-x86_64`, `macosx-x86_64`, and `windows-x86_64`, with more to come in the future.

For example, for building a JAR that uses TensorFlow and is targeted to be deployed only on Linux
systems, you should add the following dependencies:
```xml
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core</artifactId>
<version>2.0.0-SNAPSHOT</version>
<artifactId>tensorflow-core-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-native</artifactId>
<version>2.0.0-SNAPSHOT</version>
<artifactId>tensorflow-core-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>linux-x86_64</classifier>
</dependency>
```
Expand All @@ -77,45 +78,45 @@ native dependencies as follows:
```xml
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core</artifactId>
<version>2.0.0-SNAPSHOT</version>
<artifactId>tensorflow-core-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-native</artifactId>
<version>2.0.0-SNAPSHOT</version>
<artifactId>tensorflow-core-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-native</artifactId>
<version>2.0.0-SNAPSHOT</version>
<classifier>windows-x86_64</classifier>
<artifactId>tensorflow-core-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>macosx-x86_64</classifier>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-native</artifactId>
<version>2.0.0-SNAPSHOT</version>
<classifier>darwin-x86_64</classifier>
<artifactId>tensorflow-core-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>windows-x86_64</classifier>
</dependency>
```

In some cases, pre-configured starter artifacts can help to automatically include all versions of
the native library for a given configuration. For example, the `tensorflow` artifact includes
the native library for a given configuration. For example, the `tensorflow-core-platform` artifact includes
transitively all the artifacts above as a single dependency:
```xml
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow</artifactId>
<version>2.0.0-SNAPSHOT</version>
<artifactId>tensorflow-core-platform</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
```

Be aware though that the native library is quite large and including too many versions of it may
significantly increase the size of your JAR. So it is good practice to limit your dependencies to
the platforms you are targeting.

*Note: the `tensorflow` starter artifact is not available at this moment*
*Note: the `tensorflow-starters` artifact is not available at this moment*

## How to Contribute?

Expand Down
82 changes: 0 additions & 82 deletions core/pom.xml

This file was deleted.

67 changes: 0 additions & 67 deletions core/tensorflow-core-native/BUILD

This file was deleted.

42 changes: 0 additions & 42 deletions core/tensorflow-core-native/WORKSPACE

This file was deleted.

3 changes: 0 additions & 3 deletions core/tensorflow-core-native/config/exported_symbols.lds

This file was deleted.

11 changes: 0 additions & 11 deletions core/tensorflow-core-native/config/version_script.lds

This file was deleted.

Loading