Skip to content

Commit dafe06a

Browse files
author
Yang Yang
committed
first commit
1 parent 3fbe9c3 commit dafe06a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

paddle/fluid/framework/op_registry.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ limitations under the License. */
1616

1717
#include <algorithm>
1818
#include <atomic>
19+
#include <string>
20+
#include <tuple>
1921
#include <type_traits>
2022
#include <typeinfo>
2123
#include <unordered_map>
@@ -167,10 +169,6 @@ class OpKernelRegistrar : public Registrar {
167169
REGISTER_OPERATOR(op_type, op_class, _GradOpDescMaker_##grad_op_type##_, \
168170
op_maker_class);
169171

170-
#define REGISTER_OP_WITH_KERNEL(op_type, ...) \
171-
REGISTER_OPERATOR(op_type, ::paddle::framework::OperatorWithKernel, \
172-
##__VA_ARGS__)
173-
174172
#define REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, op_maker_class) \
175173
REGISTER_OPERATOR(op_type, op_class, op_maker_class)
176174

paddle/fluid/operators/crop_op.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ class CropOpGrad : public framework::OperatorWithKernel {
153153
} // namespace paddle
154154

155155
namespace ops = paddle::operators;
156-
REGISTER_OP(crop, ops::CropOp, ops::CropOpMaker, crop_grad, ops::CropOpGrad);
156+
REGISTER_OPERATOR(crop, ops::CropOp, ops::CropOpMaker,
157+
paddle::framework::DefaultGradOpDescMaker<true>);
158+
REGISTER_OPERATOR(crop_grad, ops::CropOpGrad);
157159
REGISTER_OP_CPU_KERNEL(crop, ops::CropKernel<float>);
158160
REGISTER_OP_CPU_KERNEL(
159161
crop_grad, ops::CropGradKernel<paddle::platform::CPUDeviceContext, float>);

0 commit comments

Comments
 (0)