Skip to content

Commit b6d4d5a

Browse files
committed
Update migrating instructions
1 parent 13ce91b commit b6d4d5a

File tree

10 files changed

+68
-18
lines changed

10 files changed

+68
-18
lines changed

MIGRATING.md

+50
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

+8-8
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ systems with no GPU support, you should add the following dependencies:
6868
<dependency>
6969
<groupId>org.tensorflow</groupId>
7070
<artifactId>tensorflow-core-api</artifactId>
71-
<version>1.0.0-rc1</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>1.0.0-rc1</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>1.0.0-rc1</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>1.0.0-rc1</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>1.0.0-rc1</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>1.0.0-rc1</version>
104+
<version>1.0.0-rc.1</version>
105105
<classifier>windows-x86_64</classifier>
106106
</dependency>
107107
```
@@ -122,7 +122,7 @@ simply add this dependency to your application:
122122
<dependency>
123123
<groupId>org.tensorflow</groupId>
124124
<artifactId>tensorflow-core-platform</artifactId>
125-
<version>1.0.0-rc1</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-
| 1.0.0-rc1 | 2.16.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

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ For example,
5858
<dependency>
5959
<groupId>org.tensorflow</groupId>
6060
<artifactId>tensorflow-core-platform</artifactId>
61-
<version>1.0.0-rc1</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: '1.0.0-rc1'
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>1.0.0-rc1</version>
167+
<version>1.0.0-rc.1</version>
168168
</dependency>
169169
</dependencies>
170170
</project>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>org.tensorflow</groupId>
99
<artifactId>tensorflow-java</artifactId>
10-
<version>1.0.0-rc1</version>
10+
<version>1.0.0-rc.1</version>
1111
<packaging>pom</packaging>
1212

1313
<name>TensorFlow Java Parent</name>

tensorflow-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.tensorflow</groupId>
2424
<artifactId>tensorflow-java</artifactId>
25-
<version>1.0.0-rc1</version>
25+
<version>1.0.0-rc.1</version>
2626
</parent>
2727
<artifactId>tensorflow-core</artifactId>
2828
<packaging>pom</packaging>

tensorflow-core/tensorflow-core-api/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.tensorflow</groupId>
88
<artifactId>tensorflow-core</artifactId>
9-
<version>1.0.0-rc1</version>
9+
<version>1.0.0-rc.1</version>
1010
</parent>
1111
<artifactId>tensorflow-core-api</artifactId>
1212
<packaging>jar</packaging>

tensorflow-core/tensorflow-core-generator/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.tensorflow</groupId>
77
<artifactId>tensorflow-core</artifactId>
8-
<version>1.0.0-rc1</version>
8+
<version>1.0.0-rc.1</version>
99
</parent>
1010
<artifactId>tensorflow-core-generator</artifactId>
1111
<packaging>jar</packaging>

tensorflow-core/tensorflow-core-native/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.tensorflow</groupId>
88
<artifactId>tensorflow-core</artifactId>
9-
<version>1.0.0-rc1</version>
9+
<version>1.0.0-rc.1</version>
1010
</parent>
1111
<artifactId>tensorflow-core-native</artifactId>
1212
<packaging>jar</packaging>

tensorflow-core/tensorflow-core-platform/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.tensorflow</groupId>
2424
<artifactId>tensorflow-core</artifactId>
25-
<version>1.0.0-rc1</version>
25+
<version>1.0.0-rc.1</version>
2626
</parent>
2727
<artifactId>tensorflow-core-platform</artifactId>
2828
<name>TensorFlow API Platform</name>

tensorflow-framework/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.tensorflow</groupId>
2424
<artifactId>tensorflow-java</artifactId>
25-
<version>1.0.0-rc1</version>
25+
<version>1.0.0-rc.1</version>
2626
</parent>
2727
<artifactId>tensorflow-framework</artifactId>
2828
<packaging>jar</packaging>

0 commit comments

Comments
 (0)