diff options
author | Akshay Modi <nareshmodi@google.com> | 2018-04-17 13:31:54 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-17 13:37:34 -0700 |
commit | 1628d18d24400f08b768b545f839e32b44a097c7 (patch) | |
tree | c730557253fbb8cff729e4e1860cb89ba7b9d1ea | |
parent | 197572bd517a4bc6f4850dfecf3288818d8d84ee (diff) |
Use is_constructible instead of is_convertible.
Before this, all objects would follow the slow path (since nothing is
convertible to AlphaNum since it has a private copy constructor).
Before:
entry {
name: "MicroBenchmarks.benchmark_defun_matmul_2_by_2_CPU"
iters: 30000
wall_time: 67.5895690918
extras {
key: "examples_per_sec"
value {
double_value: 14795.1823549
}
}
}
After:
entry {
name: "MicroBenchmarks.benchmark_defun_matmul_2_by_2_CPU"
iters: 30000
wall_time: 61.0044002533
extras {
key: "examples_per_sec"
value {
double_value: 16392.2601623
}
}
}
PiperOrigin-RevId: 193247183
-rw-r--r-- | tensorflow/core/lib/core/errors.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/core/lib/core/errors.h b/tensorflow/core/lib/core/errors.h index 1a0f4be2ea..51c09032df 100644 --- a/tensorflow/core/lib/core/errors.h +++ b/tensorflow/core/lib/core/errors.h @@ -42,7 +42,7 @@ namespace internal { // Eventually absl::strings will have native support for this and we will be // able to completely remove PrepareForStrCat(). template <typename T> -typename std::enable_if<!std::is_convertible<T, strings::AlphaNum>::value, +typename std::enable_if<!std::is_constructible<strings::AlphaNum, T>::value, string>::type PrepareForStrCat(const T& t) { std::stringstream ss; |