From 54a82138702226fd0a55630235c8013677ede97a Mon Sep 17 00:00:00 2001 From: enkilee Date: Mon, 21 Aug 2023 02:27:36 +0000 Subject: [PATCH 1/2] fix --- .clang-tidy | 4 ++-- .../auto_parallel/spmd_rules/replicated_spmd_rule.cc | 2 -- paddle/fluid/framework/ir/graph_pattern_detector.cc | 3 --- .../recurrent_op_eager_deletion_pass.cc | 1 - paddle/fluid/inference/analysis/ir_pass_manager.cc | 1 - paddle/fluid/inference/api/analysis_predictor.cc | 1 - paddle/fluid/inference/api/mkldnn_quantizer.cc | 1 - paddle/fluid/operators/activation_op.cc | 1 - paddle/fluid/operators/add_position_encoding_op.cc | 1 - paddle/fluid/operators/assign_pos_op.cc | 1 - paddle/fluid/operators/center_loss_op.cc | 1 - paddle/fluid/operators/flatten_op.cu.cc | 1 - paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc | 1 - paddle/fluid/operators/limit_by_capacity_op.cc | 1 - paddle/fluid/operators/memcpy_d2h_op.cc | 1 - paddle/fluid/operators/memcpy_h2d_op.cc | 1 - paddle/fluid/operators/memcpy_op.cc | 1 - paddle/fluid/operators/mkldnn/interpolate_mkldnn_op.cc | 4 ---- paddle/fluid/operators/mkldnn/quantize_mkldnn_op.cc | 4 ---- paddle/fluid/operators/mkldnn/requantize_mkldnn_op.cc | 1 - paddle/fluid/operators/number_count_op.cc | 1 - paddle/fluid/operators/optimizers/adadelta_op.cc | 2 +- .../operators/optimizers/distributed_fused_lamb_init_op.cc | 1 - .../operators/optimizers/distributed_fused_lamb_op.cc | 1 - paddle/fluid/operators/p_send_op.cc | 1 - paddle/fluid/operators/print_op.cc | 1 - paddle/fluid/operators/pyramid_hash_op.cc | 3 +-- paddle/fluid/operators/random_crop_op.cc | 1 - paddle/fluid/operators/random_routing_op.cc | 1 - paddle/fluid/operators/set_value_op.cc | 1 - paddle/fluid/operators/string/faster_tokenizer_op.cc | 7 ------- paddle/fluid/operators/sum_op.cc | 2 -- paddle/fluid/operators/transfer_layout_op.cc | 1 - paddle/fluid/operators/var_conv_2d_op.cc | 3 +-- paddle/fluid/pybind/data_set_py.cc | 1 - paddle/fluid/pybind/distributed_py.cc | 2 -- paddle/fluid/pybind/eager_py_layer.cc | 2 -- paddle/fluid/pybind/heter_wrapper_py.cc | 2 -- paddle/fluid/pybind/metrics_py.cc | 2 -- paddle/fluid/pybind/nccl_wrapper_py.cc | 1 - paddle/fluid/pybind/op_function_common.cc | 1 - paddle/fluid/pybind/protobuf.cc | 3 --- paddle/fluid/pybind/ps_gpu_wrapper_py.cc | 2 -- paddle/phi/kernels/fusion/onednn/fused_matmul_kernel.cc | 5 ----- paddle/phi/kernels/onednn/matmul_kernel.cc | 1 - 45 files changed, 5 insertions(+), 75 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 518fb18aca0bd..410a9f42190d0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -163,8 +163,8 @@ cppcoreguidelines-avoid-c-arrays, -cppcoreguidelines-slicing, -hicpp-avoid-goto, -hicpp-exception-baseclass, --misc-unused-alias-decls, --misc-unused-using-decls, +misc-unused-alias-decls, +misc-unused-using-decls, modernize-avoid-bind, modernize-avoid-c-arrays, -modernize-deprecated-headers, diff --git a/paddle/fluid/distributed/auto_parallel/spmd_rules/replicated_spmd_rule.cc b/paddle/fluid/distributed/auto_parallel/spmd_rules/replicated_spmd_rule.cc index 1b072b1003d3b..230f4267c25e1 100644 --- a/paddle/fluid/distributed/auto_parallel/spmd_rules/replicated_spmd_rule.cc +++ b/paddle/fluid/distributed/auto_parallel/spmd_rules/replicated_spmd_rule.cc @@ -18,8 +18,6 @@ namespace paddle { namespace distributed { namespace auto_parallel { -using phi::distributed::auto_parallel::str_join; - std::pair, std::vector> ReplicatedSPMDRule::InferForward(const std::vector& input_specs, const paddle::framework::AttributeMap& attrs) { diff --git a/paddle/fluid/framework/ir/graph_pattern_detector.cc b/paddle/fluid/framework/ir/graph_pattern_detector.cc index ed5fc96e9d0c0..cca14f229b85e 100644 --- a/paddle/fluid/framework/ir/graph_pattern_detector.cc +++ b/paddle/fluid/framework/ir/graph_pattern_detector.cc @@ -24,9 +24,6 @@ namespace paddle { namespace framework { namespace ir { -using string::PrettyLog; -using string::Style; - size_t PDPattern::id_ = 0UL; #ifdef PADDLE_WITH_TENSORRT diff --git a/paddle/fluid/framework/ir/memory_optimize_pass/recurrent_op_eager_deletion_pass.cc b/paddle/fluid/framework/ir/memory_optimize_pass/recurrent_op_eager_deletion_pass.cc index 223d944c83a85..ac05579e4fa46 100644 --- a/paddle/fluid/framework/ir/memory_optimize_pass/recurrent_op_eager_deletion_pass.cc +++ b/paddle/fluid/framework/ir/memory_optimize_pass/recurrent_op_eager_deletion_pass.cc @@ -27,7 +27,6 @@ namespace framework { namespace ir { using paddle::operators::OpAndGradOpPair; -using paddle::operators::OpVariant; using paddle::operators::OpVariantSet; void RecurrentOpEagerDeletionPass::ApplyImpl(Graph *graph) const { diff --git a/paddle/fluid/inference/analysis/ir_pass_manager.cc b/paddle/fluid/inference/analysis/ir_pass_manager.cc index fca0e1eeabc01..140cf3b56006c 100644 --- a/paddle/fluid/inference/analysis/ir_pass_manager.cc +++ b/paddle/fluid/inference/analysis/ir_pass_manager.cc @@ -33,7 +33,6 @@ namespace paddle { namespace inference { namespace analysis { -using string::PrettyLog; using string::PrettyLogEndl; using string::Style; diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index e7d5028c14f5d..750c6397a9414 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -154,7 +154,6 @@ void UpdatePrivateDeviceContext(InferGPUContext *gpu_context, #endif } // namespace -using inference::Singleton; #ifdef PADDLE_WITH_TENSORRT using inference::tensorrt::TRTCalibratorEngine; using inference::tensorrt::TRTCalibratorEngineManager; diff --git a/paddle/fluid/inference/api/mkldnn_quantizer.cc b/paddle/fluid/inference/api/mkldnn_quantizer.cc index 234ca84cbd20c..0a0f786d9a04e 100644 --- a/paddle/fluid/inference/api/mkldnn_quantizer.cc +++ b/paddle/fluid/inference/api/mkldnn_quantizer.cc @@ -37,7 +37,6 @@ namespace paddle { using framework::Variable; using framework::ir::Graph; -using phi::CPUPlace; using ConstEigenVectorArrayMap = Eigen::Map>; using EigenMatrixDoubleArray = diff --git a/paddle/fluid/operators/activation_op.cc b/paddle/fluid/operators/activation_op.cc index b1f52b8ac30f1..e2f3e56a2a81a 100644 --- a/paddle/fluid/operators/activation_op.cc +++ b/paddle/fluid/operators/activation_op.cc @@ -338,7 +338,6 @@ DEFINE_ACTIVATION_CPU_KERNEL(SoftRelu, SoftReluFunctor, SoftReluGradFunctor) } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; #define REGISTER_ACTIVATION_OP(KERNEL_TYPE, OP_NAME, functor, grad_functor) \ REGISTER_OPERATOR( \ diff --git a/paddle/fluid/operators/add_position_encoding_op.cc b/paddle/fluid/operators/add_position_encoding_op.cc index f965cc077c481..ad24d37b90d81 100644 --- a/paddle/fluid/operators/add_position_encoding_op.cc +++ b/paddle/fluid/operators/add_position_encoding_op.cc @@ -111,7 +111,6 @@ class AddPositionEncodingGradOpMaker : public framework::SingleGradOpMaker { } // namespace paddle namespace ops = paddle::operators; -namespace plt = paddle::platform; REGISTER_OPERATOR( add_position_encoding, diff --git a/paddle/fluid/operators/assign_pos_op.cc b/paddle/fluid/operators/assign_pos_op.cc index 7b34e84aee52a..66c453885e4a9 100644 --- a/paddle/fluid/operators/assign_pos_op.cc +++ b/paddle/fluid/operators/assign_pos_op.cc @@ -75,7 +75,6 @@ specially counter orderingly. } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OP_WITHOUT_GRADIENT(assign_pos, ops::AssignPosOp, diff --git a/paddle/fluid/operators/center_loss_op.cc b/paddle/fluid/operators/center_loss_op.cc index 769cf551d1fad..28226d5d94d5a 100644 --- a/paddle/fluid/operators/center_loss_op.cc +++ b/paddle/fluid/operators/center_loss_op.cc @@ -145,7 +145,6 @@ DECLARE_NO_NEED_BUFFER_VARS_INFERER(CenterLossGradNoNeedBufVarsInferer, "X"); } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OPERATOR(center_loss, ops::CenterLossOp, diff --git a/paddle/fluid/operators/flatten_op.cu.cc b/paddle/fluid/operators/flatten_op.cu.cc index 0a055c688eec0..6fe28c4a7b689 100644 --- a/paddle/fluid/operators/flatten_op.cu.cc +++ b/paddle/fluid/operators/flatten_op.cu.cc @@ -15,7 +15,6 @@ limitations under the License. */ #include "paddle/fluid/operators/flatten_op.h" namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OP_CUDA_KERNEL(flatten, ops::FlattenKernel, diff --git a/paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc b/paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc index f6923d73c7325..9bfc5d3572563 100644 --- a/paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc +++ b/paddle/fluid/operators/fused/fused_seqpool_cvm_op.cc @@ -281,7 +281,6 @@ class FusedSeqpoolCVMGradOpMaker : public framework::SingleGradOpMaker { } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OPERATOR(fused_seqpool_cvm, ops::FusedSeqpoolCVMOp, diff --git a/paddle/fluid/operators/limit_by_capacity_op.cc b/paddle/fluid/operators/limit_by_capacity_op.cc index 26f88c305d7b4..569d1d025f79e 100644 --- a/paddle/fluid/operators/limit_by_capacity_op.cc +++ b/paddle/fluid/operators/limit_by_capacity_op.cc @@ -81,7 +81,6 @@ class LimitByCapacityOpMaker : public framework::OpProtoAndCheckerMaker { } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OP_WITHOUT_GRADIENT(limit_by_capacity, ops::LimitByCapacityOp, diff --git a/paddle/fluid/operators/memcpy_d2h_op.cc b/paddle/fluid/operators/memcpy_d2h_op.cc index 4b73dfd0353e1..7233e437e147a 100644 --- a/paddle/fluid/operators/memcpy_d2h_op.cc +++ b/paddle/fluid/operators/memcpy_d2h_op.cc @@ -106,7 +106,6 @@ raise error if the type is not listed above. } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; DECLARE_INFER_SHAPE_FUNCTOR(memcpy_d2h, MemcpyD2HInferShapeFunctor, diff --git a/paddle/fluid/operators/memcpy_h2d_op.cc b/paddle/fluid/operators/memcpy_h2d_op.cc index d90243f8f9ec3..457b629268659 100644 --- a/paddle/fluid/operators/memcpy_h2d_op.cc +++ b/paddle/fluid/operators/memcpy_h2d_op.cc @@ -108,7 +108,6 @@ raise error if the type is not listed above. } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; DECLARE_INFER_SHAPE_FUNCTOR(memcpy_h2d, MemcpyH2DInferShapeFunctor, diff --git a/paddle/fluid/operators/memcpy_op.cc b/paddle/fluid/operators/memcpy_op.cc index 8568974580be5..bb3e29df16d53 100644 --- a/paddle/fluid/operators/memcpy_op.cc +++ b/paddle/fluid/operators/memcpy_op.cc @@ -127,7 +127,6 @@ raise error if the type is not listed above. } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; DECLARE_INFER_SHAPE_FUNCTOR(memcpy, MemcpyInferShapeFunctor, diff --git a/paddle/fluid/operators/mkldnn/interpolate_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/interpolate_mkldnn_op.cc index b1015aa39d477..c0a68fe126c27 100644 --- a/paddle/fluid/operators/mkldnn/interpolate_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/interpolate_mkldnn_op.cc @@ -19,11 +19,7 @@ namespace paddle { namespace operators { using dnnl::memory; -using dnnl::primitive; -using dnnl::reorder; using dnnl::resampling_forward; -using dnnl::stream; -using phi::DataLayout; using OneDNNMemoryFormat = dnnl::memory::format_tag; template diff --git a/paddle/fluid/operators/mkldnn/quantize_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/quantize_mkldnn_op.cc index 50b4e59fe719b..48e8e12ccab14 100644 --- a/paddle/fluid/operators/mkldnn/quantize_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/quantize_mkldnn_op.cc @@ -23,10 +23,6 @@ namespace paddle { namespace operators { using dnnl::memory; -using dnnl::primitive; -using dnnl::reorder; -using dnnl::stream; -using phi::DataLayout; template class QuantOpKernel : public framework::OpKernel { diff --git a/paddle/fluid/operators/mkldnn/requantize_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/requantize_mkldnn_op.cc index 9c4407b8955db..e41baa39b47c5 100644 --- a/paddle/fluid/operators/mkldnn/requantize_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/requantize_mkldnn_op.cc @@ -23,7 +23,6 @@ namespace paddle { namespace operators { using dnnl::memory; -using dnnl::reorder; namespace { diff --git a/paddle/fluid/operators/number_count_op.cc b/paddle/fluid/operators/number_count_op.cc index b796bd9a65290..69bba2f000ae1 100644 --- a/paddle/fluid/operators/number_count_op.cc +++ b/paddle/fluid/operators/number_count_op.cc @@ -56,7 +56,6 @@ class NumberCountOpMaker : public framework::OpProtoAndCheckerMaker { } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OP_WITHOUT_GRADIENT(number_count, ops::NumberCountOp, diff --git a/paddle/fluid/operators/optimizers/adadelta_op.cc b/paddle/fluid/operators/optimizers/adadelta_op.cc index cb2c374d017fd..f2faa3fc7c2ea 100644 --- a/paddle/fluid/operators/optimizers/adadelta_op.cc +++ b/paddle/fluid/operators/optimizers/adadelta_op.cc @@ -89,7 +89,7 @@ param\_out = param + param\_update } // namespace paddle namespace ops = paddle::operators; -namespace ops = paddle::operators; + DECLARE_INFER_SHAPE_FUNCTOR(adadelta, AdadeltaInferMetaFunctor, PD_INFER_META(phi::AdadeltaInferMeta)); diff --git a/paddle/fluid/operators/optimizers/distributed_fused_lamb_init_op.cc b/paddle/fluid/operators/optimizers/distributed_fused_lamb_init_op.cc index 24d9244a8ea89..aeda36e537c7f 100644 --- a/paddle/fluid/operators/optimizers/distributed_fused_lamb_init_op.cc +++ b/paddle/fluid/operators/optimizers/distributed_fused_lamb_init_op.cc @@ -112,7 +112,6 @@ class DistributedFusedLambInitOpMaker } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OP_WITHOUT_GRADIENT(distributed_fused_lamb_init, ops::DistributedFusedLambInitOp, diff --git a/paddle/fluid/operators/optimizers/distributed_fused_lamb_op.cc b/paddle/fluid/operators/optimizers/distributed_fused_lamb_op.cc index 73ee05dff2dae..651c446db9007 100644 --- a/paddle/fluid/operators/optimizers/distributed_fused_lamb_op.cc +++ b/paddle/fluid/operators/optimizers/distributed_fused_lamb_op.cc @@ -165,7 +165,6 @@ class DistributedFusedLambOpMaker : public framework::OpProtoAndCheckerMaker { } // namespace operators } // namespace paddle -namespace plat = paddle::platform; namespace ops = paddle::operators; REGISTER_OP_WITHOUT_GRADIENT(distributed_fused_lamb, ops::DistributedFusedLambOp, diff --git a/paddle/fluid/operators/p_send_op.cc b/paddle/fluid/operators/p_send_op.cc index 30472f52cd27a..fd1ade2a83d12 100644 --- a/paddle/fluid/operators/p_send_op.cc +++ b/paddle/fluid/operators/p_send_op.cc @@ -65,7 +65,6 @@ class PSendArrayOpMaker : public framework::OpProtoAndCheckerMaker { } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; DECLARE_INFER_SHAPE_FUNCTOR(p_send, PSendInferShapeFunctor, diff --git a/paddle/fluid/operators/print_op.cc b/paddle/fluid/operators/print_op.cc index a2e1866300d55..26647e8f05c83 100644 --- a/paddle/fluid/operators/print_op.cc +++ b/paddle/fluid/operators/print_op.cc @@ -34,7 +34,6 @@ class OpBase; namespace paddle { namespace operators { -using framework::GradVarName; #define CLOG std::cout diff --git a/paddle/fluid/operators/pyramid_hash_op.cc b/paddle/fluid/operators/pyramid_hash_op.cc index c255cd9a393c3..db28f927c5eb0 100644 --- a/paddle/fluid/operators/pyramid_hash_op.cc +++ b/paddle/fluid/operators/pyramid_hash_op.cc @@ -575,8 +575,7 @@ class CPUPyramidHashOPGradKernel : public framework::OpKernel { } // namespace paddle namespace ops = paddle::operators; -namespace plt = paddle::platform; -namespace frm = paddle::framework; + REGISTER_OPERATOR(pyramid_hash, ops::PyramidHashOP, ops::PyramidHashOpMaker, diff --git a/paddle/fluid/operators/random_crop_op.cc b/paddle/fluid/operators/random_crop_op.cc index 308e22f6f89fc..196e5db055220 100644 --- a/paddle/fluid/operators/random_crop_op.cc +++ b/paddle/fluid/operators/random_crop_op.cc @@ -88,7 +88,6 @@ class RandomCropOpMaker : public framework::OpProtoAndCheckerMaker { } // namespace paddle namespace ops = paddle::operators; -namespace f = paddle::framework; REGISTER_OPERATOR( random_crop, ops::RandomCropOp, diff --git a/paddle/fluid/operators/random_routing_op.cc b/paddle/fluid/operators/random_routing_op.cc index fb91b79f8f9e1..9eaa3a664877c 100644 --- a/paddle/fluid/operators/random_routing_op.cc +++ b/paddle/fluid/operators/random_routing_op.cc @@ -88,7 +88,6 @@ DECLARE_INPLACE_OP_INFERER(RandomRoutingInplaceInferer, {"TopK_Idx", "Out"}); } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; REGISTER_OPERATOR( random_routing, diff --git a/paddle/fluid/operators/set_value_op.cc b/paddle/fluid/operators/set_value_op.cc index 4ced84dba312d..16864b80b5c76 100644 --- a/paddle/fluid/operators/set_value_op.cc +++ b/paddle/fluid/operators/set_value_op.cc @@ -236,7 +236,6 @@ DECLARE_INPLACE_OP_INFERER(SetValueOpInplaceInferer, {"Input", "Out"}); } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; DECLARE_INFER_SHAPE_FUNCTOR(set_value, SetValueInferShapeFunctor, diff --git a/paddle/fluid/operators/string/faster_tokenizer_op.cc b/paddle/fluid/operators/string/faster_tokenizer_op.cc index caf58a3fb76cc..5b5d408183879 100644 --- a/paddle/fluid/operators/string/faster_tokenizer_op.cc +++ b/paddle/fluid/operators/string/faster_tokenizer_op.cc @@ -29,15 +29,8 @@ limitations under the License. */ namespace paddle { namespace operators { -using std::bad_cast; -using std::codecvt_utf8; -using std::endl; -using std::exception; using std::ifstream; using std::int64_t; -using std::min; -using std::runtime_error; -using std::shared_ptr; using std::size_t; using std::string; using std::unordered_map; diff --git a/paddle/fluid/operators/sum_op.cc b/paddle/fluid/operators/sum_op.cc index 07ee7c6d3b29b..2c6833a60ce37 100644 --- a/paddle/fluid/operators/sum_op.cc +++ b/paddle/fluid/operators/sum_op.cc @@ -243,8 +243,6 @@ DECLARE_INPLACE_OP_INFERER(SumInplaceInferer, {"X", "Out"}); } // namespace operators } // namespace paddle -namespace ops = paddle::operators; - namespace ops = paddle::operators; DECLARE_INFER_SHAPE_FUNCTOR(sum, AddNInferShapeFunctor, diff --git a/paddle/fluid/operators/transfer_layout_op.cc b/paddle/fluid/operators/transfer_layout_op.cc index 01514ed4d1075..9df0a1f3e36ed 100644 --- a/paddle/fluid/operators/transfer_layout_op.cc +++ b/paddle/fluid/operators/transfer_layout_op.cc @@ -118,7 +118,6 @@ class TransferLayoutOpProtoMaker : public framework::OpProtoAndCheckerMaker { } // namespace paddle namespace ops = paddle::operators; -namespace plat = paddle::platform; DECLARE_INFER_SHAPE_FUNCTOR(transfer_layout, TransferLayoutInferShapeFunctor, PD_INFER_META(phi::TransferLayoutInferMeta)); diff --git a/paddle/fluid/operators/var_conv_2d_op.cc b/paddle/fluid/operators/var_conv_2d_op.cc index 31c1f61ed4bdf..f41cc2bab2021 100644 --- a/paddle/fluid/operators/var_conv_2d_op.cc +++ b/paddle/fluid/operators/var_conv_2d_op.cc @@ -523,8 +523,7 @@ class CPUVarConv2dOPGradKernel : public framework::OpKernel { } // namespace paddle namespace ops = paddle::operators; -namespace plt = paddle::platform; -namespace frm = paddle::framework; + REGISTER_OPERATOR(var_conv_2d, ops::VarConv2dOP, ops::VarConv2dOpMaker, diff --git a/paddle/fluid/pybind/data_set_py.cc b/paddle/fluid/pybind/data_set_py.cc index 621ba8c3c2dcc..9291338d70b65 100644 --- a/paddle/fluid/pybind/data_set_py.cc +++ b/paddle/fluid/pybind/data_set_py.cc @@ -39,7 +39,6 @@ limitations under the License. */ #include "paddle/fluid/pybind/data_set_py.h" namespace py = pybind11; -namespace pd = paddle::framework; namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/distributed_py.cc b/paddle/fluid/pybind/distributed_py.cc index 01df736fb10b3..259aa1f5dac49 100644 --- a/paddle/fluid/pybind/distributed_py.cc +++ b/paddle/fluid/pybind/distributed_py.cc @@ -54,8 +54,6 @@ limitations under the License. */ #include "paddle/phi/kernels/sync_batch_norm_kernel.h" -namespace py = pybind11; - namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/eager_py_layer.cc b/paddle/fluid/pybind/eager_py_layer.cc index 5f5e69ff2a850..8bd5060539965 100644 --- a/paddle/fluid/pybind/eager_py_layer.cc +++ b/paddle/fluid/pybind/eager_py_layer.cc @@ -43,8 +43,6 @@ limitations under the License. */ namespace paddle { namespace pybind { -namespace py = ::pybind11; - PyTypeObject* p_pylayer_type; extern PyTypeObject* p_tensor_type; diff --git a/paddle/fluid/pybind/heter_wrapper_py.cc b/paddle/fluid/pybind/heter_wrapper_py.cc index 0b3565d94a253..4edce885cc474 100644 --- a/paddle/fluid/pybind/heter_wrapper_py.cc +++ b/paddle/fluid/pybind/heter_wrapper_py.cc @@ -29,8 +29,6 @@ limitations under the License. */ #include "paddle/fluid/framework/fleet/heter_wrapper.h" #include "paddle/fluid/pybind/heter_wrapper_py.h" -namespace py = pybind11; - namespace paddle { namespace pybind { #if defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS) diff --git a/paddle/fluid/pybind/metrics_py.cc b/paddle/fluid/pybind/metrics_py.cc index 78e6d528b1af3..c7b5277678ffb 100644 --- a/paddle/fluid/pybind/metrics_py.cc +++ b/paddle/fluid/pybind/metrics_py.cc @@ -30,8 +30,6 @@ limitations under the License. */ #include "paddle/fluid/pybind/metrics_py.h" -namespace py = pybind11; - #if defined(PADDLE_WITH_PSLIB) namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/nccl_wrapper_py.cc b/paddle/fluid/pybind/nccl_wrapper_py.cc index 827bcaf39704d..3e47b1210b1f5 100644 --- a/paddle/fluid/pybind/nccl_wrapper_py.cc +++ b/paddle/fluid/pybind/nccl_wrapper_py.cc @@ -37,7 +37,6 @@ limitations under the License. */ #include "paddle/fluid/pybind/nccl_wrapper_py.h" namespace py = pybind11; -namespace pd = paddle::framework; namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/op_function_common.cc b/paddle/fluid/pybind/op_function_common.cc index f3abfc2a9d164..266578615e352 100644 --- a/paddle/fluid/pybind/op_function_common.cc +++ b/paddle/fluid/pybind/op_function_common.cc @@ -35,7 +35,6 @@ #include "paddle/fluid/pybind/imperative.h" #include "paddle/phi/common/complex.h" -namespace py = pybind11; namespace paddle { namespace pybind { diff --git a/paddle/fluid/pybind/protobuf.cc b/paddle/fluid/pybind/protobuf.cc index 10aa31be42e4c..0308d06d9305e 100644 --- a/paddle/fluid/pybind/protobuf.cc +++ b/paddle/fluid/pybind/protobuf.cc @@ -44,9 +44,6 @@ PyTypeObject *g_blockdesc_pytype = nullptr; namespace pd = paddle::framework; namespace jit = paddle::jit; -using paddle::distributed::auto_parallel::OperatorDistAttr; -using paddle::distributed::auto_parallel::TensorDistAttr; - template static pybind11::bytes SerializeMessage( T &self) { // NOLINT due to pybind11 convention. diff --git a/paddle/fluid/pybind/ps_gpu_wrapper_py.cc b/paddle/fluid/pybind/ps_gpu_wrapper_py.cc index 7f0026580af37..648c115643a94 100644 --- a/paddle/fluid/pybind/ps_gpu_wrapper_py.cc +++ b/paddle/fluid/pybind/ps_gpu_wrapper_py.cc @@ -29,8 +29,6 @@ limitations under the License. */ #include "paddle/fluid/framework/fleet/ps_gpu_wrapper.h" #include "paddle/fluid/pybind/ps_gpu_wrapper_py.h" -namespace py = pybind11; - namespace paddle { namespace pybind { #ifdef PADDLE_WITH_HETERPS diff --git a/paddle/phi/kernels/fusion/onednn/fused_matmul_kernel.cc b/paddle/phi/kernels/fusion/onednn/fused_matmul_kernel.cc index bbfb7f0a5170c..4beff72ab3788 100644 --- a/paddle/phi/kernels/fusion/onednn/fused_matmul_kernel.cc +++ b/paddle/phi/kernels/fusion/onednn/fused_matmul_kernel.cc @@ -18,12 +18,7 @@ #include "paddle/phi/core/kernel_registry.h" #include "paddle/phi/core/tensor_utils.h" -using dnnl::engine; -using dnnl::inner_product_forward; using dnnl::memory; -using dnnl::prop_kind; -using dnnl::stream; -using phi::ReshapeToMatrix; namespace phi { namespace fusion { diff --git a/paddle/phi/kernels/onednn/matmul_kernel.cc b/paddle/phi/kernels/onednn/matmul_kernel.cc index bfdef1170c74a..4a7081dfac025 100644 --- a/paddle/phi/kernels/onednn/matmul_kernel.cc +++ b/paddle/phi/kernels/onednn/matmul_kernel.cc @@ -23,7 +23,6 @@ using dnnl::engine; using dnnl::inner_product_forward; using dnnl::memory; using dnnl::prop_kind; -using dnnl::stream; using phi::ReshapeToMatrix; namespace phi { From c651008404911579149513fe583375f85882dd1f Mon Sep 17 00:00:00 2001 From: enkilee Date: Fri, 25 Aug 2023 06:18:57 +0000 Subject: [PATCH 2/2] fix --- paddle/fluid/inference/api/analysis_predictor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index 750c6397a9414..847a6ebdac273 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -2523,6 +2523,7 @@ void AnalysisPredictor::ClearIntermediateTensor() { } #ifdef PADDLE_WITH_TENSORRT +using inference::Singleton; bool AnalysisPredictor::SaveTrtCalibToDisk() { PADDLE_ENFORCE_EQ(config_.tensorrt_engine_enabled(), true,