From 252d41655ac1685dad796c689fb12f9bafb62ae3 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 14 Aug 2017 20:17:48 +0800 Subject: [PATCH] clean code --- paddle/framework/op_registry.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/paddle/framework/op_registry.h b/paddle/framework/op_registry.h index af965df7ec9..a8c960effe1 100644 --- a/paddle/framework/op_registry.h +++ b/paddle/framework/op_registry.h @@ -162,11 +162,8 @@ class OpRegistry { auto op_create_it = op_creators().find(type); PADDLE_ENFORCE(op_create_it != op_creators().end(), "Operator %s cannot be found.", type); - - auto attrMap = attrs; - op_checkers().at(type).Check(attrMap); - auto op = op_create_it->second(type, inputs, outputs, attrMap); - GenerateTempVariableName(op); + op_checkers().at(type).Check(attrs); + auto op = op_create_it->second(type, inputs, outputs, attrs); return std::shared_ptr(op); } @@ -217,21 +214,6 @@ class OpRegistry { static std::unordered_map op_checkers_; return op_checkers_; } - - static void GenerateTempVariableName(OperatorBase* op) { - static std::atomic gUniqId(0UL); - for (auto& output : op->Outputs()) { - for (auto& output_name : output.second) { - if (output_name == kTempVarName) { - auto new_name = output_name; - new_name += op->Type(); - new_name += "@"; - new_name += std::to_string(gUniqId.fetch_add(1)); - op->Rename(output_name, new_name); - } - } - } - } }; class Registrar { -- GitLab