diff --git a/paddle/fluid/imperative/tracer.cc b/paddle/fluid/imperative/tracer.cc index 7b160cd22b3cb707126f16679b000142fd80865c..c7987200072b71f77e7aacc381455d802b30a376 100644 --- a/paddle/fluid/imperative/tracer.cc +++ b/paddle/fluid/imperative/tracer.cc @@ -20,12 +20,6 @@ namespace paddle { namespace imperative { -struct OpBaseCmp { - bool operator()(OpBase* first, OpBase* second) { - return first->id() > second->id(); - } -}; - static std::vector> CreateGradOpBases( const OpBase* fw_op_base, const NameVarBaseMap& in, const NameVarBaseMap& out) { @@ -130,7 +124,7 @@ void Tracer::TraceBackward(const std::shared_ptr& fwd_op, } } - std::set visited_preceding_ops; + std::set visited_preceding_ops; for (auto& grad_out_it : grad_out) { bool flag_clear_list = false; for (auto& var_base_it : grad_out_it.second) {