Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
ae4400be
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看板
提交
ae4400be
编写于
1月 10, 2017
作者:
H
hedaoyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bug fix for mac os
上级
ee2da539
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
14 deletion
+14
-14
paddle/function/BufferArg.h
paddle/function/BufferArg.h
+6
-6
paddle/function/ContextProjectionOp.cpp
paddle/function/ContextProjectionOp.cpp
+4
-4
paddle/function/CrossMapNormalOp.cpp
paddle/function/CrossMapNormalOp.cpp
+2
-2
paddle/function/TensorShape.h
paddle/function/TensorShape.h
+2
-2
未找到文件。
paddle/function/BufferArg.h
浏览文件 @
ae4400be
...
...
@@ -126,7 +126,7 @@ public:
CHECK
(
buf_
);
CHECK
(
valueType_
==
DataType
<
real
>::
value
);
// CHECK(deviceType_ == DType);
CHECK_EQ
(
2
,
shape_
.
ndims
());
CHECK_EQ
(
(
size_t
)
2
,
shape_
.
ndims
());
return
typename
Tensor
<
real
,
DType
>::
Matrix
(
reinterpret_cast
<
real
*>
(
buf_
),
shape_
[
0
],
shape_
[
1
]);
}
...
...
@@ -136,7 +136,7 @@ public:
CHECK
(
buf_
);
CHECK
(
valueType_
==
DataType
<
VType
>::
value
);
// CHECK(deviceType_ == DType);
CHECK_EQ
(
1
,
shape_
.
ndims
());
CHECK_EQ
(
(
size_t
)
1
,
shape_
.
ndims
());
return
typename
Tensor
<
VType
,
DType
>::
Vector
(
shape_
[
0
],
reinterpret_cast
<
VType
*>
(
buf_
));
}
...
...
@@ -176,7 +176,7 @@ public:
const
TensorShape
&
shape
,
ArgType
argType
=
UNSPECIFIED
)
:
BufferArg
(
buf
,
VALUE_TYPE_INT32
,
shape
,
argType
)
{
CHECK_EQ
(
shape_
.
ndims
(),
1
);
CHECK_EQ
(
shape_
.
ndims
(),
(
size_t
)
1
);
numSeqs_
=
shape_
[
0
]
-
1
;
}
...
...
@@ -238,9 +238,9 @@ public:
format_
(
format
),
type_
(
type
)
{
CHECK
((
valueType
==
VALUE_TYPE_FLOAT
)
||
(
valueType
==
VALUE_TYPE_DOUBLE
));
CHECK_EQ
(
shape_
.
ndims
(),
2
);
CHECK_EQ
(
row_
.
shape
().
ndims
(),
1
);
CHECK_EQ
(
col_
.
shape
().
ndims
(),
1
);
CHECK_EQ
(
shape_
.
ndims
(),
(
size_t
)
2
);
CHECK_EQ
(
row_
.
shape
().
ndims
(),
(
size_t
)
1
);
CHECK_EQ
(
col_
.
shape
().
ndims
(),
(
size_t
)
1
);
if
(
format
==
SPARSE_CSR_FORMAT
)
{
CHECK_EQ
(
nnz
,
col
.
shape
()[
0
]);
}
else
if
(
format
==
SPARSE_CSC_FORMAT
)
{
...
...
paddle/function/ContextProjectionOp.cpp
浏览文件 @
ae4400be
...
...
@@ -85,8 +85,8 @@ public:
}
void
calc
(
const
BufferArgs
&
inputs
,
const
BufferArgs
&
outputs
)
override
{
CHECK_EQ
(
3
,
inputs
.
size
());
CHECK_EQ
(
1
,
outputs
.
size
());
CHECK_EQ
(
(
size_t
)
3
,
inputs
.
size
());
CHECK_EQ
(
(
size_t
)
1
,
outputs
.
size
());
CHECK
(
outputs
[
0
].
data
()
&&
inputs
[
0
].
data
()
&&
inputs
[
2
].
data
());
CHECK_EQ
(
outputs
[
0
].
shape
().
ndims
(),
(
size_t
)
2
);
...
...
@@ -193,8 +193,8 @@ public:
}
void
calc
(
const
BufferArgs
&
inputs
,
const
BufferArgs
&
outputs
)
override
{
CHECK_EQ
(
3
,
inputs
.
size
());
CHECK_EQ
(
1
,
outputs
.
size
());
CHECK_EQ
(
(
size_t
)
3
,
inputs
.
size
());
CHECK_EQ
(
(
size_t
)
1
,
outputs
.
size
());
CHECK
(
outputs
[
0
].
data
()
&&
inputs
[
2
].
data
());
CHECK_EQ
(
outputs
[
0
].
shape
().
ndims
(),
(
size_t
)
2
);
...
...
paddle/function/CrossMapNormalOp.cpp
浏览文件 @
ae4400be
...
...
@@ -131,7 +131,7 @@ public:
CHECK_EQ
((
size_t
)
1
,
inputs
.
size
());
CHECK_EQ
((
size_t
)
2
,
outputs
.
size
());
CHECK_EQ
(
inputs
[
0
].
shape
().
ndims
(),
4
);
CHECK_EQ
(
inputs
[
0
].
shape
().
ndims
(),
(
size_t
)
4
);
CHECK
(
inputs
[
0
].
shape
()
==
outputs
[
0
].
shape
());
CHECK
(
inputs
[
0
].
shape
()
==
outputs
[
1
].
shape
());
...
...
@@ -182,7 +182,7 @@ public:
CHECK_EQ
((
size_t
)
4
,
inputs
.
size
());
CHECK_EQ
((
size_t
)
1
,
outputs
.
size
());
CHECK_EQ
(
inputs
[
0
].
shape
().
ndims
(),
4
);
CHECK_EQ
(
inputs
[
0
].
shape
().
ndims
(),
(
size_t
)
4
);
CHECK
(
inputs
[
0
].
shape
()
==
inputs
[
1
].
shape
());
CHECK
(
inputs
[
0
].
shape
()
==
inputs
[
2
].
shape
());
CHECK
(
inputs
[
0
].
shape
()
==
inputs
[
3
].
shape
());
...
...
paddle/function/TensorShape.h
浏览文件 @
ae4400be
...
...
@@ -42,14 +42,14 @@ public:
// get the size of specified dimension
size_t
operator
[](
size_t
dim
)
const
{
CHECK_GE
(
dim
,
0
);
CHECK_GE
(
dim
,
(
size_t
)
0
);
CHECK_LT
(
dim
,
ndims_
);
return
dims_
[
dim
];
}
// set the size of specified dimension
void
setDim
(
size_t
dim
,
size_t
size
)
{
CHECK_GE
(
dim
,
0
);
CHECK_GE
(
dim
,
(
size_t
)
0
);
CHECK_LT
(
dim
,
ndims_
);
dims_
[
dim
]
=
size
;
numElements
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录