Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
bcddefef
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bcddefef
编写于
7月 30, 2020
作者:
Z
Zhaolong Xing
提交者:
GitHub
7月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Fix Ut]: fix inference ut which exist bug on windows. (#25814)
* fix windows test test=develop * fix ci test=develop
上级
5f30e57c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
5 deletion
+7
-5
paddle/fluid/inference/tests/api/CMakeLists.txt
paddle/fluid/inference/tests/api/CMakeLists.txt
+1
-1
paddle/fluid/inference/tests/api/analyzer_dam_tester.cc
paddle/fluid/inference/tests/api/analyzer_dam_tester.cc
+4
-3
paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc
...e/fluid/inference/tests/api/analyzer_save_model_tester.cc
+2
-1
未找到文件。
paddle/fluid/inference/tests/api/CMakeLists.txt
浏览文件 @
bcddefef
...
...
@@ -140,7 +140,7 @@ set(DAM_SMALL_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/small_dam")
download_model_and_data
(
${
DAM_SMALL_INSTALL_DIR
}
"dam_small_model.tar.gz"
"dam_small_data.txt.tar.gz"
)
inference_analysis_test
(
test_analyzer_small_dam SRCS analyzer_dam_tester.cc
EXTRA_DEPS
${
INFERENCE_EXTRA_DEPS
}
ARGS --infer_model=
${
DAM_SMALL_INSTALL_DIR
}
/model --infer_data=
${
DAM_SMALL_INSTALL_DIR
}
/data.txt
--max_turn_num=1
)
ARGS --infer_model=
${
DAM_SMALL_INSTALL_DIR
}
/model --infer_data=
${
DAM_SMALL_INSTALL_DIR
}
/data.txt
)
#save model
inference_analysis_api_test
(
test_analyzer_save_model
${
DAM_SMALL_INSTALL_DIR
}
analyzer_save_model_tester.cc
)
...
...
paddle/fluid/inference/tests/api/analyzer_dam_tester.cc
浏览文件 @
bcddefef
...
...
@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include <vector>
#include "paddle/fluid/inference/analysis/helper.h"
#include "paddle/fluid/inference/tests/api/tester_helper.h"
DEFINE_int32
(
max_turn_num
,
9
,
"The max turn number: 1 for the small and 9 for the normal."
);
const
int
FLAGS_max_turn_num
=
1
;
namespace
paddle
{
namespace
inference
{
...
...
@@ -300,7 +301,7 @@ TEST(Analyzer_dam, compare_determine) {
TEST
(
Analyzer_dam
,
save_optim_model
)
{
AnalysisConfig
cfg
;
std
::
string
optimModelPath
=
FLAGS_infer_model
+
"/saved_optim_model"
;
mkdir
(
optimModelPath
.
c_str
(),
0777
);
MKDIR
(
optimModelPath
.
c_str
()
);
SetConfig
(
&
cfg
);
SaveOptimModel
(
&
cfg
,
optimModelPath
);
}
...
...
paddle/fluid/inference/tests/api/analyzer_save_model_tester.cc
浏览文件 @
bcddefef
...
...
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/fluid/inference/analysis/helper.h"
#include "paddle/fluid/inference/tests/api/tester_helper.h"
namespace
paddle
{
...
...
@@ -36,7 +37,7 @@ TEST(Analyzer, save_model) {
cfg
.
SetModel
(
FLAGS_infer_model
+
"/__model__"
,
FLAGS_infer_model
+
"/param"
);
// ensure the path being unique
std
::
string
optimModelPath
=
FLAGS_infer_model
+
"/only_for_save_model_test"
;
mkdir
(
optimModelPath
.
c_str
(),
0777
);
MKDIR
(
optimModelPath
.
c_str
()
);
SaveOptimModel
(
&
cfg
,
optimModelPath
);
// Each config can only be applied to one predictor.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录