Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
b791dcdd
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
692
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b791dcdd
编写于
1月 13, 2017
作者:
H
hedaoyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix CrossMapNormal Test
上级
67817433
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
22 deletion
+31
-22
paddle/function/CMakeLists.txt
paddle/function/CMakeLists.txt
+1
-1
paddle/function/CrossMapNormalOpTest.cpp
paddle/function/CrossMapNormalOpTest.cpp
+30
-21
未找到文件。
paddle/function/CMakeLists.txt
浏览文件 @
b791dcdd
...
...
@@ -19,7 +19,7 @@ if(WITH_TESTING)
# TODO:
# file(GLOB test_files . *OpTest.cpp)
# add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_files})
#
add_simple_unittest(CrossMapNormalOpTest)
add_simple_unittest
(
CrossMapNormalOpTest
)
add_simple_unittest
(
TensorShapeTest
)
add_simple_unittest
(
TensorTypeTest
)
add_simple_unittest
(
BufferArgTest
)
...
...
paddle/function/CrossMapNormalOpTest.cpp
浏览文件 @
b791dcdd
...
...
@@ -27,15 +27,19 @@ TEST(CrossMapNormal, real) {
<<
" imgSizeH="
<<
imgSizeH
<<
" imgSizeW="
<<
imgSizeW
<<
" size="
<<
size
;
FunctionCompare
compare
(
"CrossMapNormal"
,
FuncConfig
()
.
set
(
"size"
,
size
)
.
set
(
"scale"
,
(
real
)
1.5
)
.
set
(
"pow"
,
(
real
)
0.5
));
Dims
dims
{
numSamples
,
channels
,
imgSizeH
,
imgSizeW
};
compare
.
cmpWithArg
({
Tensor
(
nullptr
,
dims
)},
{
Tensor
(
nullptr
,
dims
),
Tensor
(
nullptr
,
dims
)},
{});
// init Test object
FunctionCompare
test
(
"CrossMapNormal"
,
FuncConfig
()
.
set
(
"size"
,
size
)
.
set
(
"scale"
,
(
real
)
1.5
)
.
set
(
"pow"
,
(
real
)
0.5
));
// prepare input arguments
TensorShape
shape
{
numSamples
,
channels
,
imgSizeH
,
imgSizeW
};
test
.
addInputs
(
BufferArg
(
VALUE_TYPE_FLOAT
,
shape
));
test
.
addOutputs
(
BufferArg
(
VALUE_TYPE_FLOAT
,
shape
));
test
.
addOutputs
(
BufferArg
(
VALUE_TYPE_FLOAT
,
shape
));
// run Function
test
.
run
();
}
}
}
...
...
@@ -43,6 +47,9 @@ TEST(CrossMapNormal, real) {
}
}
#if 0
// TODO(hedaoyuan): Now CrossMapNormalGrad not support ASSIGN_TO mode.
// Maybe all Function need support ASSIGN_TO mode.
TEST(CrossMapNormalGrad, real) {
for (size_t numSamples : {5, 32}) {
for (size_t channels : {1, 5, 32}) {
...
...
@@ -53,23 +60,25 @@ TEST(CrossMapNormalGrad, real) {
<< " imgSizeH=" << imgSizeH << " imgSizeW=" << imgSizeW
<< " size=" << size;
FunctionCompare
compare
(
"CrossMapNormalGrad"
,
FuncConfig
()
.
set
(
"size"
,
size
)
.
set
(
"scale"
,
(
real
)
1.5
)
.
set
(
"pow"
,
(
real
)
0.5
));
Dims
dims
{
numSamples
,
channels
,
imgSizeH
,
imgSizeW
};
compare
.
cmpWithArg
({
Tensor
(
nullptr
,
dims
),
Tensor
(
nullptr
,
dims
),
Tensor
(
nullptr
,
dims
),
Tensor
(
nullptr
,
dims
)},
{
Tensor
(
nullptr
,
dims
)},
{});
FunctionCompare test("CrossMapNormalGrad",
FuncConfig()
.set("size", size)
.set("scale", (real)1.5)
.set("pow", (real)0.5));
TensorShape shape{numSamples, channels, imgSizeH, imgSizeW};
test.addInputs(BufferArg(VALUE_TYPE_FLOAT, shape));
test.addInputs(BufferArg(VALUE_TYPE_FLOAT, shape));
test.addInputs(BufferArg(VALUE_TYPE_FLOAT, shape));
test.addInputs(BufferArg(VALUE_TYPE_FLOAT, shape));
test.addOutputs(BufferArg(VALUE_TYPE_FLOAT, shape));
// run Function
test.run();
}
}
}
}
}
}
#endif
}
// namespace paddle
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录