-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSavedModelBundle.java
45 lines (35 loc) · 1.09 KB
/
SavedModelBundle.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package org.tensorflow;
public class SavedModelBundle implements AutoCloseable {
private final Graph graph;
private final byte[] metaGraphDef;
private final Session session;
private static native SavedModelBundle load(String str, String[] strArr, byte[] bArr);
public static SavedModelBundle load(String str, String... strArr) {
return load(str, strArr, null);
}
public byte[] metaGraphDef() {
return this.metaGraphDef;
}
public Graph graph() {
return this.graph;
}
public Session session() {
return this.session;
}
public void close() {
this.session.close();
this.graph.close();
}
private SavedModelBundle(Graph graph, Session session, byte[] bArr) {
this.graph = graph;
this.session = session;
this.metaGraphDef = bArr;
}
private static SavedModelBundle fromHandle(long j, long j2, byte[] bArr) {
Graph graph = new Graph(j);
return new SavedModelBundle(graph, new Session(graph, j2), bArr);
}
static {
TensorFlow.init();
}
}