Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
35985007
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
35985007
编写于
10月 17, 2018
作者:
T
Tao Luo
提交者:
GitHub
10月 17, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13867 from Superjomn/clean/CreatePaddlePredictor
clean CreatePaddlePredictor
上级
6447155d
1cfd2b51
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
24 deletion
+9
-24
paddle/fluid/inference/analysis/analyzer_tester.cc
paddle/fluid/inference/analysis/analyzer_tester.cc
+1
-3
paddle/fluid/inference/api/analysis_predictor_tester.cc
paddle/fluid/inference/api/analysis_predictor_tester.cc
+1
-3
paddle/fluid/inference/api/api_tensorrt_subgraph_engine_tester.cc
...luid/inference/api/api_tensorrt_subgraph_engine_tester.cc
+2
-5
paddle/fluid/inference/tests/api/analyzer_rnn1_tester.cc
paddle/fluid/inference/tests/api/analyzer_rnn1_tester.cc
+2
-6
paddle/fluid/inference/tests/api/tester_helper.h
paddle/fluid/inference/tests/api/tester_helper.h
+1
-2
paddle/fluid/inference/tests/api/trt_models_tester.cc
paddle/fluid/inference/tests/api/trt_models_tester.cc
+2
-5
未找到文件。
paddle/fluid/inference/analysis/analyzer_tester.cc
浏览文件 @
35985007
...
@@ -51,9 +51,7 @@ void TestWord2vecPrediction(const std::string& model_path) {
...
@@ -51,9 +51,7 @@ void TestWord2vecPrediction(const std::string& model_path) {
config
.
model_dir
=
model_path
;
config
.
model_dir
=
model_path
;
config
.
use_gpu
=
false
;
config
.
use_gpu
=
false
;
config
.
device
=
0
;
config
.
device
=
0
;
auto
predictor
=
auto
predictor
=
::
paddle
::
CreatePaddlePredictor
<
NativeConfig
>
(
config
);
::
paddle
::
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
config
);
// One single batch
// One single batch
...
...
paddle/fluid/inference/api/analysis_predictor_tester.cc
浏览文件 @
35985007
...
@@ -27,9 +27,7 @@ TEST(AnalysisPredictor, ZeroCopy) {
...
@@ -27,9 +27,7 @@ TEST(AnalysisPredictor, ZeroCopy) {
config
.
model_dir
=
FLAGS_dirname
+
"/word2vec.inference.model"
;
config
.
model_dir
=
FLAGS_dirname
+
"/word2vec.inference.model"
;
config
.
use_feed_fetch_ops
=
false
;
config
.
use_feed_fetch_ops
=
false
;
auto
predictor
=
auto
predictor
=
CreatePaddlePredictor
<
AnalysisConfig
>
(
config
);
CreatePaddlePredictor
<
AnalysisConfig
,
PaddleEngineKind
::
kAnalysis
>
(
config
);
auto
w0
=
predictor
->
GetInputTensor
(
"firstw"
);
auto
w0
=
predictor
->
GetInputTensor
(
"firstw"
);
auto
w1
=
predictor
->
GetInputTensor
(
"secondw"
);
auto
w1
=
predictor
->
GetInputTensor
(
"secondw"
);
...
...
paddle/fluid/inference/api/api_tensorrt_subgraph_engine_tester.cc
浏览文件 @
35985007
...
@@ -41,11 +41,8 @@ void CompareTensorRTWithFluid(bool enable_tensorrt) {
...
@@ -41,11 +41,8 @@ void CompareTensorRTWithFluid(bool enable_tensorrt) {
config1
.
device
=
0
;
config1
.
device
=
0
;
config1
.
max_batch_size
=
10
;
config1
.
max_batch_size
=
10
;
auto
predictor0
=
auto
predictor0
=
CreatePaddlePredictor
<
NativeConfig
>
(
config0
);
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
config0
);
auto
predictor1
=
CreatePaddlePredictor
<
MixedRTConfig
>
(
config1
);
auto
predictor1
=
CreatePaddlePredictor
<
MixedRTConfig
,
PaddleEngineKind
::
kAutoMixedTensorRT
>
(
config1
);
for
(
int
batch_id
=
0
;
batch_id
<
1
;
batch_id
++
)
{
for
(
int
batch_id
=
0
;
batch_id
<
1
;
batch_id
++
)
{
//# 2. Prepare input.
//# 2. Prepare input.
...
...
paddle/fluid/inference/tests/api/analyzer_rnn1_tester.cc
浏览文件 @
35985007
...
@@ -308,18 +308,14 @@ TEST(Analyzer_rnn1, ZeroCopy) {
...
@@ -308,18 +308,14 @@ TEST(Analyzer_rnn1, ZeroCopy) {
PaddlePlace
place
;
PaddlePlace
place
;
int
output_size
{
0
};
int
output_size
{
0
};
auto
predictor
=
auto
predictor
=
CreatePaddlePredictor
<
AnalysisConfig
>
(
config
);
CreatePaddlePredictor
<
AnalysisConfig
,
PaddleEngineKind
::
kAnalysis
>
(
config
);
config
.
use_feed_fetch_ops
=
true
;
config
.
use_feed_fetch_ops
=
true
;
auto
native_predictor
=
auto
native_predictor
=
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
config
);
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
config
);
config
.
use_feed_fetch_ops
=
true
;
// the analysis predictor needs feed/fetch.
config
.
use_feed_fetch_ops
=
true
;
// the analysis predictor needs feed/fetch.
auto
analysis_predictor
=
auto
analysis_predictor
=
CreatePaddlePredictor
<
AnalysisConfig
>
(
config
);
CreatePaddlePredictor
<
AnalysisConfig
,
PaddleEngineKind
::
kAnalysis
>
(
config
);
#define NEW_TENSOR(name__) \
#define NEW_TENSOR(name__) \
auto name__##_tensor = predictor->GetInputTensor(#name__);
auto name__##_tensor = predictor->GetInputTensor(#name__);
...
...
paddle/fluid/inference/tests/api/tester_helper.h
浏览文件 @
35985007
...
@@ -77,8 +77,7 @@ void CompareResult(const std::vector<PaddleTensor> &outputs,
...
@@ -77,8 +77,7 @@ void CompareResult(const std::vector<PaddleTensor> &outputs,
std
::
unique_ptr
<
PaddlePredictor
>
CreateTestPredictor
(
std
::
unique_ptr
<
PaddlePredictor
>
CreateTestPredictor
(
const
AnalysisConfig
&
config
,
bool
use_analysis
=
true
)
{
const
AnalysisConfig
&
config
,
bool
use_analysis
=
true
)
{
if
(
use_analysis
)
{
if
(
use_analysis
)
{
return
CreatePaddlePredictor
<
contrib
::
AnalysisConfig
,
return
CreatePaddlePredictor
<
contrib
::
AnalysisConfig
>
(
config
);
PaddleEngineKind
::
kAnalysis
>
(
config
);
}
else
{
}
else
{
return
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
return
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
config
);
config
);
...
...
paddle/fluid/inference/tests/api/trt_models_tester.cc
浏览文件 @
35985007
...
@@ -51,11 +51,8 @@ void CompareTensorRTWithFluid(int batch_size, std::string model_dirname) {
...
@@ -51,11 +51,8 @@ void CompareTensorRTWithFluid(int batch_size, std::string model_dirname) {
config1
.
model_dir
=
model_dirname
;
config1
.
model_dir
=
model_dirname
;
config1
.
max_batch_size
=
batch_size
;
config1
.
max_batch_size
=
batch_size
;
auto
predictor0
=
auto
predictor0
=
CreatePaddlePredictor
<
NativeConfig
>
(
config0
);
CreatePaddlePredictor
<
NativeConfig
,
PaddleEngineKind
::
kNative
>
(
config0
);
auto
predictor1
=
CreatePaddlePredictor
<
MixedRTConfig
>
(
config1
);
auto
predictor1
=
CreatePaddlePredictor
<
MixedRTConfig
,
PaddleEngineKind
::
kAutoMixedTensorRT
>
(
config1
);
// Prepare inputs
// Prepare inputs
int
height
=
224
;
int
height
=
224
;
int
width
=
224
;
int
width
=
224
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录