AI-TensorFlow-Libtensorflow

 view release on metacpan or  search on metacpan

lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod  view on Meta::CPAN

=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

  \brief Get a pointer to a symbol from a dynamic library.
  
  "handle" should be a pointer returned from a previous call to
  TF_LoadLibraryFromEnv. On success, place OK in status and return a pointer to
  the located symbol. Otherwise returns nullptr and set error status.

=back

  /* From <tensorflow/c/env.h> */
  TF_CAPI_EXPORT extern void* TF_GetSymbolFromLibrary(void* handle,
                                                      const char* symbol_name,
                                                      TF_Status* status);

=head2 TF_Log

=over 2

=back

  /* From <tensorflow/c/logging.h> */
  TF_CAPI_EXPORT extern void TF_Log(TF_LogLevel level, const char* fmt, ...);

=head2 TF_VLog

=over 2

=back

  /* From <tensorflow/c/logging.h> */
  TF_CAPI_EXPORT extern void TF_VLog(int level, const char* fmt, ...);

=head2 TF_DVLog

=over 2

=back

lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod  view on Meta::CPAN

=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> */
  TF_CAPI_EXPORT extern void TF_GetInputTensorFromVariable(
      TF_OpKernelContext* ctx, int input, bool lock_held, bool isVariantType,
      bool sparse,
      void (*copyFunc)(TF_OpKernelContext* ctx, TF_Tensor* source,
                       TF_Tensor* dest),
      TF_Tensor** out, TF_Status* status);

=head2 TF_OpKernelContext_ForwardRefInputToRefOutput

=over 2

  This interface forwards the reference from input to the output tensors
  corresponding to the indices provided with `input_index` and `output_index`

=back

  /* From <tensorflow/c/kernels_experimental.h> */
  TF_CAPI_EXPORT extern void TF_OpKernelContext_ForwardRefInputToRefOutput(
      TF_OpKernelContext* ctx, int32_t input_index, int32_t output_index);

=head2 TF_ReleaseVariableInputLockHolder

=over 2

  The API releases the opaque lock handle returned with
  `TF_MaybeLockVariableInputMutexesInOrder` API

=back

  /* From <tensorflow/c/kernels_experimental.h> */
  TF_CAPI_EXPORT extern void TF_ReleaseVariableInputLockHolder(
      TF_VariableInputLockHolder* lockHolder);

=head2 TF_GetInputByName

lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod  view on Meta::CPAN


  /* 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

=over 2

  Clears the internal caches in the TFE context. Useful when reseeding random
  ops.

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern void TFE_ContextClearCaches(TFE_Context* ctx);

=head2 TFE_ContextSetThreadLocalDevicePlacementPolicy

=over 2

  Sets a thread-local device placement policy. After this call, other calls to
  TFE_Execute in the same thread will use the device policy specified here
  instead of the device policy used to construct the context. This has no
  effect on the device policy used by other program threads.

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern void TFE_ContextSetThreadLocalDevicePlacementPolicy(
      TFE_Context* ctx, TFE_ContextDevicePlacementPolicy policy);

=head2 TFE_ContextGetDevicePlacementPolicy

=over 2

  Returns the device placement policy to be used by this context in the current
  thread.

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern TFE_ContextDevicePlacementPolicy
  TFE_ContextGetDevicePlacementPolicy(TFE_Context* ctx);

=head2 TFE_ContextSetServerDef

=over 2

  A tensorflow.ServerDef specifies remote workers (in addition to the current
  workers name). Operations created in this context can then be executed on
  any of these remote workers by setting an appropriate device.
  
  If the following is set, all servers identified by the
  ServerDef must be up when the context is created.

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern void TFE_ContextSetServerDef(TFE_Context* ctx,
                                                     int keep_alive_secs,
                                                     const void* proto,
                                                     size_t proto_len,
                                                     TF_Status* status);

=head2 TFE_NewTensorHandle

=over 2

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern TFE_TensorHandle* TFE_NewTensorHandle(const TF_Tensor* t,
                                                              TF_Status* status);

=head2 TFE_DeleteTensorHandle

=over 2

  Indicates that the caller will not be using `h` any more.

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern void TFE_DeleteTensorHandle(TFE_TensorHandle* h);

=head2 TFE_TensorHandleDataType

=over 2

=back

  /* From <tensorflow/c/eager/c_api.h> */
  TF_CAPI_EXPORT extern TF_DataType TFE_TensorHandleDataType(TFE_TensorHandle* h);

=head2 TFE_TensorHandleNumDims

=over 2

lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod  view on Meta::CPAN


=over 2

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_OpSetCancellationManager(
      TFE_Op* op, TFE_CancellationManager* cancellation_manager,
      TF_Status* status);

=head2 TFE_NewExecutor

=over 2

  Creates a new eager Executor. Nodes in one executor are guaranteed to be
  executed in sequence. Assigning nodes to different executors allows executing
  nodes in parallel.
  in_flight_nodes_limit: when is_async is true, this value controls the
  maximum number of in flight async nodes. Enqueuing of additional async ops
  after the limit is reached blocks until some inflight nodes finishes.
  The effect is bounding the memory held by inflight TensorHandles that are
  referenced by the inflight nodes.
  A recommended value has not been established.
  A value of 0 removes the limit, which is the behavior of TensorFlow 2.11.
  When is_async is false, the value is ignored.

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern TFE_Executor* TFE_NewExecutor(
      bool is_async, bool enable_streaming_enqueue, int in_flight_nodes_limit);

=head2 TFE_DeleteExecutor

=over 2

  Deletes the eager Executor without waiting for enqueued nodes. Please call
  TFE_ExecutorWaitForAllPendingNodes before calling this API if you want to
  make sure all nodes are finished.

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_DeleteExecutor(TFE_Executor*);

=head2 TFE_ExecutorIsAsync

=over 2

  Returns true if the executor is in async mode.

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern bool TFE_ExecutorIsAsync(TFE_Executor*);

=head2 TFE_ExecutorWaitForAllPendingNodes

=over 2

  Causes the calling thread to block till all ops dispatched in this executor
  have been executed. Note that "execution" here refers to kernel execution /
  scheduling of copies, etc. Similar to sync execution, it doesn't guarantee
  that lower level device queues (like GPU streams) have been flushed.
  
  This call may not block for execution of ops enqueued concurrently with this
  call.

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_ExecutorWaitForAllPendingNodes(
      TFE_Executor*, TF_Status* status);

=head2 TFE_ExecutorClearError

=over 2

  When an error happens, any pending operations are discarded, and newly issued
  ops return an error. This call clears the error state and re-enables
  execution of newly issued ops.
  
  Note that outputs of discarded ops remain in a corrupt state and should not
  be used for future calls.
  TODO(agarwal): mark the affected handles and raise errors if they are used.

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_ExecutorClearError(TFE_Executor*);

=head2 TFE_ContextSetExecutorForThread

=over 2

  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 2.168 seconds using v1.01-cache-2.11-cpan-fe3c2283af0 )