From beb269781d4a36084e3d5c199e8eeb5fb93a3357 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Tue, 6 Jun 2017 23:36:52 +0800 Subject: [PATCH] "change header guard to pragma" --- paddle/optimizer/CMakeLists.txt | 11 ----------- paddle/optimizer/Tensor.h | 6 ++---- paddle/optimizer/adadelta_optimizer.h | 5 +---- paddle/optimizer/adagrad_optimizer.h | 5 +---- paddle/optimizer/adam_optimizer.h | 4 +--- paddle/optimizer/lr_policy.h | 5 +---- paddle/optimizer/optimizer.h | 5 ++--- paddle/optimizer/parameter_optimizer.h | 5 +---- paddle/optimizer/serialization.h | 4 +--- 9 files changed, 10 insertions(+), 40 deletions(-) diff --git a/paddle/optimizer/CMakeLists.txt b/paddle/optimizer/CMakeLists.txt index 0f6c4eb2dd1..746f4a69f84 100644 --- a/paddle/optimizer/CMakeLists.txt +++ b/paddle/optimizer/CMakeLists.txt @@ -9,17 +9,6 @@ set(OPITMIZER_SRCS sgd_optmizer.cc ) -set(OPITMIZER_HEADERS - adadelta_optimizer.h - adagrad_optimizer.h - adam_optimizer.h - lr_policy.h - optimizer.h - parameter_optimizer.h - sgd_optimizer.h - tensor.h - ) - add_library(optimizer STATIC ${OPITMIZER_SRCS}) add_dependencies(optimizer gen_proto_cpp) diff --git a/paddle/optimizer/Tensor.h b/paddle/optimizer/Tensor.h index a887005cf41..3dbb3ca05de 100644 --- a/paddle/optimizer/Tensor.h +++ b/paddle/optimizer/Tensor.h @@ -1,10 +1,10 @@ -#ifndef PADDLE_OPTIMIZER_TENSOR_H_ -#define PADDLE_OPTIMIZER_TENSOR_H_ +#pragma once /** * @brief tensor used by optimizer */ #include +#include #include "paddle/utils/Common.h" #include "paddle/utils/Logging.h" @@ -45,5 +45,3 @@ typedef TensorT Tensor; } // namespace optimizer } // namespace paddle - -#endif diff --git a/paddle/optimizer/adadelta_optimizer.h b/paddle/optimizer/adadelta_optimizer.h index 20801c3794b..d17fae6b70a 100644 --- a/paddle/optimizer/adadelta_optimizer.h +++ b/paddle/optimizer/adadelta_optimizer.h @@ -1,5 +1,4 @@ -#ifndef PADDLE_ADADELTA_OPTIMIZER_H_ -#define PADDLE_ADADELTA_OPTIMIZER_H_ +#pragma once #include "parameter_optimizer.h" @@ -31,5 +30,3 @@ private: } // namespace optimizer } // namespace paddle - -#endif diff --git a/paddle/optimizer/adagrad_optimizer.h b/paddle/optimizer/adagrad_optimizer.h index bb64d7d5a77..6c00665c86c 100644 --- a/paddle/optimizer/adagrad_optimizer.h +++ b/paddle/optimizer/adagrad_optimizer.h @@ -1,5 +1,4 @@ -#ifndef PADDLE_ADAGRAD_OPTIMIZER_H_ -#define PADDLE_ADAGRAD_OPTIMIZER_H_ +#pragma once #include "parameter_optimizer.h" @@ -25,5 +24,3 @@ private: } // namespace optimizer } // namespace paddle - -#endif diff --git a/paddle/optimizer/adam_optimizer.h b/paddle/optimizer/adam_optimizer.h index 89e68346d58..718039e4514 100644 --- a/paddle/optimizer/adam_optimizer.h +++ b/paddle/optimizer/adam_optimizer.h @@ -1,5 +1,4 @@ -#ifndef PADDLE_ADAM_OPTIMIZER_H_ -#define PADDLE_ADAM_OPTIMIZER_H_ +#pragma once #include "parameter_optimizer.h" @@ -34,4 +33,3 @@ private: } // namespace optimizer } // namespace paddle -#endif diff --git a/paddle/optimizer/lr_policy.h b/paddle/optimizer/lr_policy.h index b24a17ced01..51debf675f3 100644 --- a/paddle/optimizer/lr_policy.h +++ b/paddle/optimizer/lr_policy.h @@ -1,5 +1,4 @@ -#ifndef PADDLE_OPTIMIZER_LR_POLICY_H_ -#define PADDLE_OPTIMIZER_LR_POLICY_H_ +#pragma once #include #include "OptimizerConfig.pb.h" @@ -41,5 +40,3 @@ private: } // namespace optimizer } // namespace paddle - -#endif diff --git a/paddle/optimizer/optimizer.h b/paddle/optimizer/optimizer.h index c3328331fc3..ee017eddabe 100644 --- a/paddle/optimizer/optimizer.h +++ b/paddle/optimizer/optimizer.h @@ -1,5 +1,5 @@ -#ifndef PADDLE_LIB_OPTIMIZER_H_ -#define PADDLE_LIB_OPTIMIZER_H_ +#pragma once + #include #include @@ -93,4 +93,3 @@ int paddle_optimizer_get_state(paddle_optimizer* o, const char* state); #ifdef __cplusplus } #endif -#endif diff --git a/paddle/optimizer/parameter_optimizer.h b/paddle/optimizer/parameter_optimizer.h index e60c7778205..33b3f837b43 100644 --- a/paddle/optimizer/parameter_optimizer.h +++ b/paddle/optimizer/parameter_optimizer.h @@ -1,5 +1,4 @@ -#ifndef PADDLE_PARAMETER_OPTIMIZER_H_ -#define PADDLE_PARAMETER_OPTIMIZER_H_ +#pragma once #include #include @@ -40,5 +39,3 @@ protected: } // namespace optimizer } // namespace paddle - -#endif diff --git a/paddle/optimizer/serialization.h b/paddle/optimizer/serialization.h index edb90d0a164..6caa514cef2 100644 --- a/paddle/optimizer/serialization.h +++ b/paddle/optimizer/serialization.h @@ -1,5 +1,4 @@ -#ifndef PADDLE_OPTIMIZER_SERIALIZARION_H -#define PADDLE_OPTIMIZER_SERIALIZARION_H +#pragma once #include #include @@ -33,4 +32,3 @@ static void ProtoToTensor(const TensorProto& proto, Tensor* tensor) { } // namespace optimizer } // namespace paddle -#endif -- GitLab