From abbe382e1e683fa183256dd0f927057b7c8d9155 Mon Sep 17 00:00:00 2001 From: zhang wenhui Date: Mon, 3 Dec 2018 20:46:36 +0800 Subject: [PATCH] Revert "Add EstiminateFlops" --- paddle/fluid/framework/details/op_registry.h | 20 +++----------------- paddle/fluid/framework/op_info.h | 7 ------- paddle/fluid/framework/type_defs.h | 2 -- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/paddle/fluid/framework/details/op_registry.h b/paddle/fluid/framework/details/op_registry.h index 1ce18c3d6..eea7e712f 100644 --- a/paddle/fluid/framework/details/op_registry.h +++ b/paddle/fluid/framework/details/op_registry.h @@ -32,9 +32,7 @@ enum OpInfoFillType { kOpProtoAndCheckerMaker = 1, kGradOpDescMaker = 2, kVarTypeInference = 3, - kShapeInference = 4, - kEstimateFlops = 5, - kUnknown = -1 + kShapeInference = 4 }; template @@ -50,10 +48,8 @@ struct OpInfoFillTypeID { ? kVarTypeInference : (std::is_base_of::value ? kShapeInference - : (std::is_base_of::value - ? kEstimateFlops - : kUnknown))))); + : static_cast( + -1))))); } }; @@ -143,16 +139,6 @@ struct OpInfoFiller { } }; -template -struct OpInfoFiller { - void operator()(const char* op_tpe, OpInfo* info) const { - info->estimate_flops_ = [](InferShapeContext* ctx) { - T estimate_flops; - return estimate_flops(ctx); - }; - } -}; - } // namespace details } // namespace framework diff --git a/paddle/fluid/framework/op_info.h b/paddle/fluid/framework/op_info.h index e0bf5ed99..19e5c2c73 100644 --- a/paddle/fluid/framework/op_info.h +++ b/paddle/fluid/framework/op_info.h @@ -31,12 +31,6 @@ class InferShapeBase { virtual void operator()(InferShapeContext*) const = 0; }; -class EstimateFlopsBase { - public: - virtual ~EstimateFlopsBase() = default; - virtual size_t operator()(InferShapeContext*) const = 0; -}; - struct OpInfo { OpCreator creator_; GradOpMakerFN grad_op_maker_; @@ -44,7 +38,6 @@ struct OpInfo { OpAttrChecker* checker_{nullptr}; InferVarTypeFN infer_var_type_; InferShapeFN infer_shape_; - EstimateFlopsFN estimate_flops_; bool HasOpProtoAndChecker() const { return proto_ != nullptr && checker_ != nullptr; diff --git a/paddle/fluid/framework/type_defs.h b/paddle/fluid/framework/type_defs.h index cdc5fa686..2de6233a9 100644 --- a/paddle/fluid/framework/type_defs.h +++ b/paddle/fluid/framework/type_defs.h @@ -54,7 +54,5 @@ using InferVarTypeFN = using InferShapeFN = std::function; -using EstimateFlopsFN = std::function; - } // namespace framework } // namespace paddle -- GitLab