aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/util.h
diff options
context:
space:
mode:
authorGravatar Tim Shen <timshen@google.com>2018-08-30 11:20:16 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-30 11:29:03 -0700
commit09f2c342c0e74834bebf8045d5e77dcef8323539 (patch)
tree3a969695f54840366629df7f39e4da7f9ac103cd /tensorflow/compiler/xla/util.h
parent9e12f1df3270b5e0b310645e6c3cae9fbd3f5dfc (diff)
Remove (Mutable)ArraySlice implementation and alias them to absl::Span.
There are several API migrations happening: * ArraySlice's sub-slice constructor => .subspan * MutableArraySlice's container pointer constructor => absl::MakeSpan PiperOrigin-RevId: 210946124
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);