Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
9a52056d
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看板
提交
9a52056d
编写于
8月 08, 2017
作者:
Y
Yi Wang
提交者:
GitHub
8月 08, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3341 from wangkuiyi/remove_warnings
Fix some build warnings
上级
18cf0786
6c66044c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
15 addition
and
15 deletion
+15
-15
paddle/function/FunctionTest.cpp
paddle/function/FunctionTest.cpp
+11
-11
paddle/function/TensorShapeTest.cpp
paddle/function/TensorShapeTest.cpp
+1
-1
paddle/gserver/layers/SubNestedSequenceLayer.cpp
paddle/gserver/layers/SubNestedSequenceLayer.cpp
+2
-2
paddle/gserver/tests/test_KmaxSeqScore.cpp
paddle/gserver/tests/test_KmaxSeqScore.cpp
+1
-1
未找到文件。
paddle/function/FunctionTest.cpp
浏览文件 @
9a52056d
...
...
@@ -93,8 +93,8 @@ TEST(Arguments, Matrix) {
MatrixPtr
matrix
=
Matrix
::
create
(
100
,
200
);
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
200
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
U
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
200
U
);
EXPECT_EQ
(
arg
.
data
(),
matrix
->
getData
());
EXPECT_EQ
(
arg
.
matrix
<
DEVICE_TYPE_CPU
>
().
getHeight
(),
matrix
->
getHeight
());
...
...
@@ -112,8 +112,8 @@ TEST(Arguments, Matrix) {
TEST
(
Arguments
,
Vector
)
{
VectorPtr
vector
=
Vector
::
create
(
100
,
false
);
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
1
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
1
U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
100
U
);
EXPECT_EQ
(
arg
.
data
(),
vector
->
getData
());
CpuVector
inVector
=
arg
.
vector
<
real
,
DEVICE_TYPE_CPU
>
();
...
...
@@ -131,9 +131,9 @@ TEST(Arguments, Vector) {
TEST
(
Arguments
,
CpuSparseMatrix
)
{
CpuSparseMatrix
sparse
(
200
,
300
,
50
);
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
200
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
300
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
2
U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
200
U
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
300
U
);
EXPECT_EQ
(
arg
.
data
(),
sparse
.
getData
());
// CHECK_EQ(arg.sparse().nnz(), 50);
// CHECK_EQ(arg.sparse().dataFormat(), SPARSE_CSR_FORMAT);
...
...
@@ -152,10 +152,10 @@ TEST(Arguments, CpuSparseMatrix) {
TEST
(
Arguments
,
BufferArg
)
{
BufferArg
arg
(
nullptr
,
VALUE_TYPE_FLOAT
,
{
1
,
2
,
3
});
CheckBufferArg
check
=
[
=
](
const
BufferArg
&
arg
)
{
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
3
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
1
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
2
);
EXPECT_EQ
(
arg
.
shape
()[
2
],
3
);
EXPECT_EQ
(
arg
.
shape
().
ndims
(),
3
U
);
EXPECT_EQ
(
arg
.
shape
()[
0
],
1
U
);
EXPECT_EQ
(
arg
.
shape
()[
1
],
2
U
);
EXPECT_EQ
(
arg
.
shape
()[
2
],
3
U
);
};
BufferArgs
argments
;
...
...
paddle/function/TensorShapeTest.cpp
浏览文件 @
9a52056d
...
...
@@ -44,7 +44,7 @@ TEST(TensorShape, GetAndSet) {
EXPECT_EQ
(
t
.
ndims
(),
3U
);
EXPECT_EQ
(
t
.
getElements
(),
6U
);
EXPECT_EQ
(
t
[
1
],
2
);
EXPECT_EQ
(
t
[
1
],
2
U
);
t
.
setDim
(
1
,
100
);
EXPECT_EQ
(
t
.
getElements
(),
300U
);
EXPECT_EQ
(
t
[
1
],
100U
);
...
...
paddle/gserver/layers/SubNestedSequenceLayer.cpp
浏览文件 @
9a52056d
...
...
@@ -96,7 +96,7 @@ void SubNestedSequenceLayer::calSelectedCols(
for
(
size_t
i
=
0
;
i
<
seqNum
;
++
i
)
{
for
(
size_t
j
=
0
;
j
<
beamSize
;
++
j
)
{
if
(
selectedIndices
->
getElement
(
i
,
j
)
==
-
1.
)
break
;
in
t
selSubSeqIdx
=
selectedIndices
->
getElement
(
i
,
j
);
size_
t
selSubSeqIdx
=
selectedIndices
->
getElement
(
i
,
j
);
CHECK_GT
(
inputSeqInfoVec_
[
i
].
size
()
-
1
,
selSubSeqIdx
);
size_t
subSeqLen
=
inputSeqInfoVec_
[
i
][
selSubSeqIdx
+
1
]
-
...
...
@@ -135,7 +135,7 @@ void SubNestedSequenceLayer::forward(PassType passType) {
CHECK
(
inputSeq
.
hasSubseq
())
<<
"The first input of SubNestSequence layer "
<<
"must be a nested sequence."
;
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
()))
{
/*
...
...
paddle/gserver/tests/test_KmaxSeqScore.cpp
浏览文件 @
9a52056d
...
...
@@ -88,7 +88,7 @@ void checkLayerOut(vector<vector<int>> groundTruth,
TEST
(
Layer
,
kmaxSeqScoreLayer
)
{
const
size_t
maxBeamSize
=
100
;
in
t
beamSize
=
1
+
(
rand
()
%
maxBeamSize
);
size_
t
beamSize
=
1
+
(
rand
()
%
maxBeamSize
);
vector
<
int
>
seqStartPosition
;
vector
<
int
>
subSeqStartPosition
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录