Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
14cfb8c2
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
14cfb8c2
编写于
7月 19, 2017
作者:
Q
qijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix gpu build error
上级
b6c07552
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
18 addition
and
12 deletion
+18
-12
cmake/flags.cmake
cmake/flags.cmake
+1
-0
paddle/operators/mul_op.h
paddle/operators/mul_op.h
+4
-3
paddle/operators/rowwise_add_op.h
paddle/operators/rowwise_add_op.h
+1
-0
paddle/operators/softmax_op.h
paddle/operators/softmax_op.h
+12
-9
未找到文件。
cmake/flags.cmake
浏览文件 @
14cfb8c2
...
@@ -124,6 +124,7 @@ set(GPU_COMMON_FLAGS
...
@@ -124,6 +124,7 @@ set(GPU_COMMON_FLAGS
-Wno-error=literal-suffix
-Wno-error=literal-suffix
-Wno-error=unused-local-typedefs
-Wno-error=unused-local-typedefs
-Wno-error=unused-function
# Warnings in Numpy Header.
-Wno-error=unused-function
# Warnings in Numpy Header.
-Wno-error=array-bounds
# Warnings in Eigen::array
)
)
if
(
APPLE
)
if
(
APPLE
)
...
...
paddle/operators/mul_op.h
浏览文件 @
14cfb8c2
...
@@ -24,9 +24,10 @@ template <typename Place, typename T>
...
@@ -24,9 +24,10 @@ template <typename Place, typename T>
class
MulKernel
:
public
framework
::
OpKernel
{
class
MulKernel
:
public
framework
::
OpKernel
{
public:
public:
void
Compute
(
const
framework
::
KernelContext
&
context
)
const
override
{
void
Compute
(
const
framework
::
KernelContext
&
context
)
const
override
{
Eigen
::
array
<
Eigen
::
IndexPair
<
Eigen
::
DenseIndex
>
,
1
>
dim_pair
;
Eigen
::
array
<
Eigen
::
IndexPair
<
Eigen
::
DenseIndex
>
,
1
>
dim_pair
=
{
dim_pair
[
0
].
first
=
1
;
Eigen
::
IndexPair
<
Eigen
::
DenseIndex
>
(
1
,
0
)};
dim_pair
[
0
].
second
=
0
;
// dim_pair[0].first = 1;
// dim_pair[0].second = 0;
auto
input0
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
input0
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
input1
=
context
.
Input
(
1
)
->
Get
<
framework
::
Tensor
>
();
auto
input1
=
context
.
Input
(
1
)
->
Get
<
framework
::
Tensor
>
();
...
...
paddle/operators/rowwise_add_op.h
浏览文件 @
14cfb8c2
...
@@ -26,6 +26,7 @@ public:
...
@@ -26,6 +26,7 @@ public:
auto
in0
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
in0
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
in1
=
context
.
Input
(
1
)
->
Get
<
framework
::
Tensor
>
();
auto
in1
=
context
.
Input
(
1
)
->
Get
<
framework
::
Tensor
>
();
auto
*
out
=
context
.
Output
(
0
)
->
GetMutable
<
framework
::
Tensor
>
();
auto
*
out
=
context
.
Output
(
0
)
->
GetMutable
<
framework
::
Tensor
>
();
out
->
mutable_data
<
T
>
(
context
.
GetPlace
());
auto
input
=
in0
.
matrix
<
T
>
();
auto
input
=
in0
.
matrix
<
T
>
();
auto
bias
=
in1
.
vec
<
T
>
();
auto
bias
=
in1
.
vec
<
T
>
();
...
...
paddle/operators/softmax_op.h
浏览文件 @
14cfb8c2
...
@@ -26,6 +26,7 @@ public:
...
@@ -26,6 +26,7 @@ public:
void
Compute
(
const
framework
::
KernelContext
&
context
)
const
override
{
void
Compute
(
const
framework
::
KernelContext
&
context
)
const
override
{
auto
input
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
input
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
*
output
=
context
.
Output
(
0
)
->
GetMutable
<
framework
::
Tensor
>
();
auto
*
output
=
context
.
Output
(
0
)
->
GetMutable
<
framework
::
Tensor
>
();
output
->
mutable_data
<
T
>
(
context
.
GetPlace
());
auto
logits
=
input
.
matrix
<
T
>
();
auto
logits
=
input
.
matrix
<
T
>
();
auto
softmax
=
output
->
matrix
<
T
>
();
auto
softmax
=
output
->
matrix
<
T
>
();
...
@@ -40,7 +41,8 @@ public:
...
@@ -40,7 +41,8 @@ public:
Eigen
::
DSizes
<
int
,
2
>
batch_by_one
(
batch_size
,
1
);
Eigen
::
DSizes
<
int
,
2
>
batch_by_one
(
batch_size
,
1
);
Eigen
::
DSizes
<
int
,
2
>
one_by_class
(
1
,
num_classes
);
Eigen
::
DSizes
<
int
,
2
>
one_by_class
(
1
,
num_classes
);
auto
shifted_logits
=
(
logits
-
logits
.
maximum
(
along_class
)
auto
shifted_logits
=
(
logits
-
logits
.
maximum
(
along_class
)
.
eval
()
.
eval
()
.
reshape
(
batch_by_one
)
.
reshape
(
batch_by_one
)
.
broadcast
(
one_by_class
));
.
broadcast
(
one_by_class
));
...
@@ -48,7 +50,8 @@ public:
...
@@ -48,7 +50,8 @@ public:
softmax
.
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
shifted_logits
.
exp
();
softmax
.
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
shifted_logits
.
exp
();
softmax
.
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
softmax
.
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
(
softmax
*
softmax
.
sum
(
along_class
)
(
softmax
*
softmax
.
sum
(
along_class
)
.
inverse
()
.
inverse
()
.
eval
()
.
eval
()
.
reshape
(
batch_by_one
)
.
reshape
(
batch_by_one
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录