Skip to content

Commit 6c902f1

Browse files
committed
Missed one
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
1 parent a886d69 commit 6c902f1

File tree

1 file changed

+216
-0
lines changed
  • tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api

1 file changed

+216
-0
lines changed
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE
2+
3+
package org.tensorflow.internal.c_api;
4+
5+
import java.nio.*;
6+
import org.bytedeco.javacpp.*;
7+
import org.bytedeco.javacpp.annotation.*;
8+
9+
import static org.tensorflow.internal.c_api.global.tensorflow.*;
10+
11+
12+
/** \addtogroup core
13+
* \{
14+
<p>
15+
* A {@code Scope} object represents a set of related TensorFlow ops that have the
16+
* same properties such as a common name prefix.
17+
*
18+
* A Scope object is a container for TensorFlow Op properties. Op constructors
19+
* get a Scope object as a mandatory first argument and the constructed op
20+
* acquires the properties in the object.
21+
*
22+
* A simple example:
23+
*
24+
* using namespace ops;
25+
* Scope root = Scope::NewRootScope();
26+
* auto c1 = Const(root, { {1, 1} });
27+
* auto m = MatMul(root, c1, { {41}, {1} });
28+
* GraphDef gdef;
29+
* Status s = root.ToGraphDef(&gdef);
30+
* if (!s.ok()) { ... }
31+
*
32+
* Scope hierarchy:
33+
*
34+
* The Scope class provides various With<> functions that create a new scope.
35+
* The new scope typically has one property changed while other properties are
36+
* inherited from the parent scope.
37+
* NewSubScope(name) method appends {@code name} to the prefix of names for ops
38+
* created within the scope, and WithOpName() changes the suffix which
39+
* otherwise defaults to the type of the op.
40+
*
41+
* Name examples:
42+
*
43+
* Scope root = Scope::NewRootScope();
44+
* Scope linear = root.NewSubScope("linear");
45+
* // W will be named "linear/W"
46+
* auto W = Variable(linear.WithOpName("W"),
47+
* {2, 2}, DT_FLOAT);
48+
* // b will be named "linear/b_3"
49+
* int idx = 3;
50+
* auto b = Variable(linear.WithOpName("b_", idx),
51+
* {2}, DT_FLOAT);
52+
* auto x = Const(linear, {...}); // name: "linear/Const"
53+
* auto m = MatMul(linear, x, W); // name: "linear/MatMul"
54+
* auto r = BiasAdd(linear, m, b); // name: "linear/BiasAdd"
55+
*
56+
* Scope lifetime:
57+
*
58+
* A new scope is created by calling Scope::NewRootScope. This creates some
59+
* resources that are shared by all the child scopes that inherit from this
60+
* scope, directly or transitively. For instance, a new scope creates a new
61+
* Graph object to which operations are added when the new scope or its
62+
* children are used by an Op constructor. The new scope also has a Status
63+
* object which will be used to indicate errors by Op-constructor functions
64+
* called on any child scope. The Op-constructor functions have to check the
65+
* scope's status by calling the ok() method before proceeding to construct the
66+
* op.
67+
*
68+
* Thread safety:
69+
*
70+
* A {@code Scope} object is NOT thread-safe. Threads cannot concurrently call
71+
* op-constructor functions on the same {@code Scope} object. */
72+
@Name("tensorflow::Scope") @NoOffset @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class)
73+
public class TF_Scope extends Pointer {
74+
static { Loader.load(); }
75+
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
76+
public TF_Scope(Pointer p) { super(p); }
77+
78+
public TF_Scope(@Const @ByRef TF_Scope other) { super((Pointer)null); allocate(other); }
79+
private native void allocate(@Const @ByRef TF_Scope other);
80+
public native @ByRef @Name("operator =") TF_Scope put(@Const @ByRef TF_Scope other);
81+
82+
// The following functions are for users making graphs. They return brand new
83+
// scopes, or scopes derived from an existing scope object.
84+
85+
/** Return a new scope.
86+
* This creates a new graph and all operations constructed in this graph
87+
* should use the returned object as the "root" scope. */
88+
public static native @ByVal TF_Scope NewRootScope();
89+
90+
/** Return a new scope. Ops created with this scope will have
91+
* {@code name/child_scope_name} as the prefix. The actual name will be unique
92+
* in the current scope. All other properties are inherited from the current
93+
* scope. If {@code child_scope_name} is empty, the {@code /} is elided. */
94+
public native @ByVal TF_Scope NewSubScope(BytePointer child_scope_name);
95+
public native @ByVal TF_Scope NewSubScope(String child_scope_name);
96+
97+
/** Return a new scope. All ops created within the returned scope will have
98+
* names of the form {@code name/StrCat(fragments...)[_suffix]} */
99+
100+
/** Return a new scope. All ops created within the returned scope will have as
101+
* control dependencies the union of operations in the control_deps vector
102+
* and the control dependencies of the current scope. */
103+
public native @ByVal TF_Scope WithControlDependencies(
104+
@StdVector TF_Operation control_deps);
105+
/** Same as above, but convenient to add control dependency on the operation
106+
* producing the control_dep output. */
107+
public native @ByVal TF_Scope WithControlDependencies(@Const @ByRef TF_Output control_dep);
108+
109+
/** Return a new scope. All ops created within the returned scope will have no
110+
* control dependencies on other operations. */
111+
public native @ByVal TF_Scope WithNoControlDependencies();
112+
113+
/** Return a new scope. All ops created within the returned scope will have
114+
* the device field set to 'device'. */
115+
public native @ByVal TF_Scope WithDevice(BytePointer device);
116+
public native @ByVal TF_Scope WithDevice(String device);
117+
118+
/** Returns a new scope. All ops created within the returned scope will have
119+
* their assigned device set to {@code assigned_device}. */
120+
121+
122+
/** Returns a new scope. All ops created within the returned scope will have
123+
* their _XlaCluster attribute set to {@code xla_cluster}. */
124+
125+
126+
/** Return a new scope. All ops created within the returned scope will be
127+
* co-located on the device where op is placed.
128+
* NOTE: This function is intended to be use internal libraries only for
129+
* controlling placement of ops on to devices. Public use is not encouraged
130+
* because the implementation of device placement is subject to change. */
131+
132+
/** Convenience function for above. */
133+
134+
/** Clear all colocation constraints. */
135+
136+
137+
/** Return a new scope. The op-constructor functions taking the returned scope
138+
* as the scope argument will exit as soon as an error is detected, instead
139+
* of setting the status on the scope. */
140+
public native @ByVal TF_Scope ExitOnError();
141+
142+
/** Return a new scope. All ops created with the new scope will have
143+
* kernel_label as the value for their '_kernel' attribute; */
144+
145+
146+
// The following functions are for scope object consumers.
147+
148+
/** Return a unique name, using default_name if an op name has not been
149+
* specified. */
150+
public native BytePointer GetUniqueNameForOp(BytePointer default_name);
151+
public native String GetUniqueNameForOp(String default_name);
152+
153+
/** Update the status on this scope.
154+
* Note: The status object is shared between all children of this scope.
155+
* If the resulting status is not Status::OK() and exit_on_error_ is set on
156+
* this scope, this function exits by calling LOG(FATAL). */
157+
public native void UpdateStatus(@Const @ByRef TF_Status s);
158+
159+
// START_SKIP_DOXYGEN
160+
161+
/** Update the builder with properties accumulated in this scope. Does not set
162+
* status(). */
163+
// TODO(skyewm): NodeBuilder is not part of public API
164+
public native void UpdateBuilder(TF_OperationDescription builder);
165+
// END_SKIP_DOXYGEN
166+
167+
public native @Cast("bool") boolean ok();
168+
169+
// TODO(skyewm): Graph is not part of public API
170+
171+
172+
// TODO(skyewm): Graph is not part of public API
173+
174+
175+
public native @ByVal TF_Status status();
176+
177+
/** If status() is Status::OK(), convert the Graph object stored in this scope
178+
* to a GraphDef proto and return Status::OK(). Otherwise, return the error
179+
* status as is without performing GraphDef conversion. */
180+
181+
182+
// START_SKIP_DOXYGEN
183+
184+
/** If status() is Status::OK(), construct a Graph object using {@code opts} as the
185+
* GraphConstructorOptions, and return Status::OK if graph construction was
186+
* successful. Otherwise, return the error status. */
187+
// TODO(josh11b, keveman): Make this faster; right now it converts
188+
// Graph->GraphDef->Graph. This cleans up the graph (e.g. adds
189+
// edges from the source and to the sink node, resolves back edges
190+
// by name), and makes sure the resulting graph is valid.
191+
192+
193+
// Calls AddNode() using this scope's ShapeRefiner. This exists in the public
194+
// API to prevent custom op wrappers from needing access to shape_refiner.h or
195+
// scope_internal.h.
196+
// TODO(skyewm): remove this from public API
197+
198+
199+
// Creates a new root scope that causes all DoShapeInference() calls to return
200+
// Status::OK() (on the returned scope and any subscopes). Used for testing.
201+
// TODO(skyewm): fix tests that still require this and eventually remove, or
202+
// at least remove from public API
203+
204+
// END_SKIP_DOXYGEN
205+
206+
207+
208+
// START_SKIP_DOXYGEN
209+
@Opaque public static class Impl extends Pointer {
210+
/** Empty constructor. Calls {@code super((Pointer)null)}. */
211+
public Impl() { super((Pointer)null); }
212+
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
213+
public Impl(Pointer p) { super(p); }
214+
}
215+
public native Impl impl();
216+
}

0 commit comments

Comments
 (0)