|
2 | 2 |
|
3 | 3 | package org.tensorflow.internal.c_api; |
4 | 4 |
|
5 | | -import org.bytedeco.javacpp.BytePointer; |
6 | | -import org.bytedeco.javacpp.Loader; |
7 | | -import org.bytedeco.javacpp.Pointer; |
8 | | -import org.bytedeco.javacpp.annotation.ByRef; |
9 | | -import org.bytedeco.javacpp.annotation.ByVal; |
10 | | -import org.bytedeco.javacpp.annotation.Cast; |
11 | | -import org.bytedeco.javacpp.annotation.Const; |
12 | | -import org.bytedeco.javacpp.annotation.Name; |
13 | | -import org.bytedeco.javacpp.annotation.NoOffset; |
14 | | -import org.bytedeco.javacpp.annotation.Properties; |
15 | | -import org.bytedeco.javacpp.annotation.StdString; |
| 5 | +import java.nio.*; |
| 6 | +import org.bytedeco.javacpp.*; |
| 7 | +import org.bytedeco.javacpp.annotation.*; |
16 | 8 |
|
| 9 | +import static org.tensorflow.internal.c_api.global.tensorflow.*; |
17 | 10 |
|
18 | | -/** |
19 | | - * Represents a tensor value produced by an Operation. |
20 | | - */ |
21 | | -@Name("tensorflow::Output") |
22 | | -@NoOffset |
23 | | -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) |
24 | | -public class NativeOutput extends Pointer { |
25 | | - |
26 | | - static { |
27 | | - Loader.load(); |
28 | | - } |
29 | | - |
30 | | - /** |
31 | | - * Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. |
32 | | - */ |
33 | | - public NativeOutput(Pointer p) { |
34 | | - super(p); |
35 | | - } |
36 | | - |
37 | | - /** |
38 | | - * Native array allocator. Access with {@link Pointer#position(long)}. |
39 | | - */ |
40 | | - public NativeOutput(long size) { |
41 | | - super((Pointer) null); |
42 | | - allocateArray(size); |
43 | | - } |
44 | | - |
45 | | - private native void allocateArray(long size); |
46 | | - |
47 | | - @Override |
48 | | - public NativeOutput position(long position) { |
49 | | - return (NativeOutput) super.position(position); |
50 | | - } |
51 | | - |
52 | | - @Override |
53 | | - public NativeOutput getPointer(long i) { |
54 | | - return new NativeOutput((Pointer) this).position(position + i); |
55 | | - } |
56 | | - |
57 | | - public NativeOutput() { |
58 | | - super((Pointer) null); |
59 | | - allocate(); |
60 | | - } |
61 | 11 |
|
| 12 | +/** Represents a tensor value produced by an Operation. */ |
| 13 | +@Name("tensorflow::Output") @NoOffset @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) |
| 14 | +public class NativeOutput extends Pointer { |
| 15 | + static { Loader.load(); } |
| 16 | + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ |
| 17 | + public NativeOutput(Pointer p) { super(p); } |
| 18 | + /** Native array allocator. Access with {@link Pointer#position(long)}. */ |
| 19 | + public NativeOutput(long size) { super((Pointer)null); allocateArray(size); } |
| 20 | + private native void allocateArray(long size); |
| 21 | + @Override public NativeOutput position(long position) { |
| 22 | + return (NativeOutput)super.position(position); |
| 23 | + } |
| 24 | + @Override public NativeOutput getPointer(long i) { |
| 25 | + return new NativeOutput((Pointer)this).position(position + i); |
| 26 | + } |
| 27 | + |
| 28 | + public NativeOutput() { super((Pointer)null); allocate(); } |
62 | 29 | private native void allocate(); |
63 | | - |
64 | | - public NativeOutput(Node n) { |
65 | | - super((Pointer) null); |
66 | | - allocate(n); |
67 | | - } |
68 | | - |
| 30 | + public NativeOutput(Node n) { super((Pointer)null); allocate(n); } |
69 | 31 | private native void allocate(Node n); |
70 | | - |
71 | | - public NativeOutput(Node n, @Cast("tensorflow::int32") int index) { |
72 | | - super((Pointer) null); |
73 | | - allocate(n, index); |
74 | | - } |
75 | | - |
| 32 | + public NativeOutput(Node n, @Cast("tensorflow::int32") int index) { super((Pointer)null); allocate(n, index); } |
76 | 33 | private native void allocate(Node n, @Cast("tensorflow::int32") int index); |
| 34 | + public NativeOutput(@Const @ByRef NativeOperation op, @Cast("tensorflow::int32") int index) { super((Pointer)null); allocate(op, index); } |
| 35 | + private native void allocate(@Const @ByRef NativeOperation op, @Cast("tensorflow::int32") int index); |
77 | 36 |
|
78 | | - public NativeOutput(@Const @ByRef NativeOperation op, @Cast("tensorflow::int32") int index) { |
79 | | - super((Pointer) null); |
80 | | - allocate(op, index); |
81 | | - } |
82 | | - |
83 | | - private native void allocate(@Const @ByRef NativeOperation op, |
84 | | - @Cast("tensorflow::int32") int index); |
85 | | - |
86 | | - public native @ByVal |
87 | | - NativeOperation op(); |
88 | | - |
| 37 | + public native @ByVal NativeOperation op(); |
89 | 38 | public native Node node(); |
| 39 | + public native @Cast("tensorflow::int32") int index(); |
| 40 | + |
| 41 | + public native @StdString BytePointer name(); |
| 42 | + public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef NativeOutput other); |
90 | 43 |
|
91 | | - public native @Cast("tensorflow::int32") |
92 | | - int index(); |
93 | | - |
94 | | - public native @StdString |
95 | | - BytePointer name(); |
96 | | - |
97 | | - public native @Cast("bool") |
98 | | - @Name("operator ==") |
99 | | - boolean equals(@Const @ByRef NativeOutput other); |
100 | | - |
101 | | - |
| 44 | + |
102 | 45 | } |
0 commit comments