diff options
author | 2018-01-17 13:46:17 -0800 | |
---|---|---|
committer | 2018-01-17 13:49:50 -0800 | |
commit | 9eb734b94773fe5422b39b66f1a704b7934167d4 (patch) | |
tree | 4d8fbdb5c5282b239f4e2388344ca96dae862eb7 /tensorflow/c/c_api.h | |
parent | 1bad35937281293d5bd08c1a4030713f85b0e352 (diff) |
Add TF_GraphNumFunctions and TF_GraphGetFunctions
PiperOrigin-RevId: 182263576
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r-- | tensorflow/c/c_api.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h index 17e20e1b70..d2e45341bf 100644 --- a/tensorflow/c/c_api.h +++ b/tensorflow/c/c_api.h @@ -1034,6 +1034,23 @@ TF_CAPI_EXPORT extern void TF_GraphCopyFunction(TF_Graph* g, const TF_Function* grad, TF_Status* status); +// Returns the number of TF_Functions registered in `g`. +TF_CAPI_EXPORT extern int TF_GraphNumFunctions(TF_Graph* g); + +// Fills in `funcs` with the TF_Function* registered in `g`. +// `funcs` must point to an array of TF_Function* of length at least +// `max_func`. In usual usage, max_func should be set to the result of +// TF_GraphNumFunctions(g). In this case, all the functions registered in +// `g` will be returned. Else, an unspecified subset. +// +// If successful, returns the number of TF_Function* successfully set in +// `funcs` and sets status to OK. The caller takes ownership of +// all the returned TF_Functions. They must be deleted with TF_DeleteFunction. +// On error, returns 0, sets status to the encountered error, and the contents +// of funcs will be undefined. +TF_CAPI_EXPORT extern int TF_GraphGetFunctions(TF_Graph* g, TF_Function** funcs, + int max_func, TF_Status* status); + // Note: The following function may fail on very large protos in the future. TF_CAPI_EXPORT extern void TF_OperationToNodeDef(TF_Operation* oper, |