aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/util.h')
-rw-r--r--tensorflow/compiler/xla/util.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/tensorflow/compiler/xla/util.h b/tensorflow/compiler/xla/util.h
index 62f486369f..b3343b1506 100644
--- a/tensorflow/compiler/xla/util.h
+++ b/tensorflow/compiler/xla/util.h
@@ -293,9 +293,10 @@ bool IsPermutation(tensorflow::gtl::ArraySlice<int64> permutation, int64 rank);
// Precondition:
// 1. `permutation` is a permutation of 0..permutation.size()-1.
// 2. permutation.size() == input.size().
-template <template <typename...> class C, typename T>
-std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation,
- C<T> input) {
+template <typename Container>
+std::vector<typename Container::value_type> Permute(
+ tensorflow::gtl::ArraySlice<int64> permutation, const Container& input) {
+ using T = typename Container::value_type;
tensorflow::gtl::ArraySlice<T> data(input);
CHECK(IsPermutation(permutation, data.size()));
std::vector<T> output(data.size());
@@ -305,17 +306,6 @@ std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation,
return output;
}
-// Override of the above that works around compile failures with gcc 7.1.1.
-// For details see https://github.com/tensorflow/tensorflow/issues/10843
-// Hide this workaround from MSVC as it causes ambiguous error.
-#ifndef _MSC_VER
-template <typename T>
-std::vector<T> Permute(tensorflow::gtl::ArraySlice<int64> permutation,
- const std::vector<T>& input) {
- return Permute<std::vector, T>(permutation, input);
-}
-#endif
-
// Inverts a permutation, i.e., output_permutation[input_permutation[i]] = i.
std::vector<int64> InversePermutation(
tensorflow::gtl::ArraySlice<int64> input_permutation);