Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
e5791dd1
P
Paddle
项目概览
Crayon鑫
/
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看板
提交
e5791dd1
编写于
11月 08, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove fill_constant_batch_size_like_op.h and clean some operator codes.
上级
ce08645d
变更
17
显示空白变更内容
内联
并排
Showing
17 changed file
with
15 addition
and
82 deletion
+15
-82
paddle/operators/accuracy_op.h
paddle/operators/accuracy_op.h
+0
-12
paddle/operators/batch_norm_op.cc
paddle/operators/batch_norm_op.cc
+0
-3
paddle/operators/fill_constant_batch_size_like_op.cc
paddle/operators/fill_constant_batch_size_like_op.cc
+3
-3
paddle/operators/fill_constant_batch_size_like_op.cu
paddle/operators/fill_constant_batch_size_like_op.cu
+3
-4
paddle/operators/fill_constant_batch_size_like_op.h
paddle/operators/fill_constant_batch_size_like_op.h
+0
-37
paddle/operators/fill_constant_op.cu
paddle/operators/fill_constant_op.cu
+0
-1
paddle/operators/fill_constant_op.h
paddle/operators/fill_constant_op.h
+3
-3
paddle/operators/fill_zeros_like_op.cu
paddle/operators/fill_zeros_like_op.cu
+0
-1
paddle/operators/fill_zeros_like_op.h
paddle/operators/fill_zeros_like_op.h
+6
-4
paddle/operators/mul_op.cu
paddle/operators/mul_op.cu
+0
-1
paddle/operators/mul_op.h
paddle/operators/mul_op.h
+0
-3
paddle/operators/nccl_op_test.cu
paddle/operators/nccl_op_test.cu
+0
-1
paddle/operators/sequence_concat_op.cu
paddle/operators/sequence_concat_op.cu
+0
-2
paddle/operators/sequence_softmax_op.cu
paddle/operators/sequence_softmax_op.cu
+0
-2
paddle/operators/sequence_softmax_op.h
paddle/operators/sequence_softmax_op.h
+0
-1
paddle/operators/softmax_op.cu
paddle/operators/softmax_op.cu
+0
-1
paddle/operators/softmax_op.h
paddle/operators/softmax_op.h
+0
-3
未找到文件。
paddle/operators/accuracy_op.h
浏览文件 @
e5791dd1
...
@@ -22,18 +22,6 @@ namespace operators {
...
@@ -22,18 +22,6 @@ namespace operators {
using
Tensor
=
framework
::
Tensor
;
using
Tensor
=
framework
::
Tensor
;
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
using
EigenMatrix
=
framework
::
EigenMatrix
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
using
EigenVector
=
framework
::
EigenVector
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
using
EigenScalar
=
framework
::
EigenScalar
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
Place
,
typename
T
>
template
<
typename
Place
,
typename
T
>
class
AccuracyKernel
:
public
framework
::
OpKernel
<
T
>
{
class
AccuracyKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
...
...
paddle/operators/batch_norm_op.cc
浏览文件 @
e5791dd1
...
@@ -19,9 +19,6 @@ namespace operators {
...
@@ -19,9 +19,6 @@ namespace operators {
using
Tensor
=
framework
::
Tensor
;
using
Tensor
=
framework
::
Tensor
;
using
LoDTensor
=
framework
::
LoDTensor
;
using
LoDTensor
=
framework
::
LoDTensor
;
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
using
EigenMatrix
=
framework
::
EigenMatrix
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
T
>
template
<
typename
T
>
using
EigenArrayMap
=
using
EigenArrayMap
=
...
...
paddle/operators/fill_constant_batch_size_like_op.cc
浏览文件 @
e5791dd1
...
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#include "paddle/operators/fill_constant_
batch_size_like_
op.h"
#include "paddle/operators/fill_constant_op.h"
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
...
@@ -100,5 +100,5 @@ REGISTER_OPERATOR(fill_constant_batch_size_like,
...
@@ -100,5 +100,5 @@ REGISTER_OPERATOR(fill_constant_batch_size_like,
ops
::
FillConstantBatchSizeLikeOpMaker
);
ops
::
FillConstantBatchSizeLikeOpMaker
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
fill_constant_batch_size_like
,
fill_constant_batch_size_like
,
ops
::
FillConstant
BatchSizeLike
OpKernel
<
paddle
::
platform
::
CPUPlace
,
float
>
,
ops
::
FillConstantOpKernel
<
paddle
::
platform
::
CPUPlace
,
float
>
,
ops
::
FillConstant
BatchSizeLike
OpKernel
<
paddle
::
platform
::
CPUPlace
,
double
>
);
ops
::
FillConstantOpKernel
<
paddle
::
platform
::
CPUPlace
,
double
>
);
paddle/operators/fill_constant_batch_size_like_op.cu
浏览文件 @
e5791dd1
...
@@ -12,12 +12,11 @@
...
@@ -12,12 +12,11 @@
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/operators/fill_constant_
batch_size_like_
op.h"
#include "paddle/operators/fill_constant_op.h"
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
REGISTER_OP_GPU_KERNEL
(
REGISTER_OP_GPU_KERNEL
(
fill_constant_batch_size_like
,
fill_constant_batch_size_like
,
ops
::
FillConstant
BatchSizeLike
OpKernel
<
paddle
::
platform
::
GPUPlace
,
float
>
,
ops
::
FillConstantOpKernel
<
paddle
::
platform
::
GPUPlace
,
float
>
,
ops
::
FillConstant
BatchSizeLike
OpKernel
<
paddle
::
platform
::
GPUPlace
,
double
>
);
ops
::
FillConstantOpKernel
<
paddle
::
platform
::
GPUPlace
,
double
>
);
paddle/operators/fill_constant_batch_size_like_op.h
已删除
100644 → 0
浏览文件 @
ce08645d
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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. */
#pragma once
#include "paddle/framework/eigen.h"
#include "paddle/framework/op_registry.h"
namespace
paddle
{
namespace
operators
{
template
<
typename
Place
,
typename
T
>
class
FillConstantBatchSizeLikeOpKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
*
out
=
ctx
.
Output
<
framework
::
Tensor
>
(
"Out"
);
out
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
auto
value
=
ctx
.
Attr
<
float
>
(
"value"
);
auto
out_eigen
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
out
);
auto
place
=
ctx
.
GetEigenDevice
<
Place
>
();
out_eigen
.
device
(
place
)
=
out_eigen
.
constant
(
static_cast
<
T
>
(
value
));
}
};
}
// namespace operators
}
// namespace paddle
paddle/operators/fill_constant_op.cu
浏览文件 @
e5791dd1
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/operators/fill_constant_op.h"
#include "paddle/operators/fill_constant_op.h"
...
...
paddle/operators/fill_constant_op.h
浏览文件 @
e5791dd1
...
@@ -15,6 +15,7 @@ limitations under the License. */
...
@@ -15,6 +15,7 @@ limitations under the License. */
#pragma once
#pragma once
#include "paddle/framework/eigen.h"
#include "paddle/framework/eigen.h"
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/operators/math/math_function.h"
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
...
@@ -27,9 +28,8 @@ class FillConstantOpKernel : public framework::OpKernel<T> {
...
@@ -27,9 +28,8 @@ class FillConstantOpKernel : public framework::OpKernel<T> {
out
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
out
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
auto
value
=
ctx
.
Attr
<
float
>
(
"value"
);
auto
value
=
ctx
.
Attr
<
float
>
(
"value"
);
auto
out_eigen
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
out
);
math
::
SetConstant
<
Place
,
T
>
setter
;
auto
place
=
ctx
.
GetEigenDevice
<
Place
>
();
setter
(
ctx
.
device_context
(),
out
,
static_cast
<
T
>
(
value
));
out_eigen
.
device
(
place
)
=
out_eigen
.
constant
(
static_cast
<
T
>
(
value
));
}
}
};
};
...
...
paddle/operators/fill_zeros_like_op.cu
浏览文件 @
e5791dd1
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/operators/fill_zeros_like_op.h"
#include "paddle/operators/fill_zeros_like_op.h"
...
...
paddle/operators/fill_zeros_like_op.h
浏览文件 @
e5791dd1
...
@@ -15,6 +15,7 @@ limitations under the License. */
...
@@ -15,6 +15,7 @@ limitations under the License. */
#pragma once
#pragma once
#include "paddle/framework/eigen.h"
#include "paddle/framework/eigen.h"
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/operators/math/math_function.h"
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
...
@@ -23,10 +24,11 @@ template <typename Place, typename T>
...
@@ -23,10 +24,11 @@ template <typename Place, typename T>
class
FillZerosLikeKernel
:
public
framework
::
OpKernel
<
T
>
{
class
FillZerosLikeKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
auto
*
output
=
context
.
Output
<
framework
::
Tensor
>
(
"Y"
);
auto
*
out
=
context
.
Output
<
framework
::
Tensor
>
(
"Y"
);
output
->
mutable_data
<
T
>
(
context
.
GetPlace
());
out
->
mutable_data
<
T
>
(
context
.
GetPlace
());
auto
t
=
framework
::
EigenVector
<
T
>::
Flatten
(
*
output
);
t
.
device
(
context
.
GetEigenDevice
<
Place
>
())
=
t
.
constant
(
static_cast
<
T
>
(
0
));
math
::
SetConstant
<
Place
,
T
>
setter
;
setter
(
context
.
device_context
(),
out
,
static_cast
<
T
>
(
0
));
}
}
};
};
...
...
paddle/operators/mul_op.cu
浏览文件 @
e5791dd1
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/operators/mul_op.h"
#include "paddle/operators/mul_op.h"
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
...
...
paddle/operators/mul_op.h
浏览文件 @
e5791dd1
...
@@ -23,9 +23,6 @@ namespace paddle {
...
@@ -23,9 +23,6 @@ namespace paddle {
namespace
operators
{
namespace
operators
{
using
Tensor
=
framework
::
Tensor
;
using
Tensor
=
framework
::
Tensor
;
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
using
EigenMatrix
=
framework
::
EigenMatrix
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
Place
,
typename
T
>
template
<
typename
Place
,
typename
T
>
class
MulKernel
:
public
framework
::
OpKernel
<
T
>
{
class
MulKernel
:
public
framework
::
OpKernel
<
T
>
{
...
...
paddle/operators/nccl_op_test.cu
浏览文件 @
e5791dd1
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/framework/program_desc.h"
#include "paddle/framework/program_desc.h"
#include "paddle/framework/var_desc.h"
#include "paddle/framework/var_desc.h"
#include "paddle/operators/math/math_function.h"
#include "paddle/operators/nccl/nccl_gpu_common.h"
#include "paddle/operators/nccl/nccl_gpu_common.h"
#include "paddle/platform/device_context.h"
#include "paddle/platform/device_context.h"
#include "paddle/platform/enforce.h"
#include "paddle/platform/enforce.h"
...
...
paddle/operators/sequence_concat_op.cu
浏览文件 @
e5791dd1
...
@@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/operators/sequence_concat_op.h"
#include "paddle/operators/sequence_concat_op.h"
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
...
...
paddle/operators/sequence_softmax_op.cu
浏览文件 @
e5791dd1
...
@@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -12,8 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/operators/sequence_softmax_op.h"
#include "paddle/operators/sequence_softmax_op.h"
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
...
...
paddle/operators/sequence_softmax_op.h
浏览文件 @
e5791dd1
...
@@ -14,7 +14,6 @@ limitations under the License. */
...
@@ -14,7 +14,6 @@ limitations under the License. */
#pragma once
#pragma once
#include "paddle/framework/eigen.h"
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/operators/math/softmax.h"
#include "paddle/operators/math/softmax.h"
...
...
paddle/operators/softmax_op.cu
浏览文件 @
e5791dd1
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#define EIGEN_USE_GPU
#include "paddle/operators/softmax_op.h"
#include "paddle/operators/softmax_op.h"
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
...
...
paddle/operators/softmax_op.h
浏览文件 @
e5791dd1
...
@@ -21,9 +21,6 @@ namespace paddle {
...
@@ -21,9 +21,6 @@ namespace paddle {
namespace
operators
{
namespace
operators
{
using
Tensor
=
framework
::
Tensor
;
using
Tensor
=
framework
::
Tensor
;
template
<
typename
T
,
int
MajorType
=
Eigen
::
RowMajor
,
typename
IndexType
=
Eigen
::
DenseIndex
>
using
EigenMatrix
=
framework
::
EigenMatrix
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
Place
,
typename
T
>
template
<
typename
Place
,
typename
T
>
class
SoftmaxKernel
:
public
framework
::
OpKernel
<
T
>
{
class
SoftmaxKernel
:
public
framework
::
OpKernel
<
T
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录