-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map experimental C (actually C++) API for gradient tape
- Loading branch information
Showing
88 changed files
with
2,504 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/AbstractContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE | ||
|
||
package org.tensorflow.internal.c_api; | ||
|
||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.tensorflow.internal.c_api.global.tensorflow.*; | ||
|
||
|
||
// Abstract interface to a context. | ||
// | ||
// This serves as a factory for creating `AbstractOperation`s and for | ||
// registering traced functions. | ||
// Operations creation within a context can only be executed in that context | ||
// (for now at least). | ||
// Implementations of the context may contain some state e.g. an execution | ||
// environment, a traced representation etc. | ||
@Namespace("tensorflow") @NoOffset @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) | ||
public class AbstractContext extends Pointer { | ||
static { Loader.load(); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public AbstractContext(Pointer p) { super(p); } | ||
|
||
public native int getKind(); | ||
|
||
// Release any underlying resources, including the interface object. | ||
// | ||
// WARNING: The destructor of this class is marked as protected to disallow | ||
// clients from directly destroying this object since it may manage it's own | ||
// lifetime through ref counting. Thus clients MUST call Release() in order to | ||
// destroy an instance of this class. | ||
public native void Release(); | ||
|
||
// Creates an operation builder and ties it to this context. | ||
// The returned object can be used for setting operation's attributes, | ||
// adding inputs and finally executing (immediately or lazily as in tracing) | ||
// it in this context. | ||
public native AbstractOperation CreateOperation(); | ||
|
||
// Registers a function with this context, after this the function is | ||
// available to be called/referenced by its name in this context. | ||
public native @ByVal Status RegisterFunction(AbstractFunction arg0); | ||
// Remove a function. 'func' argument is the name of a previously added | ||
// FunctionDef. The name is in fdef.signature.name. | ||
public native @ByVal Status RemoveFunction(@StdString BytePointer func); | ||
public native @ByVal Status RemoveFunction(@StdString String func); | ||
} |
30 changes: 30 additions & 0 deletions
30
...ensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/AbstractContextDeleter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE | ||
|
||
package org.tensorflow.internal.c_api; | ||
|
||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.tensorflow.internal.c_api.global.tensorflow.*; | ||
|
||
@Namespace("tensorflow::internal") @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) | ||
public class AbstractContextDeleter extends Pointer { | ||
static { Loader.load(); } | ||
/** Default native constructor. */ | ||
public AbstractContextDeleter() { super((Pointer)null); allocate(); } | ||
/** Native array allocator. Access with {@link Pointer#position(long)}. */ | ||
public AbstractContextDeleter(long size) { super((Pointer)null); allocateArray(size); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public AbstractContextDeleter(Pointer p) { super(p); } | ||
private native void allocate(); | ||
private native void allocateArray(long size); | ||
@Override public AbstractContextDeleter position(long position) { | ||
return (AbstractContextDeleter)super.position(position); | ||
} | ||
@Override public AbstractContextDeleter getPointer(long i) { | ||
return new AbstractContextDeleter((Pointer)this).position(position + i); | ||
} | ||
|
||
public native @Name("operator ()") void apply(AbstractContext p); | ||
} |
27 changes: 27 additions & 0 deletions
27
...core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/AbstractFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Targeted by JavaCPP version 1.5.5: DO NOT EDIT THIS FILE | ||
|
||
package org.tensorflow.internal.c_api; | ||
|
||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.tensorflow.internal.c_api.global.tensorflow.*; | ||
|
||
|
||
// A traced function: this hides the complexity of converting the serialized | ||
// representation between various supported formats e.g. FunctionDef and Mlir | ||
// function. | ||
@Namespace("tensorflow") @NoOffset @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) | ||
public class AbstractFunction extends Pointer { | ||
static { Loader.load(); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public AbstractFunction(Pointer p) { super(p); } | ||
|
||
// Returns which subclass is this instance of. | ||
public native int getKind(); | ||
|
||
// Returns the AbstractFunction as a FunctionDef. | ||
public native @ByVal Status GetFunctionDef(@Cast("tensorflow::FunctionDef**") PointerPointer arg0); | ||
public native @ByVal Status GetFunctionDef(@Cast("tensorflow::FunctionDef**") @ByPtrPtr Pointer arg0); | ||
} |
Oops, something went wrong.