Commit eb61daae authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

[C API]: Bugfix for TF_AddGradients.

TF_AddGradients could create nodes in the graph with names that conflicted with
other nodes in the graph. This would most clearly happen if TF_AddGradients()
was called twice on the same graph, and could also happen if there were other
nodes in the graph that happened to have "gradients" as a prefix of their name.

Fix that.

The added test in c_api_test.cc would fail in the call to TF_SessionRun() with
  Node 'gradients/OnesLike' is not unique
without the changes to c_api.cc and c_api_internal.h

While at it, also fixed a possible name collision bug when using the C++ API
to constructor graphs (using Scope).

Thanks @karllessard for pointing this out.

PiperOrigin-RevId: 202087996
parent 22c06a62
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment