AI-TensorFlow-Libtensorflow
view release on metacpan or search on metacpan
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
Frees `params`s resources without building a while loop. `params` is no
longer valid after this returns. Either this or TF_FinishWhile() must be
called after a successful TF_NewWhile() call.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern void TF_AbortWhile(const TF_WhileParams* params);
=head2 TF_AddGradients
=over 2
Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s,
i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...
`dx` are used as initial gradients (which represent the symbolic partial
derivatives of some loss function `L` w.r.t. `y`).
`dx` must be nullptr or have size `ny`.
If `dx` is nullptr, the implementation will use dx of `OnesLike` for all
shapes in `y`.
The partial derivatives are returned in `dy`. `dy` should be allocated to
size `nx`.
Gradient nodes are automatically named under the "gradients/" prefix. To
guarantee name uniqueness, subsequent calls to the same graph will
append an incremental tag to the prefix: "gradients_1/", "gradients_2/", ...
See TF_AddGradientsWithPrefix, which provides a means to specify a custom
name prefix for operations added to a graph to compute the gradients.
WARNING: This function does not yet support all the gradients that python
supports. See
https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md
for instructions on how to add C++ more gradients.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT void TF_AddGradients(TF_Graph* g, TF_Output* y, int ny,
TF_Output* x, int nx, TF_Output* dx,
TF_Status* status, TF_Output* dy);
=head2 TF_AddGradientsWithPrefix
=over 2
Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s,
i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...
This is a variant of TF_AddGradients that allows to caller to pass a custom
name prefix to the operations added to a graph to compute the gradients.
`dx` are used as initial gradients (which represent the symbolic partial
derivatives of some loss function `L` w.r.t. `y`).
`dx` must be nullptr or have size `ny`.
If `dx` is nullptr, the implementation will use dx of `OnesLike` for all
shapes in `y`.
The partial derivatives are returned in `dy`. `dy` should be allocated to
size `nx`.
`prefix` names the scope into which all gradients operations are being added.
`prefix` must be unique within the provided graph otherwise this operation
will fail. If `prefix` is nullptr, the default prefixing behaviour takes
place, see TF_AddGradients for more details.
WARNING: This function does not yet support all the gradients that python
supports. See
https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md
for instructions on how to add C++ more gradients.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT void TF_AddGradientsWithPrefix(TF_Graph* g, const char* prefix,
TF_Output* y, int ny,
TF_Output* x, int nx,
TF_Output* dx, TF_Status* status,
TF_Output* dy);
=head2 TF_GraphToFunction
=over 2
Create a TF_Function from a TF_Graph
Params:
fn_body - the graph whose operations (or subset of whose operations) will be
converted to TF_Function.
fn_name - the name of the new TF_Function. Should match the operation
name (OpDef.name) regexp [A-Z][A-Za-z0-9_.\\-/]*.
If `append_hash_to_fn_name` is false, `fn_name` must be distinct
from other function and operation names (at least those
registered in graphs where this function will be used).
append_hash_to_fn_name - Must be 0 or 1. If set to 1, the actual name
of the function will be `fn_name` appended with
'_<hash_of_this_function's_definition>'.
If set to 0, the function's name will be `fn_name`.
num_opers - `num_opers` contains the number of elements in the `opers` array
or a special value of -1 meaning that no array is given.
The distinction between an empty array of operations and no
array of operations is necessary to distinguish the case of
creating a function with no body (e.g. identity or permutation)
and the case of creating a function whose body contains all
the nodes in the graph (except for the automatic skipping, see
below).
opers - Array of operations to become the body of the function or null.
- If no array is given (`num_opers` = -1), all the
operations in `fn_body` will become part of the function
except operations referenced in `inputs`. These operations
must have a single output (these operations are typically
placeholders created for the sole purpose of representing
an input. We can relax this constraint if there are
compelling use cases).
- If an array is given (`num_opers` >= 0), all operations
in it will become part of the function. In particular, no
automatic skipping of dummy input operations is performed.
ninputs - number of elements in `inputs` array
inputs - array of TF_Outputs that specify the inputs to the function.
If `ninputs` is zero (the function takes no inputs), `inputs`
can be null. The names used for function inputs are normalized
names of the operations (usually placeholders) pointed to by
`inputs`. These operation names should start with a letter.
Normalization will convert all letters to lowercase and
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
(eg. TF_STRING) or on failure.
=back
/* From <tensorflow/c/tf_datatype.h> */
TF_CAPI_EXPORT extern size_t TF_DataTypeSize(TF_DataType dt);
=head2 TF_NewOpDefinitionBuilder
=over 2
Returns a newly allocated op definition builder for the given op name. The
returned builder may be customized with the `TF_OpDefinitionBuilder...`
functions and then registered with TensorFlow with TF_RegisterOpDefinition.
The returned pointer is either freed by a call to TF_RegisterOpDefinition, or
can be manually deleted by TF_DeleteOpDefinitionBuilder if it is never
registered.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern TF_OpDefinitionBuilder* TF_NewOpDefinitionBuilder(
const char* op_name);
=head2 TF_RegisterOpDefinition
=over 2
Registers the given op builder with TensorFlow. Indicates success or
otherwise in the given status.
`builder` is freed whether the op was successfully registered or not. You
must call either this function or TF_DeleteOpDefinitionBuilder to free the
builder, but never both.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_RegisterOpDefinition(
TF_OpDefinitionBuilder* builder, TF_Status* status);
=head2 TF_DeleteOpDefinitionBuilder
=over 2
Frees the given op definition builder. You must call either this function or
TF_RegisterOpDefinition to free the builder, but never both.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_DeleteOpDefinitionBuilder(
TF_OpDefinitionBuilder* builder);
=head2 TF_OpDefinitionBuilderAddAttr
=over 2
Adds an attr to the given TF_OpDefinitionBuilder. The spec has
format "<name>:<type>" or "<name>:<type>=<default>"
where <name> matches regexp [a-zA-Z][a-zA-Z0-9_]*.
By convention, names containing only capital letters are reserved for
attributes whose values can be inferred by the operator implementation if not
supplied by the user. If the attribute name contains characters other than
capital letters, the operator expects the user to provide the attribute value
at operation runtime.
<type> can be:
"string", "int", "float", "bool", "type", "shape", or "tensor"
"numbertype", "realnumbertype", "quantizedtype"
(meaning "type" with a restriction on valid values)
"{int32,int64}" or {realnumbertype,quantizedtype,string}"
(meaning "type" with a restriction containing unions of value types)
"{\"foo\", \"bar\n baz\"}", or "{'foo', 'bar\n baz'}"
(meaning "string" with a restriction on valid values)
"list(string)", ..., "list(tensor)", "list(numbertype)", ...
(meaning lists of the above types)
"int >= 2" (meaning "int" with a restriction on valid values)
"list(string) >= 2", "list(int) >= 2"
(meaning "list(string)" / "list(int)" with length at least 2)
<default>, if included, should use the Proto text format
of <type>. For lists use [a, b, c] format.
Note that any attr specifying the length of an input or output will
get a default minimum of 1 unless the >= # syntax is used.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderAddAttr(
TF_OpDefinitionBuilder* builder, const char* attr_spec);
=head2 TF_OpDefinitionBuilderAddInput
=over 2
Adds an input to this TF_OpDefinitionBuilder.
The spec has form "<name>:<type-expr>" or "<name>:Ref(<type-expr>)"
where <name> matches regexp [a-z][a-z0-9_]* and <type-expr> can be:
* For a single tensor: <type>
* For a sequence of tensors with the same type: <number>*<type>
* For a sequence of tensors with different types: <type-list>
Where:
<type> is either one of "float", "int32", "string", ...
or the name of an attr (see TF_OpDefinitionBuilderAddAttr)
with type "type".
<number> is the name of an attr with type "int".
<type-list> is the name of an attr with type "list(type)".
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderAddInput(
TF_OpDefinitionBuilder* builder, const char* input_spec);
=head2 TF_OpDefinitionBuilderAddOutput
=over 2
Adds an output to this TF_OpDefinitionBuilder.
The spec has form "<name>:<type-expr>" or "<name>:Ref(<type-expr>)"
where <name> matches regexp [a-z][a-z0-9_]* and <type-expr> can be:
* For a single tensor: <type>
* For a sequence of tensors with the same type: <number>*<type>
* For a sequence of tensors with different types: <type-list>
Where:
<type> is either one of "float", "int32", "string", ...
or the name of an attr (see TF_OpDefinitionBuilderAddAttr)
with type "type".
<number> is the name of an attr with type "int".
<type-list> is the name of an attr with type "list(type)".
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderAddOutput(
TF_OpDefinitionBuilder* builder, const char* output_spec);
=head2 TF_OpDefinitionBuilderSetIsCommutative
=over 2
Sets the commutative property for the op built by the given builder.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderSetIsCommutative(
TF_OpDefinitionBuilder* builder, bool is_commutative);
=head2 TF_OpDefinitionBuilderSetIsAggregate
=over 2
Sets the is_aggregate property of the builder to the given value.
If is_aggregate is true, then the operation produced by this builder accepts
N >= 2 inputs and produces 1 output all of the same type. Should be
associative and commutative, and produce output with the same shape as the
input. The optimizer may replace an aggregate op taking input from multiple
devices with a tree of aggregate ops that aggregate locally within each
device (and possibly within groups of nearby devices) before communicating.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderSetIsAggregate(
TF_OpDefinitionBuilder* builder, bool is_aggregate);
=head2 TF_OpDefinitionBuilderSetIsStateful
=over 2
Sets the is_stateful property of the builder to the given value.
The op built by this builder is stateful if its behavior depends on some
state beyond its input tensors (e.g. variable reading op) or if it has a
side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
must always produce the same output for the same input and have no
side-effects.
By default Ops may be moved between devices. Stateful ops should either not
be moved, or should only be moved if that state can also be moved (e.g. via
some sort of save / restore). Stateful ops are guaranteed to never be
optimized away by Common Subexpression Elimination (CSE).
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderSetIsStateful(
TF_OpDefinitionBuilder* builder, bool is_stateful);
=head2 TF_OpDefinitionBuilderSetAllowsUninitializedInput
=over 2
Sets the allows_uninitialized_input property of the operation built by this
builder.
By default, all inputs to an Op must be initialized Tensors. Ops that may
initialize tensors for the first time should set this field to true, to allow
the Op to take an uninitialized Tensor as input.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderSetAllowsUninitializedInput(
TF_OpDefinitionBuilder* builder, bool allows_uninitialized_input);
=head2 TF_OpDefinitionBuilderDeprecated
=over 2
Adds a deprecation warning for the given op. This indicates to the user that
`version` is the first TensorFlow GraphDef version for which the operation is
deprecated. `explanation` should contain the reason for the deprecation and
what to use instead.
This function is only an indicator that the operation may disappear in a
version of TensorFlow after `version`. It does not affect op registration.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderDeprecated(
TF_OpDefinitionBuilder* builder, int version, const char* explanation);
=head2 TF_OpDefinitionBuilderSetShapeInferenceFunction
=over 2
Sets the shape inference function for the op.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern void TF_OpDefinitionBuilderSetShapeInferenceFunction(
TF_OpDefinitionBuilder* builder,
void (*shape_inference_func)(TF_ShapeInferenceContext* ctx,
TF_Status* status));
=head2 TF_ShapeInferenceContextNumInputs
=over 2
Returns the number of inputs in the given shape inference context.
=back
/* From <tensorflow/c/ops.h> */
TF_CAPI_EXPORT extern int64_t TF_ShapeInferenceContextNumInputs(
TF_ShapeInferenceContext* ctx);
=head2 TF_NewShapeHandle
=over 2
Returns a newly allocated shape handle. The shapes represented by these
handles may be queried or mutated with the corresponding
TF_ShapeInferenceContext... functions.
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
=over 2
Retrieves a list of directory names on the local machine that may be used for
temporary storage. You can iterate through the list with TF_StringStreamNext.
The caller is responsible for freeing the list (see TF_StringStreamDone).
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern TF_StringStream* TF_GetLocalTempDirectories(void);
=head2 TF_GetTempFileName
=over 2
Creates a temporary file name with an extension.
The caller is responsible for freeing the returned pointer.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern char* TF_GetTempFileName(const char* extension);
=head2 TF_NowNanos
=over 2
Returns the number of nanoseconds since the Unix epoch.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern uint64_t TF_NowNanos(void);
=head2 TF_NowMicros
=over 2
Returns the number of microseconds since the Unix epoch.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern uint64_t TF_NowMicros(void);
=head2 TF_NowSeconds
=over 2
Returns the number of seconds since the Unix epoch.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern uint64_t TF_NowSeconds(void);
=head2 TF_DefaultThreadOptions
=over 2
Populates a TF_ThreadOptions struct with system-default values.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_DefaultThreadOptions(TF_ThreadOptions* options);
=head2 TF_StartThread
=over 2
Returns a new thread that is running work_func and is identified
(for debugging/performance-analysis) by thread_name.
The given param (which may be null) is passed to work_func when the thread
starts. In this way, data may be passed from the thread back to the caller.
Caller takes ownership of the result and must call TF_JoinThread on it
eventually.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern TF_Thread* TF_StartThread(const TF_ThreadOptions* options,
const char* thread_name,
void (*work_func)(void*),
void* param);
=head2 TF_JoinThread
=over 2
Waits for the given thread to finish execution, then deletes it.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_JoinThread(TF_Thread* thread);
=head2 TF_LoadSharedLibrary
=over 2
\brief Load a dynamic library.
Pass "library_filename" to a platform-specific mechanism for dynamically
loading a library. The rules for determining the exact location of the
library are platform-specific and are not documented here.
On success, place OK in status and return the newly created library handle.
Otherwise returns nullptr and set error status.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void* TF_LoadSharedLibrary(const char* library_filename,
TF_Status* status);
=head2 TF_GetSymbolFromLibrary
=over 2
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
=head2 TF_NewKernelBuilder
=over 2
Allocates a new kernel builder and returns a pointer to it.
If non-null, TensorFlow will call create_func when it needs to instantiate
the kernel. The pointer returned by create_func will be passed to
compute_func and delete_func, thereby functioning as a "this" pointer for
referring to kernel instances.
The TF_OpKernelConstruction pointer passed to create_func is owned by
TensorFlow and will be deleted once create_func returns. It must not be used
after this.
When TensorFlow needs to perform a computation with this kernel, it will
call compute_func. This function will receive the pointer returned by
create_func (or null if no create_func was provided), along with the inputs
to the computation.
The TF_OpKernelContext pointer received by compute_func is owned by
TensorFlow and will be deleted once compute_func returns. It must not be used
after this.
Finally, when TensorFlow no longer needs the kernel, it will call
delete_func if one is provided. This function will receive the pointer
returned in `create_func` or nullptr if no `create_func` was provided.
The caller should pass the result of this function to
TF_RegisterKernelBuilder, which will take ownership of the pointer. If, for
some reason, the kernel builder will not be registered, the caller should
delete it with TF_DeleteKernelBuilder.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern TF_KernelBuilder* TF_NewKernelBuilder(
const char* op_name, const char* device_name,
void* (*create_func)(TF_OpKernelConstruction*),
void (*compute_func)(void*, TF_OpKernelContext*),
void (*delete_func)(void*));
=head2 TF_KernelBuilder_TypeConstraint
=over 2
Specifies that this kernel's attribute only supports the given type.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern void TF_KernelBuilder_TypeConstraint(
TF_KernelBuilder* kernel_builder, const char* attr_name,
const TF_DataType type, TF_Status* status);
=head2 TF_KernelBuilder_HostMemory
=over 2
Specify that this kernel requires/provides an input/output arg
in host memory (instead of the default, device memory).
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern void TF_KernelBuilder_HostMemory(
TF_KernelBuilder* kernel_builder, const char* arg_name);
=head2 TF_KernelBuilder_Priority
=over 2
Specify a priority number for this kernel.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern void TF_KernelBuilder_Priority(
TF_KernelBuilder* kernel_builder, int32_t priority_number);
=head2 TF_KernelBuilder_Label
=over 2
Specify a label for this kernel.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern void TF_KernelBuilder_Label(
TF_KernelBuilder* kernel_builder, const char* label);
=head2 TF_RegisterKernelBuilder
=over 2
Register the given kernel builder with the TensorFlow runtime. If
registration fails, the given status will be populated.
This call takes ownership of the `builder` pointer.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern void TF_RegisterKernelBuilder(const char* kernel_name,
TF_KernelBuilder* builder,
TF_Status* status);
=head2 TF_RegisterKernelBuilderWithKernelDef
=over 2
Register the given kernel builder with the TensorFlow runtime. If
registration fails, the given status will be populated.
This method is the same as TF_RegisterKernelBuilder except it takes in a
serialized KernelDef, and uses it for registration, instead of building a new
one. Users can choose to not provide a serialized KernelDef and in that case
it's identical to TF_RegisterKernelBuilder.
=back
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
Returns the serialized NodeDef protocol buffer for the kernel
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern TF_Buffer* TF_OpKernelConstruction_GetNodeDef(
TF_OpKernelConstruction* ctx, TF_Status* status);
=head2 TF_GetFrameId
=over 2
Returns the frame ID of the given context.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern uint64_t TF_GetFrameId(TF_OpKernelContext* ctx);
=head2 TF_GetIterId
=over 2
Returns the Iter ID of the given context.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern int64_t TF_GetIterId(TF_OpKernelContext* ctx);
=head2 TF_GetGraphDefVersion
=over 2
Returns the graph def version of the given context.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern int TF_GetGraphDefVersion(TF_OpKernelContext* ctx);
=head2 TF_GetOpKernelName
=over 2
Returns the name of the OpKernel.
The returned TF_StringView's underlying string is owned by the OpKernel and
has the same lifetime as the OpKernel.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern TF_StringView TF_GetOpKernelName(TF_OpKernelContext* ctx);
=head2 TF_GetResourceMgrDefaultContainerName
=over 2
Returns the default container of the resource manager in OpKernelContext.
The returned TF_StringView's underlying string is owned by the OpKernel and
has the same lifetime as the OpKernel.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern TF_StringView TF_GetResourceMgrDefaultContainerName(
TF_OpKernelContext* ctx);
=head2 TF_GetOpKernelRequestedInput
=over 2
Returns the name of the requested input at `index` from the OpKernel.
The returned TF_StringView's underlying string is owned by the OpKernel and
has the same lifetime as the OpKernel.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern TF_StringView TF_GetOpKernelRequestedInput(
TF_OpKernelContext* ctx, size_t index);
=head2 TF_OpKernelConstruction_GetAttrSize
=over 2
Get the list_size and total_size of the attribute `attr_name` of `oper`.
list_size - the length of the list.
total_size - total size of the list.
(1) If attr_type == TF_ATTR_STRING
then total_size is the cumulative byte size
of all the strings in the list.
(3) If attr_type == TF_ATTR_SHAPE
then total_size is the number of dimensions
of the shape valued attribute, or -1
if its rank is unknown.
(4) If attr_type == TF_ATTR_SHAPE
then total_size is the cumulative number
of dimensions of all shapes in the list.
(5) Otherwise, total_size is undefined.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern void TF_OpKernelConstruction_GetAttrSize(
TF_OpKernelConstruction* ctx, const char* attr_name, int32_t* list_size,
int32_t* total_size, TF_Status* status);
=head2 TF_OpKernelConstruction_GetAttrType
=over 2
Interprets the named kernel construction attribute as a TF_DataType and
places it into *val. *status is set to TF_OK.
If the attribute could not be found or could not be interpreted as
TF_DataType, *status is populated with an error.
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
=back
/* From <tensorflow/c/kernels_experimental.h> */
TF_CAPI_EXPORT extern void TF_AddNVariant(
TF_OpKernelContext* ctx,
void (*binary_add_func)(TF_OpKernelContext* ctx, TF_Tensor* a, TF_Tensor* b,
TF_Tensor* out),
TF_Status* status);
=head2 TF_ZerosLikeVariant
=over 2
Expose higher level ZerosLike operation for Pluggable vendors to implement
in the plugin for Variant data types. The API takes in the context and a
callback provided by pluggable vendor to do a ZerosLike operation on the
tensors unwrapped from the Variant tensors. The caller takes ownership of the
`input` and `out` tensors and is responsible for freeing them with
TF_DeleteTensor.
=back
/* From <tensorflow/c/kernels_experimental.h> */
TF_CAPI_EXPORT extern void TF_ZerosLikeVariant(
TF_OpKernelContext* ctx,
void (*zeros_like_func)(TF_OpKernelContext* ctx, TF_Tensor* input,
TF_Tensor* out),
TF_Status* status);
=head2 TFE_NewContextOptions
=over 2
Return a new options object.
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern TFE_ContextOptions* TFE_NewContextOptions(void);
=head2 TFE_ContextOptionsSetConfig
=over 2
Set the config in TF_ContextOptions.options.
config should be a serialized tensorflow.ConfigProto proto.
If config was not parsed successfully as a ConfigProto, record the
error information in *status.
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern void TFE_ContextOptionsSetConfig(
TFE_ContextOptions* options, const void* proto, size_t proto_len,
TF_Status* status);
=head2 TFE_ContextOptionsSetAsync
=over 2
Sets the default execution mode (sync/async). Note that this can be
overridden per thread using TFE_ContextSetExecutorForThread.
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*,
unsigned char enable);
=head2 TFE_ContextOptionsSetDevicePlacementPolicy
=over 2
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy(
TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy);
=head2 TFE_DeleteContextOptions
=over 2
Destroy an options object.
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern void TFE_DeleteContextOptions(TFE_ContextOptions*);
=head2 TFE_NewContext
=over 2
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern TFE_Context* TFE_NewContext(
const TFE_ContextOptions* opts, TF_Status* status);
=head2 TFE_DeleteContext
=over 2
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern void TFE_DeleteContext(TFE_Context* ctx);
=head2 TFE_ContextListDevices
=over 2
=back
/* From <tensorflow/c/eager/c_api.h> */
TF_CAPI_EXPORT extern TF_DeviceList* TFE_ContextListDevices(TFE_Context* ctx,
TF_Status* status);
=head2 TFE_ContextClearCaches
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
Sets a custom Executor for the current thread. All nodes created by this
thread will be added to this Executor. It will override the current executor.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern void TFE_ContextSetExecutorForThread(TFE_Context*,
TFE_Executor*);
=head2 TFE_ContextGetExecutorForThread
=over 2
Returns the Executor for the current thread.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern TFE_Executor* TFE_ContextGetExecutorForThread(
TFE_Context*);
=head2 TFE_ContextUpdateServerDef
=over 2
Update an existing context with a new set of servers defined in a ServerDef
proto. Servers can be added to and removed from the list of remote workers
in the context. A New set of servers identified by the ServerDef must be up
when the context is updated.
This API is for experimental usage and may be subject to change.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern void TFE_ContextUpdateServerDef(TFE_Context* ctx,
int keep_alive_secs,
const void* proto,
size_t proto_len,
TF_Status* status);
=head2 TFE_ContextCheckAlive
=over 2
Checks whether a remote worker is alive or not. This will return true even if
the context doesn't exist on the remote worker.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern bool TFE_ContextCheckAlive(TFE_Context* ctx,
const char* worker_name,
TF_Status* status);
=head2 TFE_ContextAsyncWait
=over 2
Sync pending nodes in local executors (including the context default executor
and thread executors) and streaming requests to remote executors, and get the
combined status.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern void TFE_ContextAsyncWait(TFE_Context* ctx,
TF_Status* status);
=head2 TFE_TensorHandleDevicePointer
=over 2
This function will block till the operation that produces `h` has
completed. This is only valid on local TFE_TensorHandles. The pointer
returned will be on the device in which the TFE_TensorHandle resides (so e.g.
for a GPU tensor this will return a pointer to GPU memory). The pointer is
only guaranteed to be valid until TFE_DeleteTensorHandle is called on this
TensorHandle. Only supports POD data types.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern void* TFE_TensorHandleDevicePointer(TFE_TensorHandle*,
TF_Status*);
=head2 TFE_TensorHandleDeviceMemorySize
=over 2
This function will block till the operation that produces `h` has
completed. This is only valid on local TFE_TensorHandles. Returns the size in
bytes of the memory pointed to by the device pointer returned above.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern size_t TFE_TensorHandleDeviceMemorySize(TFE_TensorHandle*,
TF_Status*);
=head2 TFE_NewTensorHandleFromDeviceMemory
=over 2
Creates a new TensorHandle from memory residing in the physical device
device_name. Takes ownership of the memory, and will call deleter to release
it after TF no longer needs it or in case of error.
Custom devices must use TFE_NewCustomDeviceTensorHandle instead.
=back
/* From <tensorflow/c/eager/c_api_experimental.h> */
TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_NewTensorHandleFromDeviceMemory(
TFE_Context* ctx, const char* device_name, TF_DataType, const int64_t* dims,
int num_dims, void* data, size_t len,
void (*deallocator)(void* data, size_t len, void* arg),
void* deallocator_arg, TF_Status* status);
=head2 TFE_HostAddressSpace
( run in 1.402 second using v1.01-cache-2.11-cpan-140bd7fdf52 )