AI-TensorFlow-Libtensorflow

 view release on metacpan or  search on metacpan

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

   tags - char* array of SavedModel tags. We will load the metagraph matching
          the tags.
   tags_len - number of elements in the `tags` array.
   status - Set to OK on success and an appropriate error on failure.
  Returns:
   If status is not OK, returns nullptr. Otherwise, returns a newly created
   TF_SavedModel instance. It must be deleted by calling TF_DeleteSavedModel.

=back

  /* From <tensorflow/c/experimental/saved_model/public/saved_model_api.h> */
  TF_CAPI_EXPORT extern TF_SavedModel* TF_LoadSavedModelWithTags(
      const char* dirname, TFE_Context* ctx, const char* const* tags,
      int tags_len, TF_Status* status);

=head2 TF_DeleteSavedModel

=over 2

  Deletes a TF_SavedModel, and frees any resources owned by it.

=back

  /* From <tensorflow/c/experimental/saved_model/public/saved_model_api.h> */
  TF_CAPI_EXPORT extern void TF_DeleteSavedModel(TF_SavedModel* model);

=head2 TF_GetSavedModelConcreteFunction

=over 2

  Retrieve a function from the TF2 SavedModel via function path.
  
  Params:
   model - The TF2 SavedModel to load a function from.
   function_path - A string containing the path from the root saved python
                   object to a tf.function method.
                   TODO(bmzhao): Add a detailed example of this with a
                   python tf.module before moving this out of experimental.
   status - Set to OK on success and an appropriate error on failure.
  Returns:
   If status is not OK, returns nullptr. Otherwise, returns a
   TF_ConcreteFunction instance. The lifetime of this instance is
   "conceptually" bound to `model`. Once `model` is deleted, all
   `TF_ConcreteFunctions` retrieved from it are invalid, and have been deleted.

=back

  /* From <tensorflow/c/experimental/saved_model/public/saved_model_api.h> */
  TF_CAPI_EXPORT extern TF_ConcreteFunction* TF_GetSavedModelConcreteFunction(
      TF_SavedModel* model, const char* function_path, TF_Status* status);

=head2 TF_GetSavedModelSignatureDefFunction

=over 2

  Retrieve a function from the TF SavedModel via a SignatureDef key.
  
  Params:
   model - The SavedModel to load a function from.
   signature_def_key - The string key of the SignatureDef map of a SavedModel:
                       https://github.com/tensorflow/tensorflow/blob/69b08900b1e991d84bce31f3b404f5ed768f339f/tensorflow/core/protobuf/meta_graph.proto#L89
   status - Set to OK on success and an appropriate error on failure.
  Returns:
   If status is not OK, returns nullptr. Otherwise, returns a
   TF_SignatureDefFunction instance. Once `model` is deleted, all
   `TF_SignatureDefFunctions` retrieved from it are invalid, and have been
   deleted.

=back

  /* From <tensorflow/c/experimental/saved_model/public/saved_model_api.h> */
  TF_CAPI_EXPORT extern TF_SignatureDefFunction*
  TF_GetSavedModelSignatureDefFunction(TF_SavedModel* model,
                                       const char* signature_def_key,
                                       TF_Status* status);

=head2 TF_ConcreteFunctionGetMetadata

=over 2

  Returns FunctionMetadata associated with `func`. Metadata's lifetime is
  bound to `func`, which is bound to the TF_SavedModel it was loaded from.

=back

  /* From <tensorflow/c/experimental/saved_model/public/concrete_function.h> */
  TF_CAPI_EXPORT extern TF_FunctionMetadata* TF_ConcreteFunctionGetMetadata(
      TF_ConcreteFunction* func);

=head2 TF_ConcreteFunctionMakeCallOp

=over 2

  Returns a TFE_Op suitable for executing this function. Caller must provide
  all function inputs in `inputs`, and must not add any additional inputs on
  the returned op. (i.e. don't call TFE_OpAddInput or TFE_OpAddInputList).
  The caller is responsible for deleting the returned TFE_Op. If op
  construction fails, `status` will be non-OK and the returned pointer will be
  null.
  TODO(bmzhao): Remove this function in a subsequent change; Design + implement
  a Function Execution interface for ConcreteFunction that accepts a tagged
  union of types (tensorflow::Value). This effectively requires moving much of
  the implementation of function.py/def_function.py to C++, and exposing a
  high-level API here. A strawman for what this interface could look like:
  TF_Value* TF_ExecuteFunction(TFE_Context*, TF_ConcreteFunction*, TF_Value*
  inputs, int num_inputs, TF_Status* status);

=back

  /* From <tensorflow/c/experimental/saved_model/public/concrete_function.h> */
  TF_CAPI_EXPORT extern TFE_Op* TF_ConcreteFunctionMakeCallOp(
      TF_ConcreteFunction* func, TFE_TensorHandle** inputs, int num_inputs,
      TF_Status* status);

=head2 TF_SignatureDefParamName

=over 2

  Returns the name of the given parameter. The caller is not responsible for
  freeing the returned char*.



( run in 0.972 second using v1.01-cache-2.11-cpan-39bf76dae61 )