diff options
author | karl@kubx.ca <karl@kubx.ca> | 2018-06-25 22:12:24 -0400 |
---|---|---|
committer | karl@kubx.ca <karl@kubx.ca> | 2018-07-25 21:10:29 -0400 |
commit | 2b303fddafec6b96a6868aaa76f55cc392b96586 (patch) | |
tree | 8b1da320c69ba5239f8bdd37bfac95cd02704d65 /tensorflow/c/c_api.cc | |
parent | b24037513f12a5812a21b7ea92ff904ee9ea6cd8 (diff) |
Add scope name to TF_AddGradients
Diffstat (limited to 'tensorflow/c/c_api.cc')
-rw-r--r-- | tensorflow/c/c_api.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc index 10bc8cdbee..96653154e5 100644 --- a/tensorflow/c/c_api.cc +++ b/tensorflow/c/c_api.cc @@ -2387,8 +2387,9 @@ void TF_FinishWhile(const TF_WhileParams* params, TF_Status* status, void TF_AbortWhile(const TF_WhileParams* params) { FreeWhileResources(params); } -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) { +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) { #ifdef __ANDROID__ status->status = tensorflow::errors::Unimplemented( "Adding gradients is not supported in Android. File a bug at " @@ -2407,7 +2408,7 @@ void TF_AddGradients(TF_Graph* g, TF_Output* y, int ny, TF_Output* x, int nx, tensorflow::Scope scope = NewInternalScope(&g->graph, &status->status, &g->refiner) - .NewSubScope("gradients"); + .NewSubScope(scope_name != nullptr ? scope_name : "gradients"); if (dx != nullptr) { std::vector<tensorflow::Output> dx_arg = OutputsFromTFOutputs(dx, ny); |