Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
ff112813
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看板
提交
ff112813
编写于
3月 21, 2019
作者:
P
phlrain
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into fix_concat_check
上级
8274d9d7
0d779f15
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
paddle/fluid/operators/math/sequence_padding.cu
paddle/fluid/operators/math/sequence_padding.cu
+2
-7
paddle/fluid/operators/matmul_op.cc
paddle/fluid/operators/matmul_op.cc
+4
-2
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+3
-0
未找到文件。
paddle/fluid/operators/math/sequence_padding.cu
浏览文件 @
ff112813
...
@@ -78,12 +78,6 @@ class PaddingLoDTensorFunctor<platform::CUDADeviceContext, T> {
...
@@ -78,12 +78,6 @@ class PaddingLoDTensorFunctor<platform::CUDADeviceContext, T> {
"The numel of 'pad_value' can only be 1 or be equal to the "
"The numel of 'pad_value' can only be 1 or be equal to the "
"'step_width'."
);
"'step_width'."
);
if
(
!
norm_by_times
&&
seq_num
==
1UL
&&
pad_seq_len
==
max_seq_len
)
{
TensorCopy
(
seq_tensor
,
context
.
GetPlace
(),
context
,
pad_tensor
);
pad_tensor
->
Resize
(
pad_tensor_dims
);
return
;
}
const
int
kBlockSize
=
512
;
const
int
kBlockSize
=
512
;
/* At least use 32 threads to copy sequence_width elements,
/* At least use 32 threads to copy sequence_width elements,
...
@@ -129,12 +123,13 @@ class UnpaddingLoDTensorFunctor<platform::CUDADeviceContext, T> {
...
@@ -129,12 +123,13 @@ class UnpaddingLoDTensorFunctor<platform::CUDADeviceContext, T> {
CheckDims
(
seq_tensor_dims
,
pad_tensor_dims
,
seq_offsets
,
pad_seq_len
,
CheckDims
(
seq_tensor_dims
,
pad_tensor_dims
,
seq_offsets
,
pad_seq_len
,
step_width
,
layout
);
step_width
,
layout
);
/*
if (!norm_by_times && seq_num == 1UL && pad_seq_len == max_seq_len) {
if (!norm_by_times && seq_num == 1UL && pad_seq_len == max_seq_len) {
TensorCopy(pad_tensor, context.GetPlace(), context, seq_tensor);
TensorCopy(pad_tensor, context.GetPlace(), context, seq_tensor);
seq_tensor->Resize(seq_tensor_dims);
seq_tensor->Resize(seq_tensor_dims);
return;
return;
}
}
*/
const
int
kBlockSize
=
512
;
const
int
kBlockSize
=
512
;
...
...
paddle/fluid/operators/matmul_op.cc
浏览文件 @
ff112813
...
@@ -290,8 +290,10 @@ class MatMulOp : public framework::OperatorWithKernel {
...
@@ -290,8 +290,10 @@ class MatMulOp : public framework::OperatorWithKernel {
context
->
Attrs
().
Get
<
bool
>
(
"transpose_Y"
));
context
->
Attrs
().
Get
<
bool
>
(
"transpose_Y"
));
PADDLE_ENFORCE_EQ
(
mat_dim_x
.
width_
,
mat_dim_y
.
height_
);
PADDLE_ENFORCE_EQ
(
mat_dim_x
.
width_
,
mat_dim_y
.
height_
);
PADDLE_ENFORCE
(
mat_dim_x
.
batch_size_
==
mat_dim_y
.
batch_size_
||
if
(
context
->
IsRuntime
())
{
mat_dim_x
.
batch_size_
==
0
||
mat_dim_y
.
batch_size_
==
0
);
PADDLE_ENFORCE
(
mat_dim_x
.
batch_size_
==
mat_dim_y
.
batch_size_
||
mat_dim_x
.
batch_size_
==
0
||
mat_dim_y
.
batch_size_
==
0
);
}
std
::
vector
<
int64_t
>
dim_out
;
std
::
vector
<
int64_t
>
dim_out
;
if
(
mat_dim_x
.
batch_size_
!=
0
)
{
if
(
mat_dim_x
.
batch_size_
!=
0
)
{
dim_out
=
framework
::
vectorize
(
dim_x
);
dim_out
=
framework
::
vectorize
(
dim_x
);
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
ff112813
...
@@ -4901,6 +4901,9 @@ def matmul(x, y, transpose_x=False, transpose_y=False, alpha=1.0, name=None):
...
@@ -4901,6 +4901,9 @@ def matmul(x, y, transpose_x=False, transpose_y=False, alpha=1.0, name=None):
if
len
(
y_shape
)
>
2
and
len
(
x_shape
)
>
2
:
if
len
(
y_shape
)
>
2
and
len
(
x_shape
)
>
2
:
for
i
,
dim_x
in
enumerate
(
x_shape
[:
-
2
]):
for
i
,
dim_x
in
enumerate
(
x_shape
[:
-
2
]):
# don't check neg shape
if
dim_x
<
0
or
y_shape
[
i
]
<
0
:
continue
if
dim_x
!=
y_shape
[
i
]:
if
dim_x
!=
y_shape
[
i
]:
raise
ValueError
(
"Invalid inputs for matmul. x(%s), y(%s)"
%
raise
ValueError
(
"Invalid inputs for matmul. x(%s), y(%s)"
%
(
x
.
shape
,
y
.
shape
))
(
x
.
shape
,
y
.
shape
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录