AI-TensorFlow-Libtensorflow

 view release on metacpan or  search on metacpan

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

# PODNAME: AI::TensorFlow::Libtensorflow::Manual::CAPI
# ABSTRACT: List of functions exported by TensorFlow C API
# DO NOT EDIT: Generated by process-capi.pl

__END__

=pod

=encoding UTF-8

=head1 NAME

AI::TensorFlow::Libtensorflow::Manual::CAPI - List of functions exported by TensorFlow C API

=head1 DESCRIPTION

The following a list of functions exported by the TensorFlow C API with their
associated documentation from the upstream TensorFlow project. It has been
converted to POD for easy reference.

=begin Pod::Coverage




=end Pod::Coverage

=head1 FUNCTIONS

=head2 TF_Version

=over 2

  TF_Version returns a string describing version information of the
  TensorFlow library. TensorFlow uses semantic versioning.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern const char* TF_Version(void);

=head2 TF_TensorFromProto

=over 2

  Parsing a serialized TensorProto into a TF_Tensor.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_TensorFromProto(const TF_Buffer* from,
                                                TF_Tensor* to, TF_Status* status);

=head2 TF_NewSessionOptions

=over 2

  Return a new options object.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_SessionOptions* TF_NewSessionOptions(void);

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


=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern unsigned char TF_TryEvaluateConstant(TF_Graph* graph,
                                                             TF_Output output,
                                                             TF_Tensor** result,
                                                             TF_Status* status);

=head2 TF_NewSession

=over 2

  Return a new execution session with the associated graph, or NULL on
  error. Does not take ownership of any input parameters.
  
  *`graph` must be a valid graph (not deleted or nullptr). `graph` will be
  kept alive for the lifetime of the returned TF_Session. New nodes can still
  be added to `graph` after this call.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_Session* TF_NewSession(TF_Graph* graph,
                                                  const TF_SessionOptions* opts,
                                                  TF_Status* status);

=head2 TF_LoadSessionFromSavedModel

=over 2

  This function creates a new TF_Session (which is created on success) using
  `session_options`, and then initializes state (restoring tensors and other
  assets) using `run_options`.
  
  Any NULL and non-NULL value combinations for (`run_options, `meta_graph_def`)
  are valid.
  
  - `export_dir` must be set to the path of the exported SavedModel.
  - `tags` must include the set of tags used to identify one MetaGraphDef in
     the SavedModel.
  - `graph` must be a graph newly allocated with TF_NewGraph().
  
  If successful, populates `graph` with the contents of the Graph and
  `meta_graph_def` with the MetaGraphDef of the loaded model.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_Session* TF_LoadSessionFromSavedModel(
      const TF_SessionOptions* session_options, const TF_Buffer* run_options,
      const char* export_dir, const char* const* tags, int tags_len,
      TF_Graph* graph, TF_Buffer* meta_graph_def, TF_Status* status);

=head2 TF_CloseSession

=over 2

  Close a session.
  
  Contacts any other processes associated with the session, if applicable.
  May not be called after TF_DeleteSession().

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_CloseSession(TF_Session*, TF_Status* status);

=head2 TF_DeleteSession

=over 2

  Destroy a session object.
  
  Even if error information is recorded in *status, this call discards all
  local resources associated with the session.  The session may not be used
  during or after this call (and the session drops its reference to the
  corresponding graph).

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_DeleteSession(TF_Session*, TF_Status* status);

=head2 TF_SessionRun

=over 2

  Run the graph associated with the session starting with the supplied inputs
  (inputs[0,ninputs-1] with corresponding values in input_values[0,ninputs-1]).
  
  Any NULL and non-NULL value combinations for (`run_options`,
  `run_metadata`) are valid.
  
     - `run_options` may be NULL, in which case it will be ignored; or
       non-NULL, in which case it must point to a `TF_Buffer` containing the
       serialized representation of a `RunOptions` protocol buffer.
     - `run_metadata` may be NULL, in which case it will be ignored; or
       non-NULL, in which case it must point to an empty, freshly allocated
       `TF_Buffer` that may be updated to contain the serialized representation
       of a `RunMetadata` protocol buffer.
  
  The caller retains ownership of `input_values` (which can be deleted using
  TF_DeleteTensor). The caller also retains ownership of `run_options` and/or
  `run_metadata` (when not NULL) and should manually call TF_DeleteBuffer on
  them.
  
  On success, the tensors corresponding to outputs[0,noutputs-1] are placed in
  output_values[]. Ownership of the elements of output_values[] is transferred
  to the caller, which must eventually call TF_DeleteTensor on them.
  
  On failure, output_values[] contains NULLs.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_SessionRun(
      TF_Session* session,
      // RunOptions
      const TF_Buffer* run_options,
      // Input tensors

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

  TF_CAPI_EXPORT extern void TF_ApiDefMapPut(TF_ApiDefMap* api_def_map,
                                             const char* text, size_t text_len,
                                             TF_Status* status);

=head2 TF_ApiDefMapGet

=over 2

  Returns a serialized ApiDef protocol buffer for the TensorFlow operation
  named `name`.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_Buffer* TF_ApiDefMapGet(TF_ApiDefMap* api_def_map,
                                                   const char* name,
                                                   size_t name_len,
                                                   TF_Status* status);

=head2 TF_GetAllRegisteredKernels

=over 2

  Returns a serialized KernelList protocol buffer containing KernelDefs for all
  registered kernels.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_Buffer* TF_GetAllRegisteredKernels(TF_Status* status);

=head2 TF_GetRegisteredKernelsForOp

=over 2

  Returns a serialized KernelList protocol buffer containing KernelDefs for all
  kernels registered for the operation named `name`.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_Buffer* TF_GetRegisteredKernelsForOp(
      const char* name, TF_Status* status);

=head2 TF_UpdateEdge

=over 2

  Update edge, switch input/ output in a node

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_UpdateEdge(TF_Graph* graph, TF_Output new_src,
                                           TF_Input dst, TF_Status* status);

=head2 TF_NewServer

=over 2

  Creates a new in-process TensorFlow server configured using a serialized
  ServerDef protocol buffer provided via `proto` and `proto_len`.
  
  The server will not serve any requests until TF_ServerStart is invoked.
  The server will stop serving requests once TF_ServerStop or
  TF_DeleteServer is invoked.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern TF_Server* TF_NewServer(const void* proto,
                                                size_t proto_len,
                                                TF_Status* status);

=head2 TF_ServerStart

=over 2

  Starts an in-process TensorFlow server.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_ServerStart(TF_Server* server, TF_Status* status);

=head2 TF_ServerStop

=over 2

  Stops an in-process TensorFlow server.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_ServerStop(TF_Server* server, TF_Status* status);

=head2 TF_ServerJoin

=over 2

  Blocks until the server has been successfully stopped (via TF_ServerStop or
  TF_ServerClose).

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_ServerJoin(TF_Server* server, TF_Status* status);

=head2 TF_ServerTarget

=over 2

  Returns the target string that can be provided to TF_SetTarget() to connect
  a TF_Session to `server`.
  
  The returned string is valid only until TF_DeleteServer is invoked.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern const char* TF_ServerTarget(TF_Server* server);

=head2 TF_DeleteServer

=over 2

  Destroy an in-process TensorFlow server, frees memory. If server is running
  it will be stopped and joined.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_DeleteServer(TF_Server* server);

=head2 TF_RegisterLogListener

=over 2

  Register a listener method that processes printed messages.
  
  If any listeners are registered, the print operator will call all listeners
  with the printed messages and immediately return without writing to the
  logs.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_RegisterLogListener(
      void (*listener)(const char*));

=head2 TF_RegisterFilesystemPlugin

=over 2

  Register a FileSystem plugin from filename `plugin_filename`.
  
  On success, place OK in status.
  On failure, place an error status in status.

=back

  /* From <tensorflow/c/c_api.h> */
  TF_CAPI_EXPORT extern void TF_RegisterFilesystemPlugin(
      const char* plugin_filename, TF_Status* status);

=head2 TF_NewShape

=over 2

  Return a new, unknown rank shape object. The caller is responsible for
  calling TF_DeleteShape to deallocate and destroy the returned shape.

=back

  /* From <tensorflow/c/tf_shape.h> */
  TF_CAPI_EXPORT extern TF_Shape* TF_NewShape();

=head2 TF_ShapeDims

=over 2

  Returns the rank of `shape`. If `shape` has unknown rank, returns -1.

=back

  /* From <tensorflow/c/tf_shape.h> */
  TF_CAPI_EXPORT extern int TF_ShapeDims(const TF_Shape* shape);

=head2 TF_ShapeDimSize

=over 2

  Returns the `d`th dimension of `shape`. If `shape` has unknown rank,
  invoking this function is undefined behavior. Returns -1 if dimension is
  unknown.

=back

  /* From <tensorflow/c/tf_shape.h> */

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


=head2 TF_FileStat

=over 2

  Obtains statistics for the given path. If status is TF_OK, *stats is
  updated, otherwise it is not touched.

=back

  /* From <tensorflow/c/env.h> */
  TF_CAPI_EXPORT extern void TF_FileStat(const char* filename,
                                         TF_FileStatistics* stats,
                                         TF_Status* status);

=head2 TF_NewWritableFile

=over 2

  Creates or truncates the given filename and returns a handle to be used for
  appending data to the file. If status is TF_OK, *handle is updated and the
  caller is responsible for freeing it (see TF_CloseWritableFile).

=back

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

=head2 TF_CloseWritableFile

=over 2

  Closes the given handle and frees its memory. If there was a problem closing
  the file, it is indicated by status. Memory is freed in any case.

=back

  /* From <tensorflow/c/env.h> */
  TF_CAPI_EXPORT extern void TF_CloseWritableFile(TF_WritableFileHandle* handle,
                                                  TF_Status* status);

=head2 TF_SyncWritableFile

=over 2

  Syncs content of the handle to the filesystem. Blocks waiting for the
  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

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


=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern TFE_MonitoringSampler2* TFE_MonitoringNewSampler2(
      const char* name, TFE_MonitoringBuckets* buckets, TF_Status* out_status,
      const char* description, const char* label1, const char* label2);

=head2 TFE_MonitoringDeleteSampler2

=over 2

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_MonitoringDeleteSampler2(
      TFE_MonitoringSampler2* sampler);

=head2 TFE_MonitoringGetCellSampler2

=over 2

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern TFE_MonitoringSamplerCell* TFE_MonitoringGetCellSampler2(
      TFE_MonitoringSampler2* sampler, const char* label1, const char* label2);

=head2 TFE_ContextOptionsSetTfrt

=over 2

  Sets whether to use TFRT

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_ContextOptionsSetTfrt(TFE_ContextOptions*,
                                                       bool use_tfrt);

=head2 TFE_ContextOptionsSetTfrtDistributedRuntime

=over 2

  Sets whether to use TFRT distributed runtime

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern void TFE_ContextOptionsSetTfrtDistributedRuntime(
      TFE_ContextOptions* options, bool use_tfrt_distributed_runtime);

=head2 TFE_GetContextId

=over 2

  Returns the context_id from the EagerContext which is used by the
  EagerService to maintain consistency between client and worker. The
  context_id is initialized with a dummy value and is later set when the worker
  is initialized (either locally or remotely). The context_id can change during
  the process lifetime although this should cause the worker to be
  reinitialized (e.g. cleared caches) as well.

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern uint64_t TFE_GetContextId(TFE_Context* ctx);

=head2 TFE_NewCancellationManager

=over 2

=back

  /* From <tensorflow/c/eager/c_api_experimental.h> */
  TF_CAPI_EXPORT extern TFE_CancellationManager* TFE_NewCancellationManager();

=head2 TFE_CancellationManagerIsCancelled

=over 2

=back

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

=head2 TFE_CancellationManagerStartCancel

=over 2

=back

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

=head2 TFE_DeleteCancellationManager

=over 2

=back

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

=head2 TFE_OpSetCancellationManager

=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



( run in 0.538 second using v1.01-cache-2.11-cpan-f0fbb3f571b )