diff --git a/.clang-tidy b/.clang-tidy index 78f7ceaf0a0f19fca692650e554fd21e4cbf3c53..820a244182d2304be6b65e940cf65eeed211bced 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 1b072b1003d3b81f2f73ff470aad198ba4f19667..230f4267c25e1a146c9c402c16b07d70812c91e4 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 ed5fc96e9d0c01e8383e7a006a88e01eb9e3411b..cca14f229b85e0bc8d28405a5dd69fae8991dd39 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 223d944c83a853dc90b153c47bbb764ed529c83b..ac05579e4fa46ffbdeeef6d1f96309d2ad5f605b 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 703ae0df544ea6df500727afe936ef68c9ba3b7a..47091b347c6c7fbda645804afa614391a8256ae0 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 23d7157306bcc6ded8eeb830e4be638e9f5c85de..3ef178a2a6773424313d5488ec48849493787c8b 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 234ca84cbd20cfa2ed679f070e738682acb0974c..0a0f786d9a04e5d2bb3804b6ccde14a108305d20 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 b1f52b8ac30f18f928db5c51393ed28cd2e64be4..e2f3e56a2a81aaf6ae844c17ac3e4055e17367ef 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 f965cc077c48138bab02cf750d91da3537658fe5..ad24d37b90d81779e7865d2dcfdad9473976ed59 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 7b34e84aee52a675ca4e28ca4241497aaff8dabd..66c453885e4a998fc315e0404c70f2cb3778fbbc 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 769cf551d1fade66fc5b6c3d8dd0484c1b07b56d..28226d5d94d5ac3ea109caae6238a5a8b005c602 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 0a055c688eec0afdff2d1dd846b1c05852733293..6fe28c4a7b6896e70d2fb3e188515feb04c087b3 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 f6923d73c732507c27753c86327d6d84683a5854..9bfc5d3572563f2bd02bea56b7ab29f7bddb52cb 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 26f88c305d7b4fbfc760f2ba54f4f66db5d348d8..569d1d025f79e2e06cab67cc222839516862345f 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 4b73dfd0353e1e39b7c2d3aa7927e59815725e16..7233e437e147a3eee9f37d8fa037ecd423f02380 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 d90243f8f9ec3a0ae09099806e225be99747af7c..457b62926865991e925e9562fd6712d7d138c628 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 8568974580be5bd18f986619f15bd094f97f9963..bb3e29df16d5397a2161322fa99e05ecb8a6d03f 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 b1015aa39d477c14a9ee9d931b862bd23d2db5d8..c0a68fe126c27b2e8a1f503977718a79b7455272 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 50b4e59fe719baf9f0cc8a882f6235ecf768cea0..48e8e12ccab142423be79a8d27a3cc88c0e10b24 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 9c4407b8955dbaa54a59ddf8fd099da19c485c9d..e41baa39b47c58b07a653c50e325691693680220 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 b796bd9a65290cd52808263e854d7bf38c6df1b8..69bba2f000ae1ced0adb147270c0dc932213f708 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 cb2c374d017fd30344c86f9812eddb44aaf7bad5..f2faa3fc7c2ead1dec0515ea5a14c0b3b793ad70 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 24d9244a8ea89cf341942538ebdc535930b7d88d..aeda36e537c7f0c1df971c22360f0c0b6d80e26c 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 73ee05dff2daebd40b6890e617dcee0c1a0df38b..651c446db9007ed229382ecc4688a04565f22e69 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 30472f52cd27a5d193fb77897dc855b6263bbe45..fd1ade2a83d12a69522395b1c6bea6f972de374d 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 a2e1866300d5541a35d8a38b56597e4e3cf48bb6..26647e8f05c83c50e150609e10c7d08716f09868 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 c255cd9a393c37d5fcc3b8c23a6817763543a366..db28f927c5eb00cf04e161e97fc998b0b3ff20c8 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 308e22f6f89fc77710d373c9959b210af3cea319..196e5db0552204cfbf39fa832df7145882c62dbe 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 fb91b79f8f9e19fc5dc27950e3cf66b3e67748ff..9eaa3a664877c6a16aa734936f0e7e7dbd4d7dd1 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 4ced84dba312d28a0f875bbf5fcc217110aee8d0..16864b80b5c765650d2b1dc0ba1d96cb4aafc22c 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 d1d9bfc886d672ac41482e6e3cdc9fec01d59d9d..1dc1ff29a8f805745237ecd734ea5a1baf43238d 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 07ee7c6d3b29b1f657f2b30895d9740bbec26882..2c6833a60ce372083bd6dbd57dca90053bdf6abd 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 01514ed4d1075fb050296f167dd42b2d49888b6f..9df0a1f3e36ed38b2078364d93c603ac70b80e74 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 31c1f61ed4bdf7b8ce1d4627a6a7a9d8f31caaf6..f41cc2bab2021b4c531aab2baa28f0b9b6cc8da5 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 621ba8c3c2dcc2fead5921ad104ab32abe58e6ce..9291338d70b656abee2e5864a9f6c2af957cbd17 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 01df736fb10b34d54c6cd93842eaacab71787b7a..259aa1f5dac493bbc20b56203cfee1ee7f577ada 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 5f5e69ff2a8505b813081b34d24c78cd309e6720..8bd50605399651b301c91bf914fe375a7ac6966d 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 0b3565d94a253eb862f8a8860870e06c42347ff3..4edce885cc4741dd98bee27ef8bf46b9ade82bbb 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 78e6d528b1af35d58ff20d819938af1688382299..c7b5277678ffbedc380f142c11bcd2cadac65e70 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 827bcaf39704daed8c3b3cd49f3b88de62f562f7..3e47b1210b1f59022b48c8f0438f312a6ddb60a6 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 f3abfc2a9d164243809f6d3e714fd1ae01a4846d..266578615e352526478f277dbdd21dd770034e72 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 db2e0b9e2b927800bae85ac5ea34387b0dcec1b2..0308d06d9305e17ec1ca0a24a354e1d31e14fe34 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 7f0026580af376ebe6e30686cafa5b198c4e1bb0..648c115643a9462dc2acd32d46edaf1860348f04 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 bbfb7f0a5170c14c4a6fa651ea51ece63782fe51..4beff72ab3788ffadfc571898ad59b3e096a7439 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 bfdef1170c74ae54543d46f2b7468e821ef66c59..4a7081dfac0254cca7a3d2068052fc8ea266730b 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 {