aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <bsteiner@google.com>2018-01-02 14:44:55 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-02 14:49:32 -0800
commit6bafe0d6b8d7c2496433a2b250c4fd9dd83e85b7 (patch)
treebe913b8613ec10dcd0142c9113912c9a648e8452
parent58a77fad5539454e674629d45df569af35453b02 (diff)
Deleted dead code
PiperOrigin-RevId: 180595771
-rw-r--r--tensorflow/core/grappler/utils.cc35
-rw-r--r--tensorflow/core/grappler/utils.h16
2 files changed, 0 insertions, 51 deletions
diff --git a/tensorflow/core/grappler/utils.cc b/tensorflow/core/grappler/utils.cc
index fc80772360..8099214c2b 100644
--- a/tensorflow/core/grappler/utils.cc
+++ b/tensorflow/core/grappler/utils.cc
@@ -114,41 +114,6 @@ void NodeMap::UpdateOutput(const string& node_name,
outputs.insert(nodes_[NodeName(new_output_name)]);
}
-OutputMap::OutputMap(GraphDef* graph) : graph_(graph) {
- for (int i = 0; i < graph_->node_size(); i++) {
- auto node = graph_->mutable_node(i);
- auto rslt = nodes_.emplace(node->name(), node);
- // Check that the graph doesn't contain multiple nodes with the same name.
- CHECK(rslt.second);
- for (const auto& input : node->input()) {
- string input_node = NodeName(input);
- if (outputs_[input_node].count(node) == 0) {
- outputs_[input_node].insert(std::make_pair(node, 1));
- } else {
- outputs_[input_node][node]++;
- }
- }
- }
-}
-
-NodeDef* OutputMap::GetNode(const string& name) const {
- string node_name = NodeName(name);
- auto it = nodes_.find(node_name);
- if (it == nodes_.end()) {
- return nullptr;
- }
- return it->second;
-}
-
-const std::unordered_map<NodeDef*, int>& OutputMap::GetOutputs(
- const string& node_name) const {
- auto it = outputs_.find(node_name);
- if (it == outputs_.end()) {
- return empty_map_;
- }
- return it->second;
-}
-
bool IsSameInput(const string& name1, const string& name2) {
if (name1 == name2) {
return true;
diff --git a/tensorflow/core/grappler/utils.h b/tensorflow/core/grappler/utils.h
index 476ab8b51a..c04a9a666d 100644
--- a/tensorflow/core/grappler/utils.h
+++ b/tensorflow/core/grappler/utils.h
@@ -59,22 +59,6 @@ class NodeMap {
std::unordered_map<string, std::set<NodeDef*>> outputs_;
};
-// A utility class to lookup a node's outputs and the number of times it
-// presents in each output.
-class OutputMap {
- public:
- explicit OutputMap(GraphDef* graph);
- NodeDef* GetNode(const string& name) const;
- const std::unordered_map<NodeDef*, int>& GetOutputs(
- const string& node_name) const;
-
- private:
- GraphDef* graph_;
- std::unordered_map<NodeDef*, int> empty_map_;
- std::unordered_map<string, NodeDef*> nodes_;
- std::unordered_map<string, std::unordered_map<NodeDef*, int>> outputs_;
-};
-
// A vector with a set. The set stores the same elements as the vector, and
// quickly answers whether a value is in the vector. Duplicated elements are not
// allowed for now.