Skip to content

Commit 87fcbec

Browse files
karllessardCraigacp
authored andcommitted
Merge doc changes from r1.0
1 parent b0b8ef5 commit 87fcbec

File tree

3 files changed

+67
-17
lines changed

3 files changed

+67
-17
lines changed

MIGRATING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,56 @@
33
TensorFlow Java is still in an alpha stage, therefore is subject to contain breaking changes between the different releases. This guide explain in detail
44
how to migrate your code from a previous version to a new one that includes some changes that are not backward compatible.
55

6+
## Migrating to 1.0.0
7+
8+
TensorFlow-Java 1.0.0 requires Java 11 or later.
9+
10+
### Native Artifact Renaming
11+
12+
The native artifacts, that used to be distributed as `tensorflow-core-api`, are now distributed under `tensorflow-core-native`. If you still add
13+
`tensorflow-core-platform` in your project, that won't affect you. But if you were adding dependencies to specific native runtimes, you need to update
14+
them to reflect the new artifact name.
15+
16+
For example,
17+
```xml
18+
<dependency>
19+
<groupId>org.tensorflow</groupId>
20+
<artifactId>tensorflow-core-api</artifactId>
21+
<version>0.5.0</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.tensorflow</groupId>
25+
<artifactId>tensorflow-core-api</artifactId>
26+
<version>0.5.0</version>
27+
<classifier>linux-x86_64</classifier>
28+
</dependency>
29+
```
30+
will now be
31+
```xml
32+
<dependency>
33+
<groupId>org.tensorflow</groupId>
34+
<artifactId>tensorflow-core-api</artifactId>
35+
<version>1.0.0</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.tensorflow</groupId>
39+
<artifactId>tensorflow-core-native</artifactId>
40+
<version>1.0.0</version>
41+
<classifier>linux-x86_64</classifier>
42+
</dependency>
43+
```
44+
### Session Run Result
45+
46+
In versions before 0.4.0 `Session.Runner.run` and `TensorFunction.call` returned a `List<Tensor>`. In newer versions
47+
they return a `Result` class which is `AutoCloseable` to make management of the tensor lifetime simpler. To migrate
48+
users should wrap the `run` invocation in a try-with-resources statement rather than closing the output tensors
49+
individually.
50+
51+
### Proto Definitions Moved
52+
53+
Some proto definitions under `org.tensorflow.proto` have been moved to a different location under the same package. You will need to reimport these
54+
proto bindings to match the new location. Your IDE should easily be able to do this for you.
55+
656
## Migrating to 0.3.0
757

858
### Non-parameterized Typed Tensors

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ restrictive.
5656
While TensorFlow Java can be compiled for [multiple platforms](https://github.com/tensorflow/java/blob/master/tensorflow-core/pom.xml#L54),
5757
only binaries for the followings are being **supported and distributed** by this project:
5858

59-
- `linux-x86_64`: Linux platforms on Intel chips
60-
- `linux-x86_64-gpu`: Linux platforms on Intel chips with Cuda GPU support
61-
- `macosx-x86_64`: MacOS X platforms on Intel chips
59+
- `linux-x86_64`: Linux platforms on Intel/AMD chips
60+
- `linux-x86_64-gpu`: Linux platforms on Intel/AMD chips with Cuda GPU support
61+
- `macosx-x86_64`: MacOS X platforms on Intel/AMD chips
6262
- `macosx-arm64`: MacOS X platforms on Apple Silicon chips
63-
- `windows-x86_64`: Windows platforms on Intel chips
63+
- `windows-x86_64`: Windows platforms on Intel/AMD chips
6464

6565
For example, for building a JAR that uses TensorFlow and is targeted to be deployed only on Linux
6666
systems with no GPU support, you should add the following dependencies:
6767
```xml
6868
<dependency>
6969
<groupId>org.tensorflow</groupId>
7070
<artifactId>tensorflow-core-api</artifactId>
71-
<version>0.5.0</version>
71+
<version>1.0.0-rc.1</version>
7272
</dependency>
7373
<dependency>
7474
<groupId>org.tensorflow</groupId>
7575
<artifactId>tensorflow-core-native</artifactId>
76-
<version>0.5.0</version>
76+
<version>1.0.0-rc.1</version>
7777
<classifier>linux-x86_64</classifier>
7878
</dependency>
7979
```
@@ -84,24 +84,24 @@ native dependencies as follows:
8484
<dependency>
8585
<groupId>org.tensorflow</groupId>
8686
<artifactId>tensorflow-core-api</artifactId>
87-
<version>0.5.0</version>
87+
<version>1.0.0-rc.1</version>
8888
</dependency>
8989
<dependency>
9090
<groupId>org.tensorflow</groupId>
9191
<artifactId>tensorflow-core-native</artifactId>
92-
<version>0.5.0</version>
92+
<version>1.0.0-rc.1</version>
9393
<classifier>linux-x86_64-gpu</classifier>
9494
</dependency>
9595
<dependency>
9696
<groupId>org.tensorflow</groupId>
9797
<artifactId>tensorflow-core-native</artifactId>
98-
<version>0.5.0</version>
98+
<version>1.0.0-rc.1</version>
9999
<classifier>macosx-arm64</classifier>
100100
</dependency>
101101
<dependency>
102102
<groupId>org.tensorflow</groupId>
103103
<artifactId>tensorflow-core-native</artifactId>
104-
<version>0.5.0</version>
104+
<version>1.0.0-rc.1</version>
105105
<classifier>windows-x86_64</classifier>
106106
</dependency>
107107
```
@@ -116,13 +116,13 @@ required to run TensorFlow Java on any [supported platforms](README.md#individua
116116

117117
- `tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `macosx-arm64`, `macosx-x86_64` and `windows-x86_64`
118118

119-
For example, to run TensorFlow Java on any platform for which a binary is being distributed by this project, you can
119+
For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can
120120
simply add this dependency to your application:
121121
```xml
122122
<dependency>
123123
<groupId>org.tensorflow</groupId>
124124
<artifactId>tensorflow-core-platform</artifactId>
125-
<version>0.5.0</version>
125+
<version>1.0.0-rc.1</version>
126126
</dependency>
127127
```
128128

@@ -172,7 +172,7 @@ This table shows the mapping between TensorFlow, TensorFlow Java and minimum sup
172172
| 0.4.1 | 2.7.1 | 8 |
173173
| 0.4.2 | 2.7.4 | 8 |
174174
| 0.5.0 | 2.10.1 | 11 |
175-
| 0.6.0-SNAPSHOT | 2.10.1 | 11 |
175+
| 1.0.0-rc.1 | 2.16.1 | 11 |
176176
| 1.0.0-SNAPSHOT | 2.16.1 | 11 |
177177

178178
## How to Contribute?

docs/install.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ following platforms:
2525

2626
## Versions
2727

28-
TensorFlow Java has its own release cycle, independent from the
28+
TensorFlow Java has its own release cycle, independent of the
2929
[TensorFlow runtime](https://github.com/tensorflow/tensorflow). Consequently,
3030
its version does not match the version of TensorFlow runtime it runs on. Consult
3131
the TensorFlow Java
@@ -58,7 +58,7 @@ For example,
5858
<dependency>
5959
<groupId>org.tensorflow</groupId>
6060
<artifactId>tensorflow-core-platform</artifactId>
61-
<version>0.5.0</version>
61+
<version>1.0.0-rc.1</version>
6262
</dependency>
6363
```
6464

@@ -118,7 +118,7 @@ repositories {
118118
}
119119
120120
dependencies {
121-
compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '0.5.0'
121+
compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0-rc.1'
122122
}
123123
```
124124

@@ -164,7 +164,7 @@ add the TensorFlow dependency to the project's `pom.xml` file:
164164
<dependency>
165165
<groupId>org.tensorflow</groupId>
166166
<artifactId>tensorflow-core-platform</artifactId>
167-
<version>0.5.0</version>
167+
<version>1.0.0-rc.1</version>
168168
</dependency>
169169
</dependencies>
170170
</project>

0 commit comments

Comments
 (0)