Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
736d078c
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看板
提交
736d078c
编写于
7月 19, 2017
作者:
Q
qijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replace Tensor::tensor to EigenTensor::From
上级
8ad9006d
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
41 addition
and
34 deletion
+41
-34
paddle/operators/mul_op.cc
paddle/operators/mul_op.cc
+3
-3
paddle/operators/mul_op.cu
paddle/operators/mul_op.cu
+2
-2
paddle/operators/mul_op.h
paddle/operators/mul_op.h
+7
-4
paddle/operators/rowwise_add_op.cc
paddle/operators/rowwise_add_op.cc
+2
-2
paddle/operators/rowwise_add_op.cu
paddle/operators/rowwise_add_op.cu
+2
-2
paddle/operators/rowwise_add_op.h
paddle/operators/rowwise_add_op.h
+6
-5
paddle/operators/sigmoid_op.cc
paddle/operators/sigmoid_op.cc
+2
-2
paddle/operators/sigmoid_op.cu
paddle/operators/sigmoid_op.cu
+2
-2
paddle/operators/sigmoid_op.h
paddle/operators/sigmoid_op.h
+6
-4
paddle/operators/softmax_op.cc
paddle/operators/softmax_op.cc
+2
-2
paddle/operators/softmax_op.cu
paddle/operators/softmax_op.cu
+2
-2
paddle/operators/softmax_op.h
paddle/operators/softmax_op.h
+5
-4
未找到文件。
paddle/operators/mul_op.cc
浏览文件 @
736d078c
...
...
@@ -12,9 +12,9 @@
See the License for the specific language governing permissions and
limitations under the License. */
#include
<paddle/framework/op_registry.h>
#include
<paddle/framework/tensor.h>
#include
<paddle/operators/mul_op.h>
#include
"paddle/operators/mul_op.h"
#include
"paddle/framework/op_registry.h"
#include
"paddle/framework/tensor.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/operators/mul_op.cu
浏览文件 @
736d078c
...
...
@@ -12,8 +12,8 @@
See the License for the specific language governing permissions and
limitations under the License. */
#include
<paddle/operators/mul_op.h>
#include
<paddle/framework/op_registry.h>
#include
"paddle/operators/mul_op.h"
#include
"paddle/framework/op_registry.h"
REGISTER_OP_GPU_KERNEL
(
mul
,
paddle
::
operators
::
MulKernel
<
paddle
::
platform
...
...
paddle/operators/mul_op.h
浏览文件 @
736d078c
...
...
@@ -14,8 +14,9 @@
#pragma once
#include <glog/logging.h>
#include <paddle/framework/operator.h>
#include "glog/logging.h"
#include "paddle/framework/eigen.h"
#include "paddle/framework/operator.h"
namespace
paddle
{
namespace
operators
{
...
...
@@ -34,8 +35,10 @@ public:
output
->
mutable_data
<
T
>
(
context
.
GetPlace
());
output
->
matrix
<
T
>
().
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
input0
.
matrix
<
T
>
().
contract
(
input1
.
matrix
<
T
>
(),
dim_pair
);
framework
::
EigenMatrix
<
T
>::
From
(
*
output
).
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
framework
::
EigenMatrix
<
T
>::
From
(
input0
).
contract
(
framework
::
EigenMatrix
<
T
>::
From
(
input1
),
dim_pair
);
}
};
}
// namespace operators
...
...
paddle/operators/rowwise_add_op.cc
浏览文件 @
736d078c
...
...
@@ -12,8 +12,8 @@
See the License for the specific language governing permissions and
limitations under the License. */
#include
<paddle/framework/op_registry.h>
#include
<paddle/operators/rowwise_add_op.h>
#include
"paddle/operators/rowwise_add_op.h"
#include
"paddle/framework/op_registry.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/operators/rowwise_add_op.cu
浏览文件 @
736d078c
#include
<paddle/framework/op_registry.h>
#include
<paddle/operators/rowwise_add_op.h>
#include
"paddle/framework/op_registry.h"
#include
"paddle/operators/rowwise_add_op.h"
REGISTER_OP_GPU_KERNEL
(
rowwise_add
,
...
...
paddle/operators/rowwise_add_op.h
浏览文件 @
736d078c
...
...
@@ -13,8 +13,9 @@
limitations under the License. */
#pragma once
#include <glog/logging.h>
#include <paddle/framework/operator.h>
#include "glog/logging.h"
#include "paddle/framework/eigen.h"
#include "paddle/framework/operator.h"
namespace
paddle
{
namespace
operators
{
...
...
@@ -27,9 +28,9 @@ public:
auto
in1
=
context
.
Input
(
1
)
->
Get
<
framework
::
Tensor
>
();
auto
*
out
=
context
.
Output
(
0
)
->
GetMutable
<
framework
::
Tensor
>
();
auto
input
=
in0
.
matrix
<
T
>
(
);
auto
bias
=
in1
.
vec
<
T
>
(
);
auto
output
=
out
->
matrix
<
T
>
(
);
auto
input
=
framework
::
EigenMatrix
<
T
>::
From
(
in0
);
auto
bias
=
framework
::
EigenVector
<
T
>::
From
(
in1
);
auto
output
=
framework
::
EigenMatrix
<
T
>::
From
(
*
out
);
const
int
bias_size
=
bias
.
dimension
(
0
);
const
int
rest_size
=
input
.
size
()
/
bias_size
;
...
...
paddle/operators/sigmoid_op.cc
浏览文件 @
736d078c
...
...
@@ -12,8 +12,8 @@
See the License for the specific language governing permissions and
limitations under the License. */
#include
<paddle/framework/op_registry.h>
#include
<paddle/operators/sigmoid_op.h>
#include
"paddle/operators/sigmoid_op.h"
#include
"paddle/framework/op_registry.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/operators/sigmoid_op.cu
浏览文件 @
736d078c
#include
<paddle/operators/sigmoid_op.h>
#include
<paddle/framework/op_registry.h>
#include
"paddle/operators/sigmoid_op.h"
#include
"paddle/framework/op_registry.h"
REGISTER_OP_GPU_KERNEL
(
sigmoid
,
paddle
::
operators
::
SigmoidKernel
<
paddle
::
platform
::
GPUPlace
,
float
>
);
paddle/operators/sigmoid_op.h
浏览文件 @
736d078c
...
...
@@ -14,8 +14,9 @@
#pragma once
#include <glog/logging.h>
#include <paddle/framework/operator.h>
#include "glog/logging.h"
#include "paddle/framework/eigen.h"
#include "paddle/framework/operator.h"
namespace
paddle
{
namespace
operators
{
...
...
@@ -29,8 +30,9 @@ public:
output
->
mutable_data
<
T
>
(
context
.
GetPlace
());
output
->
flat
<
T
>
().
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
1.0
/
(
1.0
+
(
-
1.0
*
input
.
flat
<
T
>
()).
exp
());
framework
::
EigenVector
<
T
>::
Flatten
(
*
output
).
device
(
*
(
context
.
GetEigenDevice
<
Place
>
()))
=
1.0
/
(
1.0
+
(
-
1.0
*
framework
::
EigenVector
<
T
>::
Flatten
(
input
)).
exp
());
}
};
}
// namespace operators
...
...
paddle/operators/softmax_op.cc
浏览文件 @
736d078c
...
...
@@ -11,8 +11,8 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include
<paddle/framework/op_registry.h>
#include
<paddle/operators/softmax_op.h>
#include
"paddle/operators/softmax_op.h"
#include
"paddle/framework/op_registry.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/operators/softmax_op.cu
浏览文件 @
736d078c
#include
<paddle/framework/op_registry.h>
#include
<paddle/operators/softmax_op.h>
#include
"paddle/framework/op_registry.h"
#include
"paddle/operators/softmax_op.h"
REGISTER_OP_GPU_KERNEL
(
softmax
,
paddle
::
operators
::
SoftmaxKernel
<
paddle
::
platform
::
GPUPlace
,
float
>
);
paddle/operators/softmax_op.h
浏览文件 @
736d078c
...
...
@@ -14,8 +14,9 @@
#pragma once
#include <glog/logging.h>
#include <paddle/framework/operator.h>
#include "glog/logging.h"
#include "paddle/framework/eigen.h"
#include "paddle/framework/operator.h"
namespace
paddle
{
namespace
operators
{
...
...
@@ -27,8 +28,8 @@ public:
auto
input
=
context
.
Input
(
0
)
->
Get
<
framework
::
Tensor
>
();
auto
*
output
=
context
.
Output
(
0
)
->
GetMutable
<
framework
::
Tensor
>
();
auto
logits
=
input
.
matrix
<
T
>
(
);
auto
softmax
=
output
->
matrix
<
T
>
(
);
auto
logits
=
framework
::
EigenMatrix
<
T
>::
From
(
input
);
auto
softmax
=
framework
::
EigenMatrix
<
T
>::
From
(
*
output
);
const
int
kBatchDim
=
0
;
const
int
kClassDim
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录