AI-TensorFlow-Libtensorflow
view release on metacpan or search on metacpan
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
filesystem to indicate that the content has been persisted.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_SyncWritableFile(TF_WritableFileHandle* handle,
TF_Status* status);
=head2 TF_FlushWritableFile
=over 2
Flush local buffers to the filesystem. If the process terminates after a
successful flush, the contents may still be persisted, since the underlying
filesystem may eventually flush the contents. If the OS or machine crashes
after a successful flush, the contents may or may not be persisted, depending
on the implementation.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_FlushWritableFile(TF_WritableFileHandle* handle,
TF_Status* status);
=head2 TF_AppendWritableFile
=over 2
Appends the given bytes to the file. Any failure to do so is indicated in
status.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_AppendWritableFile(TF_WritableFileHandle* handle,
const char* data,
size_t length,
TF_Status* status);
=head2 TF_DeleteFile
=over 2
Deletes the named file and indicates whether successful in *status.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_DeleteFile(const char* filename,
TF_Status* status);
=head2 TF_StringStreamNext
=over 2
Retrieves the next item from the given TF_StringStream and places a pointer
to it in *result. If no more items are in the list, *result is set to NULL
and false is returned.
Ownership of the items retrieved with this function remains with the library.
Item points are invalidated after a call to TF_StringStreamDone.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern bool TF_StringStreamNext(TF_StringStream* list,
const char** result);
=head2 TF_StringStreamDone
=over 2
Frees the resources associated with given string list. All pointers returned
by TF_StringStreamNext are invalid after this call.
=back
/* From <tensorflow/c/env.h> */
TF_CAPI_EXPORT extern void TF_StringStreamDone(TF_StringStream* list);
=head2 TF_GetChildren
=over 2
Retrieves the list of children of the given directory. 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_GetChildren(const char* filename,
TF_Status* status);
=head2 TF_GetLocalTempDirectories
=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
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
This function should be used to allocate outputs inside kernel
compute function.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT TF_Tensor* TF_AllocateOutput(TF_OpKernelContext* context,
int index, TF_DataType dtype,
const int64_t* dims, int num_dims,
size_t len, TF_Status* status);
=head2 TF_ForwardInputOrAllocateOutput
=over 2
Tries to forward one of the inputs given in input_indices to
output[output_index]. If none of the given inputs can be forwarded, calls
allocate_output() to allocate a new output buffer. The index of the
forwarded input will be assign to output argument forwarded_input (if it's
not nullptr). If no inputs are forwarded, forwarded_input will be assigned
-1.
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT TF_Tensor* TF_ForwardInputOrAllocateOutput(
TF_OpKernelContext* context, const int* candidate_input_indices,
int num_candidate_input_indices, int output_index,
const int64_t* output_dims, int output_num_dims, int* forwarded_input,
TF_Status* status);
=head2 TF_AllocateTemp
=over 2
Allocates a temporary Tensor of the specified type and shape. The
Tensor must not be used after kernel construction is
complete.
num_dims must equal the size of array dims
=back
/* From <tensorflow/c/kernels.h> */
TF_CAPI_EXPORT extern TF_Tensor* TF_AllocateTemp(
TF_OpKernelContext* context, TF_DataType dtype, const int64_t* dims,
int num_dims, TF_AllocatorAttributes* alloc_attrs, TF_Status* status);
=head2 TF_AssignVariable
=over 2
Expose higher level Assignment operation for Pluggable vendors to implement
in the plugin for Training. The API takes in the context with indices for
the input and value tensors. It also accepts the copy callback provided by
pluggable vendor to do the copying of the tensors. The caller takes ownership
of the `source` and `dest` tensors and is responsible for freeing them with
TF_DeleteTensor. This function will return an error when the following
conditions are met:
1. `validate_shape` is set to `true`
2. The variable is initialized
3. The shape of the value tensor doesn't match the shape of the variable
tensor.
=back
/* From <tensorflow/c/kernels_experimental.h> */
TF_CAPI_EXPORT extern void TF_AssignVariable(
TF_OpKernelContext* ctx, int input_index, int value_index,
bool validate_shape,
void (*copyFunc)(TF_OpKernelContext* ctx, TF_Tensor* source,
TF_Tensor* dest),
TF_Status* status);
=head2 TF_AssignRefVariable
=over 2
Expose higher level Assignment operation for Pluggable vendors to implement
in the plugin for Training on ref variables. The API takes in the context
with indices for the input and value tensors. It also accepts the copy
callback provided by pluggable vendor to do the copying of the tensors. The
caller takes ownership of the `source` and `dest` tensors and is responsible
for freeing them with TF_DeleteTensor.
=back
/* From <tensorflow/c/kernels_experimental.h> */
TF_CAPI_EXPORT extern void TF_AssignRefVariable(
TF_OpKernelContext* ctx, int input_ref_index, int output_ref_index,
int value_index, bool use_locking, bool validate_shape,
void (*copyFunc)(TF_OpKernelContext* ctx, TF_Tensor* source,
TF_Tensor* dest),
TF_Status* status);
=head2 TF_AssignUpdateVariable
=over 2
Expose higher level AssignUpdate operation for Pluggable vendors to implement
in the plugin for Training. The API takes in the context with indices for the
input and value tensors. It also accepts the copy callback provided by
pluggable vendor to do the copying of the tensors and the update callback to
apply the arithmetic operation. The caller takes ownership of the `source`,
`dest`, `tensor` and `value` tensors and is responsible for freeing them with
TF_DeleteTensor.
=back
/* From <tensorflow/c/kernels_experimental.h> */
TF_CAPI_EXPORT extern void TF_AssignUpdateVariable(
TF_OpKernelContext* ctx, int input_index, int value_index, int Op,
int isVariantType,
void (*copyFunc)(TF_OpKernelContext* ctx, TF_Tensor* source,
TF_Tensor* dest),
void (*updateFunc)(TF_OpKernelContext* ctx, TF_Tensor* tensor,
TF_Tensor* value, int Op),
TF_Status* status);
=head2 TF_MaybeLockVariableInputMutexesInOrder
=over 2
This is a helper function which acquires mutexes in-order to provide
thread-safe way of performing weights update during the optimizer op. It
returns an opaque LockHolder handle back to plugin. This handle is passed to
the Release API for releasing the locks when the weight update is done. The
caller takes ownership of the `source` and `dest` tensors and is responsible
for freeing them with TF_DeleteTensor.
=back
/* From <tensorflow/c/kernels_experimental.h> */
TF_CAPI_EXPORT extern void TF_MaybeLockVariableInputMutexesInOrder(
TF_OpKernelContext* ctx, bool do_lock, bool sparse, const int* const inputs,
size_t len,
void (*copyFunc)(TF_OpKernelContext* ctx, TF_Tensor* source,
TF_Tensor* dest),
TF_VariableInputLockHolder** lockHolder, TF_Status* status);
=head2 TF_GetInputTensorFromVariable
=over 2
This interface returns `out` tensor which is updated corresponding to the
variable passed with input index. The caller takes ownership of the `source`
and `dest` tensors and is responsible for freeing them with TF_DeleteTensor.
=back
/* From <tensorflow/c/kernels_experimental.h> */
( run in 1.071 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )