Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
QiJune committed Feb 1, 2018
1 parent 85f812a commit 49b768f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 77 deletions.
14 changes: 0 additions & 14 deletions paddle/framework/scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License. */

#include <memory> // for unique_ptr
#include <mutex> // for call_once
#include <set>
#include "glog/logging.h"
#include "paddle/framework/threadpool.h"
#include "paddle/string/printf.h"
Expand Down Expand Up @@ -77,19 +76,6 @@ const Scope* Scope::FindScope(const Variable* var) const {
}
return (parent_ == nullptr) ? nullptr : parent_->FindScope(var);
}

void Scope::EraseVars(std::vector<std::string>& var_names) {
std::set<std::string> var_set(var_names.begin(), var_names.end());
for (auto it = vars_.begin(); it != vars_.end();) {
if (var_set.find(it->first) != var_set.end()) {
delete it->second;
it = vars_.erase(it);
} else {
++it;
}
}
}

void Scope::DropKids() {
for (Scope* s : kids_) delete s;
kids_.clear();
Expand Down
2 changes: 0 additions & 2 deletions paddle/framework/scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ class Scope {
/// Drop all kids scopes belonged to this scope.
void DropKids();

void EraseVars(std::vector<std::string>& var_names);

// enumerate all the variables current contains.
std::vector<std::string> LocalVarNames() const;

Expand Down
57 changes: 0 additions & 57 deletions paddle/operators/delete_var_op.cc

This file was deleted.

4 changes: 0 additions & 4 deletions python/paddle/v2/fluid/memory_optimization_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ def check_var_validity(block_desc, x, is_forward):
for var_name in can_optimize:
self.pool.append((var_name, self._find_var(
block_desc, var_name, is_forward).shape()))
var_names = [x[0] for x in self.pool]
op_desc = self.current_block_desc.append_op()
op_desc.set_type("delete_var")
op_desc.set_input("X", var_names)


def get_cfgs(input_program):
Expand Down

0 comments on commit 49b768f

Please sign in to comment.