未验证 提交 1da32806 编写于 作者: 石晓伟 提交者: GitHub

inference modification for custom operator, test=develop (#31283)

上级 cc89120a
...@@ -667,10 +667,6 @@ void RegisterOperatorWithMetaInfo( ...@@ -667,10 +667,6 @@ void RegisterOperatorWithMetaInfo(
void RegisterOperatorWithMetaInfoMap( void RegisterOperatorWithMetaInfoMap(
const paddle::OpMetaInfoMap& op_meta_info_map) { const paddle::OpMetaInfoMap& op_meta_info_map) {
auto& meta_info_map = op_meta_info_map.GetMap(); auto& meta_info_map = op_meta_info_map.GetMap();
PADDLE_ENFORCE_EQ(meta_info_map.empty(), false,
platform::errors::PreconditionNotMet(
"No custom operator that needs to be registered."));
VLOG(1) << "Custom Operator: size of op meta info map - " VLOG(1) << "Custom Operator: size of op meta info map - "
<< meta_info_map.size(); << meta_info_map.size();
// pair: {op_type, OpMetaInfo} // pair: {op_type, OpMetaInfo}
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "paddle/fluid/extension/include/ext_op_meta_info.h"
#include "paddle/fluid/framework/feed_fetch_method.h" #include "paddle/fluid/framework/feed_fetch_method.h"
#include "paddle/fluid/framework/feed_fetch_type.h" #include "paddle/fluid/framework/feed_fetch_type.h"
#include "paddle/fluid/framework/ir/fuse_pass_base.h" #include "paddle/fluid/framework/ir/fuse_pass_base.h"
...@@ -617,6 +618,7 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor< ...@@ -617,6 +618,7 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
static bool process_level_allocator_enabled; static bool process_level_allocator_enabled;
std::call_once(gflags_initialized, [&]() { std::call_once(gflags_initialized, [&]() {
paddle::RegisterAllCustomOperator();
std::vector<std::string> gflags; std::vector<std::string> gflags;
PADDLE_ENFORCE_GE( PADDLE_ENFORCE_GE(
config.memory_pool_init_size_mb(), 0.f, config.memory_pool_init_size_mb(), 0.f,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册