Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Browse files Browse the repository at this point in the history
… move_set_value
  • Loading branch information
zyfncg committed Mar 6, 2022
2 parents d9977a8 + d30d85d commit 8334e0a
Show file tree
Hide file tree
Showing 122 changed files with 2,902 additions and 1,670 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/framework/infershape_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace framework {
phi::InferMetaContext BuildInferMetaContext(InferShapeContext* ctx,
const std::string& op_type);

#define DELCARE_INFER_SHAPE_FUNCTOR(op_type, functor_name, fn) \
#define DECLARE_INFER_SHAPE_FUNCTOR(op_type, functor_name, fn) \
struct functor_name : public paddle::framework::InferShapeBase { \
void operator()( \
paddle::framework::InferShapeContext* ctx) const override { \
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/framework/infershape_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ void InferShapeUtilsTestKernel(
} // namespace framework
} // namespace paddle

DELCARE_INFER_SHAPE_FUNCTOR(infer_shape_utils_test,
DECLARE_INFER_SHAPE_FUNCTOR(infer_shape_utils_test,
InferShapeUtilsTestInferShapeFunctor,
PT_INFER_META(paddle::framework::TestInferMeta));
PD_INFER_META(paddle::framework::TestInferMeta));
REGISTER_OPERATOR(infer_shape_utils_test,
paddle::framework::InferShapeUtilsTestOp,
paddle::framework::InferShapeUtilsTestOpMaker,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/framework/op_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ struct OpKernelRegistrarFunctorEx<PlaceType, false, I,
return 0; \
}

#define REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, op_maker_class) \
REGISTER_OPERATOR(op_type, op_class, op_maker_class, \
#define REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, ...) \
REGISTER_OPERATOR(op_type, op_class, __VA_ARGS__, \
paddle::framework::EmptyGradOpMaker<paddle::framework::OpDesc>, \
paddle::framework::EmptyGradOpMaker<paddle::imperative::OpBase>)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <cassert>

#include "paddle/fluid/inference/tensorrt/plugin/yolo_box_op_plugin.h"
#include "paddle/fluid/operators/detection/yolo_box_op.h"

namespace paddle {
namespace inference {
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/abs_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ class AbsDoubleGradOp : public framework::OperatorWithKernel {
} // namespace operators
} // namespace paddle

DELCARE_INFER_SHAPE_FUNCTOR(abs, AbsInferShapeFunctor,
PT_INFER_META(phi::UnchangedInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(abs, AbsInferShapeFunctor,
PD_INFER_META(phi::UnchangedInferMeta));

namespace ops = paddle::operators;

Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/addmm_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class AddMMOpGradMaker : public framework::SingleGradOpMaker<T> {
} // namespace paddle

namespace ops = paddle::operators;
DELCARE_INFER_SHAPE_FUNCTOR(addmm, AddmmInferShapeFunctor,
PT_INFER_META(phi::AddmmInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(addmm, AddmmInferShapeFunctor,
PD_INFER_META(phi::AddmmInferMeta));
REGISTER_OPERATOR(addmm, ops::AddMMOp, ops::AddMMOpMaker,
ops::AddMMOpGradMaker<paddle::framework::OpDesc>,
ops::AddMMOpGradMaker<paddle::imperative::OpBase>,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/atan2_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class Atan2OpVarTypeInference : public framework::VarTypeInference {
} // namespace paddle

namespace ops = paddle::operators;
DELCARE_INFER_SHAPE_FUNCTOR(atan2, Atan2InferShapeFunctor,
PT_INFER_META(phi::Atan2InferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(atan2, Atan2InferShapeFunctor,
PD_INFER_META(phi::Atan2InferMeta));
REGISTER_OPERATOR(atan2, ops::Atan2Op, ops::Atan2OpMaker,
ops::Atan2GradMaker<paddle::framework::OpDesc>,
ops::Atan2GradMaker<paddle::imperative::OpBase>,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/bce_loss_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ DECLARE_INPLACE_OP_INFERER(BCELossGradInplaceInferer,
} // namespace paddle

namespace ops = paddle::operators;
DELCARE_INFER_SHAPE_FUNCTOR(bce_loss, BCELossInferShapeFunctor,
PT_INFER_META(phi::BCELossInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(bce_loss, BCELossInferShapeFunctor,
PD_INFER_META(phi::BCELossInferMeta));

REGISTER_OPERATOR(bce_loss, ops::BCELossOp, ops::BCELossOpMaker,
ops::BCELossGradOpMaker<paddle::framework::OpDesc>,
Expand Down
8 changes: 4 additions & 4 deletions paddle/fluid/operators/bilinear_tensor_product_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ class BilinearTensorProductGradOpMaker

namespace ops = paddle::operators;

DELCARE_INFER_SHAPE_FUNCTOR(bilinear_tensor_product,
DECLARE_INFER_SHAPE_FUNCTOR(bilinear_tensor_product,
BilinearTensorProductInferShapeFunctor,
PT_INFER_META(phi::BilinearTensorProductInferMeta));
DELCARE_INFER_SHAPE_FUNCTOR(
PD_INFER_META(phi::BilinearTensorProductInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(
bilinear_tensor_product_grad, BilinearTensorProductGradInferShapeFunctor,
PT_INFER_META(phi::BilinearTensorProductGradInferMeta));
PD_INFER_META(phi::BilinearTensorProductGradInferMeta));

REGISTER_OPERATOR(
bilinear_tensor_product, ops::BilinearTensorProductOp,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/broadcast_tensors_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ DECLARE_NO_NEED_BUFFER_VARS_INFERER(BroadcastTensorsGradNoNeedBufVarsInferer,
namespace ops = paddle::operators;
namespace plat = paddle::platform;

DELCARE_INFER_SHAPE_FUNCTOR(broadcast_tensors,
DECLARE_INFER_SHAPE_FUNCTOR(broadcast_tensors,
BroadcastTensorsInferShapeFunctor,
PT_INFER_META(phi::BroadcastTensorsInferMeta));
PD_INFER_META(phi::BroadcastTensorsInferMeta));

REGISTER_OPERATOR(broadcast_tensors, ops::BroadcastTensorsOp,
ops::BroadcastTensorsOpMaker,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/cholesky_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class CholeskyGradOpMaker : public framework::SingleGradOpMaker<T> {
} // namespace paddle

namespace ops = paddle::operators;
DELCARE_INFER_SHAPE_FUNCTOR(cholesky, CholeskyInferShapeFunctor,
PT_INFER_META(phi::CholeskyInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(cholesky, CholeskyInferShapeFunctor,
PD_INFER_META(phi::CholeskyInferMeta));
REGISTER_OPERATOR(cholesky, ops::CholeskyOp, ops::CholeskyOpMaker,
ops::CholeskyGradOpMaker<paddle::framework::OpDesc>,
ops::CholeskyGradOpMaker<paddle::imperative::OpBase>,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/concat_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ class ConcatDoubleGradOpMaker : public framework::SingleGradOpMaker<T> {

namespace ops = paddle::operators;

DELCARE_INFER_SHAPE_FUNCTOR(concat, ConcatInferShapeFunctor,
PT_INFER_META(phi::ConcatInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(concat, ConcatInferShapeFunctor,
PD_INFER_META(phi::ConcatInferMeta));

REGISTER_OPERATOR(concat, ops::ConcatOp, ops::ConcatOpMaker,
ops::ConcatGradOpMaker<paddle::framework::OpDesc>,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/conj_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class ConjGradMaker : public framework::SingleGradOpMaker<T> {

namespace ops = paddle::operators;

DELCARE_INFER_SHAPE_FUNCTOR(conj, ConjInferShapeFunctor,
PT_INFER_META(phi::UnchangedInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(conj, ConjInferShapeFunctor,
PD_INFER_META(phi::UnchangedInferMeta));
REGISTER_OPERATOR(conj, ops::ConjOp, ops::ConjOpMaker,
ops::ConjGradMaker<paddle::framework::OpDesc>,
ops::ConjGradMaker<paddle::imperative::OpBase>,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/controlflow/compare_all_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class CompareReduceOp : public framework::OperatorWithKernel {
}; \
char _##op_type##Comment::type[]{#op_type}; \
char _##op_type##Comment::equation[]{_equation}; \
DELCARE_INFER_SHAPE_FUNCTOR(op_type, op_type##_InferShapeFunctor, \
PT_INFER_META(phi::CompareAllInferMeta)); \
DECLARE_INFER_SHAPE_FUNCTOR(op_type, op_type##_InferShapeFunctor, \
PD_INFER_META(phi::CompareAllInferMeta)); \
REGISTER_OPERATOR( \
op_type, ::paddle::operators::CompareReduceOp<_##op_type##Comment>, \
::paddle::operators::CompareReduceOpProtoMaker<_##op_type##Comment>, \
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/controlflow/compare_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ class CompareOp : public framework::OperatorWithKernel {
}; \
char _##op_type##Comment::type[]{#op_type}; \
char _##op_type##Comment::equation[]{_equation}; \
DELCARE_INFER_SHAPE_FUNCTOR(op_type, op_type##_InferShapeFunctor, \
PT_INFER_META(phi::CompareInferMeta)); \
DECLARE_INFER_SHAPE_FUNCTOR(op_type, op_type##_InferShapeFunctor, \
PD_INFER_META(phi::CompareInferMeta)); \
REGISTER_OPERATOR( \
op_type, ::paddle::operators::CompareOp<_##op_type##Comment>, \
::paddle::operators::CompareOpProtoMaker<_##op_type##Comment>, \
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/cross_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class CrossGradMaker : public framework::SingleGradOpMaker<T> {
} // namespace paddle

namespace ops = paddle::operators;
DELCARE_INFER_SHAPE_FUNCTOR(cross, CrossInferShapeFunctor,
PT_INFER_META(phi::CrossInferMeta));
DECLARE_INFER_SHAPE_FUNCTOR(cross, CrossInferShapeFunctor,
PD_INFER_META(phi::CrossInferMeta));
REGISTER_OPERATOR(cross, ops::CrossOp, ops::CrossOpMaker,
ops::CrossGradMaker<paddle::framework::OpDesc>,
ops::CrossGradMaker<paddle::imperative::OpBase>,
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ detection_library(locality_aware_nms_op SRCS locality_aware_nms_op.cc DEPS gpc)
detection_library(matrix_nms_op SRCS matrix_nms_op.cc DEPS gpc)
detection_library(box_clip_op SRCS box_clip_op.cc box_clip_op.cu)
detection_library(yolov3_loss_op SRCS yolov3_loss_op.cc)
detection_library(yolo_box_op SRCS yolo_box_op.cc yolo_box_op.cu)
detection_library(yolo_box_op SRCS yolo_box_op.cc)
detection_library(box_decoder_and_assign_op SRCS box_decoder_and_assign_op.cc box_decoder_and_assign_op.cu)
detection_library(sigmoid_focal_loss_op SRCS sigmoid_focal_loss_op.cc sigmoid_focal_loss_op.cu)
detection_library(retinanet_detection_output_op SRCS retinanet_detection_output_op.cc)
Expand Down
3 changes: 0 additions & 3 deletions paddle/fluid/operators/detection/yolo_box_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/fluid/operators/detection/yolo_box_op.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_version_registry.h"

Expand Down Expand Up @@ -240,8 +239,6 @@ REGISTER_OPERATOR(
yolo_box, ops::YoloBoxOp, ops::YoloBoxOpMaker,
paddle::framework::EmptyGradOpMaker<paddle::framework::OpDesc>,
paddle::framework::EmptyGradOpMaker<paddle::imperative::OpBase>);
REGISTER_OP_CPU_KERNEL(yolo_box, ops::YoloBoxKernel<float>,
ops::YoloBoxKernel<double>);

REGISTER_OP_VERSION(yolo_box)
.AddCheckpoint(
Expand Down
143 changes: 0 additions & 143 deletions paddle/fluid/operators/detection/yolo_box_op.cu

This file was deleted.

Loading

0 comments on commit 8334e0a

Please sign in to comment.