Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
6c66044c
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
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看板
提交
6c66044c
编写于
8月 08, 2017
作者:
Y
Yi Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix more warnings about comparison between signed and unsigned values
上级
44801156
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
13 deletion
+13
-13
paddle/function/FunctionTest.cpp
paddle/function/FunctionTest.cpp
+11
-11
paddle/gserver/layers/SubNestedSequenceLayer.cpp
paddle/gserver/layers/SubNestedSequenceLayer.cpp
+1
-1
paddle/gserver/tests/test_KmaxSeqScore.cpp
paddle/gserver/tests/test_KmaxSeqScore.cpp
+1
-1
未找到文件。
paddle/function/FunctionTest.cpp
浏览文件 @
6c66044c
...
@@ -93,8 +93,8 @@ TEST(Arguments, Matrix) {
...
@@ -93,8 +93,8 @@ TEST(Arguments, Matrix) {
MatrixPtr
matrix
=
Matrix
::
create
(
100
,
200
);
MatrixPtr
matrix
=
Matrix
::
create
(
100
,
200
);
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2U
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
U
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
200
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
200
U
);
EXPECT_EQ
(
arg
.
data
(),
matrix
->
getData
());
EXPECT_EQ
(
arg
.
data
(),
matrix
->
getData
());
EXPECT_EQ
(
arg
.
matrix
<
DEVICE_TYPE_CPU
>
().
getHeight
(),
matrix
->
getHeight
());
EXPECT_EQ
(
arg
.
matrix
<
DEVICE_TYPE_CPU
>
().
getHeight
(),
matrix
->
getHeight
());
...
@@ -112,8 +112,8 @@ TEST(Arguments, Matrix) {
...
@@ -112,8 +112,8 @@ TEST(Arguments, Matrix) {
TEST
(
Arguments
,
Vector
)
{
TEST
(
Arguments
,
Vector
)
{
VectorPtr
vector
=
Vector
::
create
(
100
,
false
);
VectorPtr
vector
=
Vector
::
create
(
100
,
false
);
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
1
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
1
U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
U
);
EXPECT_EQ
(
arg
.
data
(),
vector
->
getData
());
EXPECT_EQ
(
arg
.
data
(),
vector
->
getData
());
CpuVector
inVector
=
arg
.
vector
<
real
,
DEVICE_TYPE_CPU
>
();
CpuVector
inVector
=
arg
.
vector
<
real
,
DEVICE_TYPE_CPU
>
();
...
@@ -131,9 +131,9 @@ TEST(Arguments, Vector) {
...
@@ -131,9 +131,9 @@ TEST(Arguments, Vector) {
TEST
(
Arguments
,
CpuSparseMatrix
)
{
TEST
(
Arguments
,
CpuSparseMatrix
)
{
CpuSparseMatrix
sparse
(
200
,
300
,
50
);
CpuSparseMatrix
sparse
(
200
,
300
,
50
);
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2
U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
200
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
200
U
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
300
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
300
U
);
EXPECT_EQ
(
arg
.
data
(),
sparse
.
getData
());
EXPECT_EQ
(
arg
.
data
(),
sparse
.
getData
());
// CHECK_EQ(arg.sparse().nnz(), 50);
// CHECK_EQ(arg.sparse().nnz(), 50);
// CHECK_EQ(arg.sparse().dataFormat(), SPARSE_CSR_FORMAT);
// CHECK_EQ(arg.sparse().dataFormat(), SPARSE_CSR_FORMAT);
...
@@ -152,10 +152,10 @@ TEST(Arguments, CpuSparseMatrix) {
...
@@ -152,10 +152,10 @@ TEST(Arguments, CpuSparseMatrix) {
TEST
(
Arguments
,
BufferArg
)
{
TEST
(
Arguments
,
BufferArg
)
{
BufferArg
arg
(
nullptr
,
VALUE_TYPE_FLOAT
,
{
1
,
2
,
3
});
BufferArg
arg
(
nullptr
,
VALUE_TYPE_FLOAT
,
{
1
,
2
,
3
});
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
3
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
3
U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
1
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
1
U
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
2
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
2
U
);
EXPECT_EQ
(
arg
.
shape
()[
2
],
3
);
EXPECT_EQ
(
arg
.
shape
()[
2
],
3
U
);
};
};
BufferArgs
argments
;
BufferArgs
argments
;
...
...
paddle/gserver/layers/SubNestedSequenceLayer.cpp
浏览文件 @
6c66044c
...
@@ -135,7 +135,7 @@ void SubNestedSequenceLayer::forward(PassType passType) {
...
@@ -135,7 +135,7 @@ void SubNestedSequenceLayer::forward(PassType passType) {
CHECK
(
inputSeq
.
hasSubseq
())
<<
"The first input of SubNestSequence layer "
CHECK
(
inputSeq
.
hasSubseq
())
<<
"The first input of SubNestSequence layer "
<<
"must be a nested sequence."
;
<<
"must be a nested sequence."
;
const
MatrixPtr
selectedIndices
=
getInputValue
(
1
);
const
MatrixPtr
selectedIndices
=
getInputValue
(
1
);
CHECK_EQ
(
inputSeq
.
getNumSequences
(
),
selectedIndices
->
getHeight
());
CHECK_EQ
(
size_t
(
inputSeq
.
getNumSequences
()
),
selectedIndices
->
getHeight
());
if
(
dynamic_cast
<
GpuMatrix
*>
(
selectedIndices
.
get
()))
{
if
(
dynamic_cast
<
GpuMatrix
*>
(
selectedIndices
.
get
()))
{
/*
/*
...
...
paddle/gserver/tests/test_KmaxSeqScore.cpp
浏览文件 @
6c66044c
...
@@ -88,7 +88,7 @@ void checkLayerOut(vector<vector<int>> groundTruth,
...
@@ -88,7 +88,7 @@ void checkLayerOut(vector<vector<int>> groundTruth,
TEST
(
Layer
,
kmaxSeqScoreLayer
)
{
TEST
(
Layer
,
kmaxSeqScoreLayer
)
{
const
size_t
maxBeamSize
=
100
;
const
size_t
maxBeamSize
=
100
;
in
t
beamSize
=
1
+
(
rand
()
%
maxBeamSize
);
size_
t
beamSize
=
1
+
(
rand
()
%
maxBeamSize
);
vector
<
int
>
seqStartPosition
;
vector
<
int
>
seqStartPosition
;
vector
<
int
>
subSeqStartPosition
;
vector
<
int
>
subSeqStartPosition
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录