AI-TensorFlow-Libtensorflow
view release on metacpan or search on metacpan
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
On failure, null.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern TF_Function* TF_FunctionImportFunctionDef(
const void* proto, size_t proto_len, TF_Status* status);
=head2 TF_FunctionSetAttrValueProto
=over 2
Sets function attribute named `attr_name` to value stored in `proto`.
If this attribute is already set to another value, it is overridden.
`proto` should point to a sequence of bytes of length `proto_len`
representing a binary serialization of an AttrValue protocol
buffer.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern void TF_FunctionSetAttrValueProto(TF_Function* func,
const char* attr_name,
const void* proto,
size_t proto_len,
TF_Status* status);
=head2 TF_FunctionGetAttrValueProto
=over 2
Sets `output_attr_value` to the binary-serialized AttrValue proto
representation of the value of the `attr_name` attr of `func`.
If `attr_name` attribute is not present, status is set to an error.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern void TF_FunctionGetAttrValueProto(
TF_Function* func, const char* attr_name, TF_Buffer* output_attr_value,
TF_Status* status);
=head2 TF_DeleteFunction
=over 2
Frees the memory used by the `func` struct.
TF_DeleteFunction is a noop if `func` is null.
Deleting a function does not remove it from any graphs it was copied to.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern void TF_DeleteFunction(TF_Function* func);
=head2 TF_TryEvaluateConstant
=over 2
Attempts to evaluate `output`. This will only be possible if `output` doesn't
depend on any graph inputs (this function is safe to call if this isn't the
case though).
If the evaluation is successful, this function returns true and `output`s
value is returned in `result`. Otherwise returns false. An error status is
returned if something is wrong with the graph or input. Note that this may
return false even if no error status is set.
=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
( run in 1.010 second using v1.01-cache-2.11-cpan-98e64b0badf )