aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api_internal.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-08-03 16:48:44 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-03 16:52:15 -0700
commit57626dd38a7867b76c44f3933e7810190174a2ee (patch)
treecc9d6833e5107fe6fb915ca28c597b53c4b0bb3e /tensorflow/c/c_api_internal.h
parent11d900686fd6aa65c26d75ac92e11b437ef4c48c (diff)
Allow specifying colocation constraints through TF_SetAttr*
Before this change, colocation constraint semantics were not well-defined when they were set using TF_ColocateWith and TF_SetAttrStringList and/or TF_SetAttrValueProto. One could get an exception if multiple methods were used. After this change all changes to colocation attribute (i.e. _class) are executed on TF_OperationDescription.colocation_constraints leading to consistent semantics. PiperOrigin-RevId: 164202666
Diffstat (limited to 'tensorflow/c/c_api_internal.h')
-rw-r--r--tensorflow/c/c_api_internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/c/c_api_internal.h b/tensorflow/c/c_api_internal.h
index 89621d8603..f7d25dce8f 100644
--- a/tensorflow/c/c_api_internal.h
+++ b/tensorflow/c/c_api_internal.h
@@ -18,6 +18,7 @@ limitations under the License.
#include "tensorflow/c/c_api.h"
+#include <set>
#include <unordered_map>
#include <vector>
@@ -99,7 +100,7 @@ struct TF_OperationDescription {
tensorflow::NodeBuilder node_builder;
TF_Graph* graph;
- std::vector<tensorflow::string> colocation_constraints;
+ std::set<tensorflow::string> colocation_constraints;
};
struct TF_Operation {