You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATING.md
+50
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,56 @@
3
3
TensorFlow Java is still in an alpha stage, therefore is subject to contain breaking changes between the different releases. This guide explain in detail
4
4
how to migrate your code from a previous version to a new one that includes some changes that are not backward compatible.
5
5
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.
0 commit comments