diff options
author | Justin Lebar <jlebar@google.com> | 2017-03-20 10:37:19 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-03-20 11:53:04 -0700 |
commit | e08f942562f5aa94d5dcc5906ed372c48e90f29f (patch) | |
tree | ce49aafe7623b203de54bc694ef3d901cdb28bf3 | |
parent | 22e367e2faccc5b851e31931002b47f051c4f829 (diff) |
Delete xla::DifferentialSet. It's dead code.
Change: 150653208
-rw-r--r-- | tensorflow/compiler/xla/BUILD | 19 | ||||
-rw-r--r-- | tensorflow/compiler/xla/differential_set.h | 63 | ||||
-rw-r--r-- | tensorflow/compiler/xla/differential_set_test.cc | 51 |
3 files changed, 0 insertions, 133 deletions
diff --git a/tensorflow/compiler/xla/BUILD b/tensorflow/compiler/xla/BUILD index 0f2a46c11d..e73a29ddee 100644 --- a/tensorflow/compiler/xla/BUILD +++ b/tensorflow/compiler/xla/BUILD @@ -359,25 +359,6 @@ cc_library( ) cc_library( - name = "differential_set", - hdrs = ["differential_set.h"], - visibility = [":internal"], - deps = [ - "//tensorflow/core:lib", - ], -) - -cc_test( - name = "differential_set_test", - srcs = ["differential_set_test.cc"], - deps = [ - ":differential_set", - "//tensorflow/core:test", - "//tensorflow/core:test_main", - ], -) - -cc_library( name = "packed_literal_reader", srcs = ["packed_literal_reader.cc"], hdrs = ["packed_literal_reader.h"], diff --git a/tensorflow/compiler/xla/differential_set.h b/tensorflow/compiler/xla/differential_set.h deleted file mode 100644 index e7ebd8c04b..0000000000 --- a/tensorflow/compiler/xla/differential_set.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#ifndef TENSORFLOW_COMPILER_XLA_DIFFERENTIAL_SET_H_ -#define TENSORFLOW_COMPILER_XLA_DIFFERENTIAL_SET_H_ - -#include <unordered_set> - -#include "tensorflow/core/platform/macros.h" - -namespace xla { - -// In the base case, the differential set is just a set. -// However, you can also point a differential set at another differential set to -// use as a "parent". This makes a chain of sets, which each node in the chain -// adds some number of elements to the "Contains" property. -// -// E.g. if the base set holds {1, 2}, you can create a derived set that holds -// {3}, and the derived set will tell you it contains {1, 2, 3} whereas the base -// will continue to tell you it holds only {1, 2}. -template <typename T> -class DifferentialSet { - public: - // Constructs a differential set capable of holding values. It may have an - // ancestor link, which would it into a chain of sets. - explicit DifferentialSet(const DifferentialSet* parent = nullptr) - : parent_(parent) {} - - // Adds a value to be held directly by this set. - void Add(T value) { held_.insert(value); } - - // Returns whether this set holds the given value, or any ancestor in the - // chain of sets. - bool Contains(T value) const { - return held_.find(value) != held_.end() || - (parent_ != nullptr && parent_->Contains(value)); - } - - private: - // Values held directly by this node in the chain of sets. - std::unordered_set<T> held_; - - // Parent node in the chain of sets. - const DifferentialSet* parent_; - - TF_DISALLOW_COPY_AND_ASSIGN(DifferentialSet); -}; - -} // namespace xla - -#endif // TENSORFLOW_COMPILER_XLA_DIFFERENTIAL_SET_H_ diff --git a/tensorflow/compiler/xla/differential_set_test.cc b/tensorflow/compiler/xla/differential_set_test.cc deleted file mode 100644 index dacbbcc1ad..0000000000 --- a/tensorflow/compiler/xla/differential_set_test.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#include "tensorflow/compiler/xla/differential_set.h" - -#include "tensorflow/core/platform/test.h" - -namespace xla { -namespace { - -TEST(DifferentialSetTest, TellsWhetherSetContainsSomethingHeld) { - DifferentialSet<int> set; - set.Add(1); - set.Add(2); - EXPECT_FALSE(set.Contains(3)); - EXPECT_TRUE(set.Contains(1)); - EXPECT_TRUE(set.Contains(2)); - EXPECT_FALSE(set.Contains(0)); -} - -TEST(DifferentialSetTest, TellsWhetherSetContainsSomethingParentHolds) { - DifferentialSet<int> parent; - parent.Add(1); - DifferentialSet<int> child(&parent); - child.Add(2); - - // Test properties of the child. - EXPECT_FALSE(child.Contains(3)); - EXPECT_TRUE(child.Contains(1)); - EXPECT_TRUE(child.Contains(2)); - EXPECT_FALSE(child.Contains(0)); - - // Test properties of the parent. - EXPECT_TRUE(parent.Contains(1)); - EXPECT_FALSE(parent.Contains(2)); -} - -} // namespace -} // namespace xla |