diff options
author | karl@kubx.ca <karl@kubx.ca> | 2018-07-08 00:21:45 -0400 |
---|---|---|
committer | karl@kubx.ca <karl@kubx.ca> | 2018-07-25 21:10:30 -0400 |
commit | 7ebdc9834bbc583bcc42551b660c8ed256ea7416 (patch) | |
tree | fd5d4d733834c102943917d6259cb31f67293120 /tensorflow/c/c_api.h | |
parent | ab063cd57d7eda73bcbaf11d43f8b2e6708979a3 (diff) |
1st code review: rename 'scope_name' to 'prefix', etc.
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r-- | tensorflow/c/c_api.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h index e896f68ce0..8e49158957 100644 --- a/tensorflow/c/c_api.h +++ b/tensorflow/c/c_api.h @@ -1129,6 +1129,15 @@ TF_CAPI_EXPORT extern void TF_FinishWhile(const TF_WhileParams* params, // called after a successful TF_NewWhile() call. TF_CAPI_EXPORT extern void TF_AbortWhile(const TF_WhileParams* params); +// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s. +// +// This method is the equivalent of calling TF_AddGradientsWithPrefix with a +// nullptr prefix (which will create all gradients operations under "gradients/" +// by default). See TF_AddGradientsWithPrefix for more details. +TF_CAPI_EXPORT void TF_AddGradients(TF_Graph* g, TF_Output* y, int ny, + TF_Output* x, int nx, TF_Output* dx, + TF_Status* status, TF_Output* dy); + // Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, // i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... // `dx` are used as initial gradients (which represent the symbolic partial @@ -1138,18 +1147,18 @@ TF_CAPI_EXPORT extern void TF_AbortWhile(const TF_WhileParams* params); // shapes in `y`. // The partial derivatives are returned in `dy`. `dy` should be allocated to // size `nx`. -// `scope_name` names the scope (or sub-scope) into which all gradients -// operations are added. If `scope_name` is nullptr, "gradients" is used by -// default. +// `prefix` names the scope into which all gradients operations are being added. +// If `prefix` is nullptr, "gradients" is used by default. // // WARNING: This function does not yet support all the gradients that python // supports. See // https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md // for instructions on how to add C++ more gradients. -TF_CAPI_EXPORT void TF_AddGradients(TF_Graph* g, const char* scope_name, - TF_Output* y, int ny, - TF_Output* x, int nx, TF_Output* dx, - TF_Status* status, TF_Output* dy); +TF_CAPI_EXPORT void TF_AddGradientsWithPrefix(TF_Graph* g, const char* prefix, + TF_Output* y, int ny, + TF_Output* x, int nx, + TF_Output* dx, TF_Status* status, + TF_Output* dy); // Create a TF_Function from a TF_Graph // |