aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib
diff options
context:
space:
mode:
authorGravatar Tim Shen <timshen@google.com>2018-08-27 17:29:40 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-27 17:33:02 -0700
commitc7173ca08a06145439362280517bd1e741ee8c7b (patch)
treeb5048468d1da11a45fd8bd7c9b37577388a14b1c /tensorflow/core/lib
parent1e1cf3ea4fa161727ba5fed5fad05ed1b243fcef (diff)
Remove tensorflow::gtl::{Mutable,}ArraySlice's old API that don't show up in absl::Span, so that transitioning to the latter is easier.
PiperOrigin-RevId: 210461037
Diffstat (limited to 'tensorflow/core/lib')
-rw-r--r--tensorflow/core/lib/gtl/array_slice.h7
-rw-r--r--tensorflow/core/lib/gtl/array_slice_test.cc14
2 files changed, 6 insertions, 15 deletions
diff --git a/tensorflow/core/lib/gtl/array_slice.h b/tensorflow/core/lib/gtl/array_slice.h
index 4ecc96ee79..b773a65569 100644
--- a/tensorflow/core/lib/gtl/array_slice.h
+++ b/tensorflow/core/lib/gtl/array_slice.h
@@ -187,8 +187,6 @@ class ArraySlice {
void remove_prefix(size_type n) { impl_.remove_prefix(n); }
void remove_suffix(size_type n) { impl_.remove_suffix(n); }
- void pop_back() { remove_suffix(1); }
- void pop_front() { remove_prefix(1); }
// These relational operators have the same semantics as the
// std::vector<T> relational operators: they do deep (element-wise)
@@ -286,8 +284,6 @@ class MutableArraySlice {
void remove_prefix(size_type n) { impl_.remove_prefix(n); }
void remove_suffix(size_type n) { impl_.remove_suffix(n); }
- void pop_back() { remove_suffix(1); }
- void pop_front() { remove_prefix(1); }
bool operator==(ArraySlice<T> other) const {
return ArraySlice<T>(*this) == other;
@@ -296,9 +292,6 @@ class MutableArraySlice {
return ArraySlice<T>(*this) != other;
}
- // DEPRECATED(jacobsa): Please use data() instead.
- pointer mutable_data() const { return impl_.data(); }
-
private:
Impl impl_;
};
diff --git a/tensorflow/core/lib/gtl/array_slice_test.cc b/tensorflow/core/lib/gtl/array_slice_test.cc
index 4d3da85b88..c798a488cb 100644
--- a/tensorflow/core/lib/gtl/array_slice_test.cc
+++ b/tensorflow/core/lib/gtl/array_slice_test.cc
@@ -73,13 +73,13 @@ static void TestHelper(const IntSlice& vorig, const IntVec& vec) {
if (len > 0) {
EXPECT_EQ(0, v.front());
EXPECT_EQ(len - 1, v.back());
- v.pop_back();
+ v.remove_suffix(1);
EXPECT_EQ(len - 1, v.size());
for (size_t i = 0; i < v.size(); ++i) {
EXPECT_EQ(i, v[i]);
}
if (len > 1) {
- v.pop_front();
+ v.remove_prefix(1);
EXPECT_EQ(len - 2, v.size());
for (size_t i = 0; i < v.size(); ++i) {
EXPECT_EQ(i + 1, v[i]);
@@ -128,7 +128,7 @@ static void MutableTestHelper(const MutableIntSlice& vorig, int* ptr,
MutableIntSlice other; // To test the assignment return value.
MutableIntSlice v = other = vorig;
- EXPECT_EQ(ptr, v.mutable_data());
+ EXPECT_EQ(ptr, v.data());
int counter = 0;
for (MutableIntSlice::iterator it = v.begin(); it != v.end(); ++it) {
@@ -142,17 +142,17 @@ static void MutableTestHelper(const MutableIntSlice& vorig, int* ptr,
v[0] = 1;
v.front() = 2;
v.back() = 5;
- *v.mutable_data() = 4;
+ *v.data() = 4;
std::fill(v.begin(), v.end(), 5);
std::fill(v.rbegin(), v.rend(), 6);
// Test size-changing methods.
- v.pop_back();
+ v.remove_suffix(1);
EXPECT_EQ(len - 1, v.size());
for (size_t i = 0; i < v.size(); ++i) {
EXPECT_EQ(ptr + i, &v[i]);
}
if (len > 1) {
- v.pop_front();
+ v.remove_prefix(1);
EXPECT_EQ(len - 2, v.size());
for (size_t i = 0; i < v.size(); ++i) {
EXPECT_EQ(ptr + i + 1, &v[i]);
@@ -605,7 +605,6 @@ TEST(MutableIntSlice, IteratorsAndReferences) {
MutableIntSlice s = a;
accept_pointer(s.data());
- accept_pointer(s.mutable_data());
accept_iterator(s.begin());
accept_iterator(s.end());
accept_reverse_iterator(s.rbegin());
@@ -627,7 +626,6 @@ TEST(MutableIntSlice, IteratorsAndReferences_Const) {
const MutableIntSlice s = a;
accept_pointer(s.data());
- accept_pointer(s.mutable_data());
accept_iterator(s.begin());
accept_iterator(s.end());
accept_reverse_iterator(s.rbegin());