aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-06-25 10:52:47 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-25 10:55:16 -0700
commit6ee30009ae0bfb827c1a42159531262088c06055 (patch)
tree7bcdc4cf39f11268d9b6b38e7f7364804afc48c0 /tensorflow/core/graph
parent6bd07b74e0129d985950ff034f8eb17fd6455669 (diff)
Fix MacOS build.
MacOS builds were failing with errors like the following: In file included from tensorflow/core/graph/graph_constructor.cc:16: In file included from ./tensorflow/core/graph/graph_constructor.h:19: In file included from bazel-out/darwin-opt/genfiles/tensorflow/core/framework/graph.pb.h:7: In file included from /Applications/Xcode_8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439: In file included from /Applications/Xcode_8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627: /Applications/Xcode_8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:280:38: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration ,typename enable_if<is_convertible<const _U1&, _T1>::value && ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./tensorflow/core/graph/tensor_id.h:66:15: note: in instantiation of member function 'std::__1::pair<std::__1::basic_string<char>, int>::pair' requested here using Base::pair; ^ tensorflow/core/graph/graph_constructor.cc:411:28: note: while substituting deduced template arguments into function template 'SafeTensorId' [with _U1 = tensorflow::StringPiece, _U2 = int] TensorId src = mapping.first; ^ I'm still not exactly sure what the problem is and why it doesn't affect all compilers, but for some reason the compiler is trying to construct a SafeTensorId from a StringPiece. My guess is there's a std::pair constructor that takes another pair, and an enable_if isn't working correctly to prevent incompatible types from being ignored. PiperOrigin-RevId: 201980490
Diffstat (limited to 'tensorflow/core/graph')
-rw-r--r--tensorflow/core/graph/tensor_id.cc3
-rw-r--r--tensorflow/core/graph/tensor_id.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/core/graph/tensor_id.cc b/tensorflow/core/graph/tensor_id.cc
index 80c76df255..b5c2c2aac8 100644
--- a/tensorflow/core/graph/tensor_id.cc
+++ b/tensorflow/core/graph/tensor_id.cc
@@ -24,6 +24,9 @@ namespace tensorflow {
TensorId::TensorId(const SafeTensorId& id) : TensorId(id.first, id.second) {}
+SafeTensorId::SafeTensorId(StringPiece str, int idx)
+ : SafeTensorId(str.ToString(), idx) {}
+
SafeTensorId::SafeTensorId(const TensorId& id)
: SafeTensorId(id.first.ToString(), id.second) {}
diff --git a/tensorflow/core/graph/tensor_id.h b/tensorflow/core/graph/tensor_id.h
index bf13fc78a6..b0978b4120 100644
--- a/tensorflow/core/graph/tensor_id.h
+++ b/tensorflow/core/graph/tensor_id.h
@@ -68,6 +68,7 @@ struct SafeTensorId : public std::pair<string, int> {
// NOTE(skyewm): this is required on some platforms. I'm not sure why the
// using statement above isn't always sufficient.
SafeTensorId() : Base() {}
+ SafeTensorId(StringPiece str, int idx);
SafeTensorId(const TensorId& id);
string ToString() const {