Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
09da1c4c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
09da1c4c
编写于
4月 07, 2023
作者:
Y
YuanRisheng
提交者:
GitHub
4月 07, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
unify kernel (#52594)
上级
5662adcc
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
95 addition
and
67 deletion
+95
-67
paddle/fluid/operators/push_dense_op.cc
paddle/fluid/operators/push_dense_op.cc
+2
-1
paddle/fluid/operators/push_dense_op.h
paddle/fluid/operators/push_dense_op.h
+1
-1
paddle/fluid/operators/pyramid_hash_op.cc
paddle/fluid/operators/pyramid_hash_op.cc
+10
-7
paddle/fluid/operators/quantize_linear_op.cc
paddle/fluid/operators/quantize_linear_op.cc
+9
-6
paddle/fluid/operators/quantize_linear_op.cu
paddle/fluid/operators/quantize_linear_op.cu
+15
-9
paddle/fluid/operators/quantize_linear_op.h
paddle/fluid/operators/quantize_linear_op.h
+2
-2
paddle/fluid/operators/random_crop_op.cc
paddle/fluid/operators/random_crop_op.cc
+9
-8
paddle/fluid/operators/random_crop_op.cu
paddle/fluid/operators/random_crop_op.cu
+10
-8
paddle/fluid/operators/random_crop_op.h
paddle/fluid/operators/random_crop_op.h
+1
-1
paddle/fluid/operators/random_routing_op.cc
paddle/fluid/operators/random_routing_op.cc
+6
-3
paddle/fluid/operators/random_routing_op.cu
paddle/fluid/operators/random_routing_op.cu
+8
-5
paddle/fluid/operators/random_routing_op.h
paddle/fluid/operators/random_routing_op.h
+1
-1
paddle/fluid/operators/rank_attention_op.cc
paddle/fluid/operators/rank_attention_op.cc
+2
-3
paddle/fluid/operators/rank_attention_op.cu
paddle/fluid/operators/rank_attention_op.cu
+15
-9
paddle/fluid/operators/rank_attention_op.h
paddle/fluid/operators/rank_attention_op.h
+1
-1
paddle/fluid/operators/read_file_op.cc
paddle/fluid/operators/read_file_op.cc
+3
-2
未找到文件。
paddle/fluid/operators/push_dense_op.cc
浏览文件 @
09da1c4c
...
@@ -70,4 +70,5 @@ REGISTER_OPERATOR(
...
@@ -70,4 +70,5 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
PushDenseNoNeedBufferVarsInferer
);
ops
::
PushDenseNoNeedBufferVarsInferer
);
REGISTER_OP_CPU_KERNEL
(
push_dense
,
ops
::
PushDenseCPUKernel
<
float
>
)
PD_REGISTER_STRUCT_KERNEL
(
push_dense
,
CPU
,
ALL_LAYOUT
,
ops
::
PushDenseCPUKernel
,
float
)
{}
paddle/fluid/operators/push_dense_op.h
浏览文件 @
09da1c4c
...
@@ -60,7 +60,7 @@ void PushDenseFunctor(const framework::ExecutionContext& ctx) {
...
@@ -60,7 +60,7 @@ void PushDenseFunctor(const framework::ExecutionContext& ctx) {
#endif
#endif
}
}
template
<
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
PushDenseCPUKernel
:
public
framework
::
OpKernel
<
T
>
{
class
PushDenseCPUKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
...
...
paddle/fluid/operators/pyramid_hash_op.cc
浏览文件 @
09da1c4c
...
@@ -232,7 +232,7 @@ class PyramidHashOP : public framework::OperatorWithKernel {
...
@@ -232,7 +232,7 @@ class PyramidHashOP : public framework::OperatorWithKernel {
}
}
};
};
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
CPUPyramidHashOPKernel
:
public
framework
::
OpKernel
<
T
>
{
class
CPUPyramidHashOPKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
bool
should_use_term
(
math
::
bloomfilter
*
_filter
,
bool
should_use_term
(
math
::
bloomfilter
*
_filter
,
...
@@ -492,7 +492,7 @@ class PyramidHashGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -492,7 +492,7 @@ class PyramidHashGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
CPUPyramidHashOPGradKernel
:
public
framework
::
OpKernel
<
T
>
{
class
CPUPyramidHashOPGradKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
hash_embedding_bp
(
const
T
*
hash_id
,
void
hash_embedding_bp
(
const
T
*
hash_id
,
...
@@ -584,8 +584,11 @@ REGISTER_OPERATOR(pyramid_hash,
...
@@ -584,8 +584,11 @@ REGISTER_OPERATOR(pyramid_hash,
ops
::
PyramidHashGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
PyramidHashGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
pyramid_hash_grad
,
ops
::
PyramidHashOpGrad
);
REGISTER_OPERATOR
(
pyramid_hash_grad
,
ops
::
PyramidHashOpGrad
);
REGISTER_OP_CPU_KERNEL
(
pyramid_hash
,
PD_REGISTER_STRUCT_KERNEL
(
ops
::
CPUPyramidHashOPKernel
<
phi
::
CPUContext
,
float
>
,
pyramid_hash
,
CPU
,
ALL_LAYOUT
,
ops
::
CPUPyramidHashOPKernel
,
float
,
int8_t
)
{
ops
::
CPUPyramidHashOPKernel
<
phi
::
CPUContext
,
int8_t
>
);
}
REGISTER_OP_CPU_KERNEL
(
pyramid_hash_grad
,
PD_REGISTER_STRUCT_KERNEL
(
pyramid_hash_grad
,
ops
::
CPUPyramidHashOPGradKernel
<
phi
::
CPUContext
,
float
>
);
CPU
,
ALL_LAYOUT
,
ops
::
CPUPyramidHashOPGradKernel
,
float
)
{}
paddle/fluid/operators/quantize_linear_op.cc
浏览文件 @
09da1c4c
...
@@ -222,7 +222,6 @@ $$0 \leq c \lt \ the\ channel\ number\ of\ X$$
...
@@ -222,7 +222,6 @@ $$0 \leq c \lt \ the\ channel\ number\ of\ X$$
}
// namespace paddle
}
// namespace paddle
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
using
CPU
=
phi
::
CPUContext
;
REGISTER_OPERATOR
(
REGISTER_OPERATOR
(
quantize_linear
,
quantize_linear
,
...
@@ -231,7 +230,8 @@ REGISTER_OPERATOR(
...
@@ -231,7 +230,8 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OP_CPU_KERNEL
(
quantize_linear
,
ops
::
QuantizeLinearKernel
<
CPU
,
float
>
);
PD_REGISTER_STRUCT_KERNEL
(
quantize_linear
,
CPU
,
ALL_LAYOUT
,
ops
::
QuantizeLinearKernel
,
float
)
{}
REGISTER_OPERATOR
(
REGISTER_OPERATOR
(
dequantize_linear
,
dequantize_linear
,
...
@@ -240,7 +240,10 @@ REGISTER_OPERATOR(
...
@@ -240,7 +240,10 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OP_CPU_KERNEL
(
dequantize_linear
,
PD_REGISTER_STRUCT_KERNEL
(
dequantize_linear
,
ops
::
DeQuantizeLinearKernel
<
CPU
,
float
>
,
CPU
,
ops
::
DeQuantizeLinearKernel
<
CPU
,
int8_t
>
,
ALL_LAYOUT
,
ops
::
DeQuantizeLinearKernel
<
CPU
,
double
>
);
ops
::
DeQuantizeLinearKernel
,
float
,
int8_t
,
double
)
{}
paddle/fluid/operators/quantize_linear_op.cu
浏览文件 @
09da1c4c
...
@@ -123,12 +123,18 @@ template struct ChannelDequantizeFunctorV2<phi::GPUContext, double>;
...
@@ -123,12 +123,18 @@ template struct ChannelDequantizeFunctorV2<phi::GPUContext, double>;
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
using
CUDA
=
phi
::
GPUContext
;
using
CUDA
=
phi
::
GPUContext
;
REGISTER_OP_CUDA_KERNEL
(
dequantize_linear
,
PD_REGISTER_STRUCT_KERNEL
(
dequantize_linear
,
ops
::
DeQuantizeLinearKernel
<
CUDA
,
float
>
,
GPU
,
ops
::
DeQuantizeLinearKernel
<
CUDA
,
float16
>
,
ALL_LAYOUT
,
ops
::
DeQuantizeLinearKernel
<
CUDA
,
int8_t
>
,
ops
::
DeQuantizeLinearKernel
,
ops
::
DeQuantizeLinearKernel
<
CUDA
,
double
>
);
float
,
float16
,
REGISTER_OP_CUDA_KERNEL
(
quantize_linear
,
int8_t
,
ops
::
QuantizeLinearKernel
<
CUDA
,
float
>
,
double
)
{}
ops
::
QuantizeLinearKernel
<
CUDA
,
float16
>
);
PD_REGISTER_STRUCT_KERNEL
(
quantize_linear
,
GPU
,
ALL_LAYOUT
,
ops
::
QuantizeLinearKernel
,
float
,
float16
)
{}
paddle/fluid/operators/quantize_linear_op.h
浏览文件 @
09da1c4c
...
@@ -47,7 +47,7 @@ struct ChannelDequantizeFunctorV2 {
...
@@ -47,7 +47,7 @@ struct ChannelDequantizeFunctorV2 {
phi
::
DenseTensor
*
out
);
phi
::
DenseTensor
*
out
);
};
};
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
QuantizeLinearKernel
:
public
framework
::
OpKernel
<
T
>
{
class
QuantizeLinearKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
...
@@ -130,7 +130,7 @@ class QuantizeLinearKernel : public framework::OpKernel<T> {
...
@@ -130,7 +130,7 @@ class QuantizeLinearKernel : public framework::OpKernel<T> {
}
}
};
};
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
DeQuantizeLinearKernel
:
public
framework
::
OpKernel
<
T
>
{
class
DeQuantizeLinearKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
template
<
typename
D
>
template
<
typename
D
>
...
...
paddle/fluid/operators/random_crop_op.cc
浏览文件 @
09da1c4c
...
@@ -96,11 +96,12 @@ REGISTER_OPERATOR(
...
@@ -96,11 +96,12 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
template
<
typename
T
>
PD_REGISTER_STRUCT_KERNEL
(
random_crop
,
using
Kernel
=
ops
::
RandomCropKernel
<
phi
::
CPUContext
,
T
>
;
CPU
,
REGISTER_OP_CPU_KERNEL
(
random_crop
,
ALL_LAYOUT
,
Kernel
<
float
>
,
ops
::
RandomCropKernel
,
Kernel
<
int
>
,
float
,
Kernel
<
double
>
,
int
,
Kernel
<
uint8_t
>
,
double
,
Kernel
<
int16_t
>
);
uint8_t
,
int16_t
)
{}
paddle/fluid/operators/random_crop_op.cu
浏览文件 @
09da1c4c
...
@@ -15,11 +15,13 @@
...
@@ -15,11 +15,13 @@
#include "paddle/fluid/operators/random_crop_op.h"
#include "paddle/fluid/operators/random_crop_op.h"
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
template
<
typename
T
>
using
Kernel
=
ops
::
RandomCropKernel
<
phi
::
GPUContext
,
T
>
;
PD_REGISTER_STRUCT_KERNEL
(
random_crop
,
REGISTER_OP_CUDA_KERNEL
(
random_crop
,
GPU
,
Kernel
<
float
>
,
ALL_LAYOUT
,
Kernel
<
int
>
,
ops
::
RandomCropKernel
,
Kernel
<
double
>
,
float
,
Kernel
<
uint8_t
>
,
int
,
Kernel
<
int16_t
>
);
double
,
uint8_t
,
int16_t
)
{}
paddle/fluid/operators/random_crop_op.h
浏览文件 @
09da1c4c
...
@@ -176,7 +176,7 @@ struct RandomCropFunctor {
...
@@ -176,7 +176,7 @@ struct RandomCropFunctor {
}
}
};
};
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
RandomCropKernel
:
public
framework
::
OpKernel
<
T
>
{
class
RandomCropKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
virtual
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
virtual
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
...
...
paddle/fluid/operators/random_routing_op.cc
浏览文件 @
09da1c4c
...
@@ -98,6 +98,9 @@ REGISTER_OPERATOR(
...
@@ -98,6 +98,9 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
RandomRoutingInplaceInferer
)
ops
::
RandomRoutingInplaceInferer
)
REGISTER_OP_CPU_KERNEL
(
random_routing
,
PD_REGISTER_STRUCT_KERNEL
(
random_routing
,
ops
::
RandomRoutingOpCPUKernel
<
float
>
,
CPU
,
ops
::
RandomRoutingOpCPUKernel
<
double
>
);
ALL_LAYOUT
,
ops
::
RandomRoutingOpCPUKernel
,
float
,
double
)
{}
paddle/fluid/operators/random_routing_op.cu
浏览文件 @
09da1c4c
...
@@ -47,7 +47,7 @@ __global__ void random_routing_kernel(int64_t* data,
...
@@ -47,7 +47,7 @@ __global__ void random_routing_kernel(int64_t* data,
}
}
}
}
template
<
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
RandomRoutingOpCUDAKernel
:
public
framework
::
OpKernel
<
T
>
{
class
RandomRoutingOpCUDAKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
...
@@ -82,7 +82,10 @@ class RandomRoutingOpCUDAKernel : public framework::OpKernel<T> {
...
@@ -82,7 +82,10 @@ class RandomRoutingOpCUDAKernel : public framework::OpKernel<T> {
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OP_CUDA_KERNEL
(
random_routing
,
PD_REGISTER_STRUCT_KERNEL
(
random_routing
,
ops
::
RandomRoutingOpCUDAKernel
<
float
>
,
GPU
,
ops
::
RandomRoutingOpCUDAKernel
<
double
>
,
ALL_LAYOUT
,
ops
::
RandomRoutingOpCUDAKernel
<
plat
::
float16
>
);
ops
::
RandomRoutingOpCUDAKernel
,
float
,
double
,
plat
::
float16
)
{}
paddle/fluid/operators/random_routing_op.h
浏览文件 @
09da1c4c
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
template
<
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
RandomRoutingOpCPUKernel
:
public
framework
::
OpKernel
<
T
>
{
class
RandomRoutingOpCPUKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
...
...
paddle/fluid/operators/rank_attention_op.cc
浏览文件 @
09da1c4c
...
@@ -192,9 +192,8 @@ REGISTER_OPERATOR(rank_attention_grad,
...
@@ -192,9 +192,8 @@ REGISTER_OPERATOR(rank_attention_grad,
ops
::
RankAttentionGradOp
,
ops
::
RankAttentionGradOp
,
ops
::
RankAttentionGradOpNoNeedBufferVarsInference
);
ops
::
RankAttentionGradOpNoNeedBufferVarsInference
);
REGISTER_OP_CPU_KERNEL
(
rank_attention
,
PD_REGISTER_STRUCT_KERNEL
(
ops
::
RankAttentionKernel
<
phi
::
CPUContext
,
float
>
,
rank_attention
,
CPU
,
ALL_LAYOUT
,
ops
::
RankAttentionKernel
,
float
,
double
)
{}
ops
::
RankAttentionKernel
<
phi
::
CPUContext
,
double
>
);
REGISTER_OP_VERSION
(
rank_attention
)
REGISTER_OP_VERSION
(
rank_attention
)
.
AddCheckpoint
(
.
AddCheckpoint
(
...
...
paddle/fluid/operators/rank_attention_op.cu
浏览文件 @
09da1c4c
...
@@ -24,7 +24,7 @@ limitations under the License. */
...
@@ -24,7 +24,7 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
RankAttentionCUDAKernel
:
public
framework
::
OpKernel
<
T
>
{
class
RankAttentionCUDAKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
...
@@ -150,7 +150,7 @@ class RankAttentionCUDAKernel : public framework::OpKernel<T> {
...
@@ -150,7 +150,7 @@ class RankAttentionCUDAKernel : public framework::OpKernel<T> {
}
}
};
};
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
RankAttentionGradOpCUDAKernel
:
public
framework
::
OpKernel
<
T
>
{
class
RankAttentionGradOpCUDAKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
...
@@ -243,10 +243,16 @@ class RankAttentionGradOpCUDAKernel : public framework::OpKernel<T> {
...
@@ -243,10 +243,16 @@ class RankAttentionGradOpCUDAKernel : public framework::OpKernel<T> {
namespace
ops
=
paddle
::
operators
;
namespace
ops
=
paddle
::
operators
;
using
GPUCtx
=
phi
::
GPUContext
;
using
GPUCtx
=
phi
::
GPUContext
;
REGISTER_OP_CUDA_KERNEL
(
rank_attention
,
PD_REGISTER_STRUCT_KERNEL
(
rank_attention
,
ops
::
RankAttentionCUDAKernel
<
GPUCtx
,
float
>
,
GPU
,
ops
::
RankAttentionCUDAKernel
<
GPUCtx
,
double
>
);
ALL_LAYOUT
,
ops
::
RankAttentionCUDAKernel
,
REGISTER_OP_CUDA_KERNEL
(
rank_attention_grad
,
float
,
ops
::
RankAttentionGradOpCUDAKernel
<
GPUCtx
,
float
>
,
double
)
{}
ops
::
RankAttentionGradOpCUDAKernel
<
GPUCtx
,
double
>
);
PD_REGISTER_STRUCT_KERNEL
(
rank_attention_grad
,
GPU
,
ALL_LAYOUT
,
ops
::
RankAttentionGradOpCUDAKernel
,
float
,
double
)
{}
paddle/fluid/operators/rank_attention_op.h
浏览文件 @
09da1c4c
...
@@ -19,7 +19,7 @@ limitations under the License. */
...
@@ -19,7 +19,7 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
template
<
typename
DeviceContext
,
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
RankAttentionKernel
:
public
framework
::
OpKernel
<
T
>
{
class
RankAttentionKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
...
...
paddle/fluid/operators/read_file_op.cc
浏览文件 @
09da1c4c
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
namespace
paddle
{
namespace
paddle
{
namespace
operators
{
namespace
operators
{
template
<
typename
T
>
template
<
typename
T
,
typename
DeviceContext
>
class
CPUReadFileKernel
:
public
framework
::
OpKernel
<
T
>
{
class
CPUReadFileKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
...
@@ -92,4 +92,5 @@ REGISTER_OPERATOR(
...
@@ -92,4 +92,5 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
)
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
)
REGISTER_OP_CPU_KERNEL
(
read_file
,
ops
::
CPUReadFileKernel
<
uint8_t
>
)
PD_REGISTER_STRUCT_KERNEL
(
read_file
,
CPU
,
ALL_LAYOUT
,
ops
::
CPUReadFileKernel
,
uint8_t
)
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录