From 065804d39e34090c772517540facb5f407850706 Mon Sep 17 00:00:00 2001 From: zhongpu <2013000149@qq.com> Date: Mon, 4 Nov 2019 10:04:17 +0800 Subject: [PATCH] fix bug in grad_op compute for dygraph, test=develop (#20975) --- paddle/fluid/imperative/tracer.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/paddle/fluid/imperative/tracer.cc b/paddle/fluid/imperative/tracer.cc index 7b160cd22b..c798720007 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) { -- GitLab