From 138bdf40e5e9b9830cb73730c53678748591d6a2 Mon Sep 17 00:00:00 2001 From: cyberslack_lee Date: Tue, 29 Aug 2023 10:43:22 +0800 Subject: [PATCH] [clang-tidy] No.26,27 enable misc-unused-using-decls,misc-unused-alias-decls (#56485) * fix * 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 | 2 +- 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, 6 insertions(+), 75 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 78f7ceaf0a0..820a244182d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -163,8 +163,8 @@ cppcoreguidelines-c-copy-assignment-signature, -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 1b072b1003d..230f4267c25 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 ed5fc96e9d0..cca14f229b8 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 223d944c83a..ac05579e4fa 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 703ae0df544..47091b347c6 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 23d7157306b..3ef178a2a67 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; @@ -2527,6 +2526,7 @@ void AnalysisPredictor::ClearIntermediateTensor() { } #ifdef PADDLE_WITH_TENSORRT +using inference::Singleton; bool AnalysisPredictor::SaveTrtCalibToDisk() { PADDLE_ENFORCE_EQ(config_.tensorrt_engine_enabled(), true, diff --git a/paddle/fluid/inference/api/mkldnn_quantizer.cc b/paddle/fluid/inference/api/mkldnn_quantizer.cc index 234ca84cbd2..0a0f786d9a0 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 b1f52b8ac30..e2f3e56a2a8 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 f965cc077c4..ad24d37b90d 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 7b34e84aee5..66c453885e4 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 769cf551d1f..28226d5d94d 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 0a055c688ee..6fe28c4a7b6 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 f6923d73c73..9bfc5d35725 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 26f88c305d7..569d1d025f7 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 4b73dfd0353..7233e437e14 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 d90243f8f9e..457b6292686 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 8568974580b..bb3e29df16d 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 b1015aa39d4..c0a68fe126c 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 50b4e59fe71..48e8e12ccab 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 9c4407b8955..e41baa39b47 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 b796bd9a652..69bba2f000a 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 cb2c374d017..f2faa3fc7c2 100644 --- a/paddle/fluid/operators/optimizers/adadelta_op.cc +++ b/paddle/fluid/operators/optimizers/adadelta_op.cc @@ -89,7 +89,7 @@ $$ } // 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 24d9244a8ea..aeda36e537c 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 73ee05dff2d..651c446db90 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 30472f52cd2..fd1ade2a83d 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 a2e1866300d..26647e8f05c 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 c255cd9a393..db28f927c5e 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 308e22f6f89..196e5db0552 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 fb91b79f8f9..9eaa3a66487 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 4ced84dba31..16864b80b5c 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 d1d9bfc886d..1dc1ff29a8f 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 07ee7c6d3b2..2c6833a60ce 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 01514ed4d10..9df0a1f3e36 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 31c1f61ed4b..f41cc2bab20 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 621ba8c3c2d..9291338d70b 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 01df736fb10..259aa1f5dac 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 5f5e69ff2a8..8bd50605399 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 0b3565d94a2..4edce885cc4 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 78e6d528b1a..c7b5277678f 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 827bcaf3970..3e47b1210b1 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 f3abfc2a9d1..266578615e3 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 db2e0b9e2b9..0308d06d930 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::TensorDistAttr; -using paddle::distributed::auto_parallel::OperatorDistAttr; - 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 7f0026580af..648c115643a 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 bbfb7f0a517..4beff72ab37 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 bfdef1170c7..4a7081dfac0 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 { -- GitLab