diff --git a/.clang-format b/.clang-format index fbb4eda1ba03a8f4b7d2a56edaac6e698d897c9c..d59e0885794e037ab02cd1e385cc8c16b93d3a76 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,5 @@ --- Language: Cpp -BasedOnStyle: LLVM +BasedOnStyle: Google Standard: Cpp11 ... diff --git a/src/common/log.h b/src/common/log.h index 8b85169595a83ced5293a604cc80bb1de2fc71cf..e62461c52f25c9797353c16a160c07f04a7eee71 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -51,12 +51,13 @@ struct Print; struct Print { friend struct ToLog; - template Print &operator<<(T const &value) { + template + Print &operator<<(T const &value) { buffer_ << value; return *this; } -private: + private: void print(LogLevel level) { buffer_ << std::endl; if (level == kLOG_ERROR) { @@ -76,14 +77,15 @@ struct ToLog { printer_ << logs[level] << " " << info << ":" << std::string(blanks, ' '); } - template ToLog &operator<<(T const &value) { + template + ToLog &operator<<(T const &value) { printer_ << value; return *this; } ~ToLog() { printer_.print(level_); } -private: + private: LogLevel level_; Print printer_; }; @@ -109,16 +111,16 @@ private: << (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) : __FILE__) \ << "] [line: " << __LINE__ << "] ") \ .str()) -} // namespace paddle_mobile +} // namespace paddle_mobile -#define LOGF(level, format, ...) \ - if (level > paddle_mobile::log_level) { \ - } else \ +#define LOGF(level, format, ...) \ + if (level > paddle_mobile::log_level) { \ + } else \ printf(format, ##__VA_ARGS__) -#define DLOGF(format, ...) \ - if (paddle_mobile::kLOG_DEBUG > paddle_mobile::log_level) { \ - } else \ +#define DLOGF(format, ...) \ + if (paddle_mobile::kLOG_DEBUG > paddle_mobile::log_level) { \ + } else \ printf(format, ##__VA_ARGS__) #else @@ -140,30 +142,34 @@ enum LogLevel { struct ToLog; struct Print { friend struct ToLog; - template Print &operator<<(T const &value) {} + template + Print &operator<<(T const &value) {} -private: + private: }; struct ToLog { ToLog(LogLevel level) {} - template ToLog &operator<<(T const &value) { return *this; } + template + ToLog &operator<<(T const &value) { + return *this; + } }; -#define LOG(level) \ - if (true) { \ - } else \ +#define LOG(level) \ + if (true) { \ + } else \ paddle_mobile::ToLog(level) -#define DLOG \ - if (true) { \ - } else \ +#define DLOG \ + if (true) { \ + } else \ paddle_mobile::ToLog(paddle_mobile::kLOG_DEBUG) #define LOGF(level, format, ...) #define DLOGF(format, ...) -} // namespace paddle_mobile +} // namespace paddle_mobile #endif diff --git a/src/common/type_define.h b/src/common/type_define.h index ba55aa8a63b3a34654eb12a380cf0866e1cf8df8..895a7f9786ed3ad10cf336f8323d55b50e9bb6a7 100644 --- a/src/common/type_define.h +++ b/src/common/type_define.h @@ -17,18 +17,19 @@ SOFTWARE. ==============================================================================*/ #pragma once; -#include "framework/attribute.h" #include #include +#include "framework/attribute.h" namespace paddle_mobile { namespace framework { -template class OperatorBase; +template +class OperatorBase; class OpDesc; class BlockDesc; class InferShapeContext; -} // namespace framework +} // namespace framework using VariableNameMap = std::map>; @@ -49,4 +50,4 @@ using InferVarTypeFN = std::function; using InferShapeFN = std::function; -}; // namespace paddle_mobile +}; // namespace paddle_mobile diff --git a/src/common/types.h b/src/common/types.h index 84af63e4bcfd57fe2ac4f7e2525e31213ff2692a..61807be8701d4a86b9661a2563b469ba37d99612 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -24,7 +24,8 @@ enum class Precision : int { FP32 = 0 }; //! device type enum DeviceTypeEnum { kINVALID = -1, kCPU = 0, kFPGA = 1, kGPU_MALI = 2 }; -template struct DeviceType {}; +template +struct DeviceType {}; typedef DeviceType CPU; typedef DeviceType FPGA; @@ -60,4 +61,4 @@ enum PMStatus { PMUnImplError = 0x07, /*!< Unimplement error. */ PMWrongDevice = 0x08 /*!< un-correct device. */ }; -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/common/variant.h b/src/common/variant.h index 24eee64ff387b638a8650fb9be230aed75b8a8d7..b1b924059d83bad6b6ba969dcaa157e2e00619bc 100644 --- a/src/common/variant.h +++ b/src/common/variant.h @@ -21,9 +21,13 @@ SOFTWARE. #pragma once namespace paddle_mobile { -template struct IDToType { typedef Type type_t; }; +template +struct IDToType { + typedef Type type_t; +}; -template struct VariantHelper { +template +struct VariantHelper { static const size_t size = sizeof(F) > VariantHelper::size ? sizeof(F) : VariantHelper::size; @@ -37,7 +41,8 @@ template struct VariantHelper { } }; -template struct VariantHelper { +template +struct VariantHelper { static const size_t size = sizeof(F); inline static void Destroy(size_t id, void *data) { if (id == typeid(F).hash_code()) { @@ -48,8 +53,9 @@ template struct VariantHelper { } }; -template class RawData { -public: +template +class RawData { + public: char data[size]; RawData() {} RawData(const RawData &raw_data) { strcpy(data, raw_data.data); } @@ -58,7 +64,8 @@ public: // } }; -template struct Variant { +template +struct Variant { Variant(const Variant &variant) { // std::cout << " 赋值构造函数 " << std::endl; type_id = variant.type_id; @@ -70,13 +77,15 @@ template struct Variant { // helper::Destroy(type_id, &data); } - template void Set(Args &&... args) { + template + void Set(Args &&... args) { helper::Destroy(type_id, &data); new (&data) T(std::forward(args)...); type_id = typeid(T).hash_code(); } - template T &Get() const { + template + T &Get() const { if (type_id == typeid(T).hash_code()) { return *const_cast(reinterpret_cast(&data)); } else { @@ -87,13 +96,16 @@ template struct Variant { size_t TypeId() const { return type_id; } -private: + private: static inline size_t invalid_type() { return typeid(void).hash_code(); } typedef VariantHelper helper; size_t type_id; RawData data; }; -template struct Vistor { typedef T type_t; }; +template +struct Vistor { + typedef T type_t; +}; -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/framework/attribute.cpp b/src/framework/attribute.cpp index 5050ca3aba021e8758a4d13f45c2054302e2b611..a3b9cf6a4ffeb8e684d6b0eeafa93ff34142cef0 100644 --- a/src/framework/attribute.cpp +++ b/src/framework/attribute.cpp @@ -18,4 +18,4 @@ SOFTWARE. namespace paddle_mobile { namespace framework {} -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/framework/attribute.h b/src/framework/attribute.h index 8f0f11c70e3cd8da65b6ae04de0b3ce12c2c9400..c6cbb80442fadc8e9cf6cde97ff97bb7de91038b 100644 --- a/src/framework/attribute.h +++ b/src/framework/attribute.h @@ -27,80 +27,84 @@ namespace framework { class BlockDesc; class Attribute { -public: + public: static Attribute GetAttrValue(const proto::OpDesc::Attr &attr_desc) { // std::cout << "begin get attr value" << std::endl; Attribute attr; switch (attr_desc.type()) { - case proto::AttrType::BOOLEAN: { - attr.Set(attr_desc.b()); - break; - } - case proto::AttrType::INT: { - attr.Set(attr_desc.i()); - break; - } - case proto::AttrType::FLOAT: { - attr.Set(attr_desc.f()); - break; - } - case proto::AttrType::STRING: { - attr.Set(attr_desc.s()); - break; - } - case proto::AttrType::BOOLEANS: { - std::vector val(attr_desc.bools_size()); - for (int i = 0; i < attr_desc.bools_size(); ++i) { - val[i] = attr_desc.bools(i); + case proto::AttrType::BOOLEAN: { + attr.Set(attr_desc.b()); + break; } - attr.Set>(val); - break; - } - case proto::AttrType::INTS: { - std::vector val(attr_desc.ints_size()); - for (int i = 0; i < attr_desc.ints_size(); ++i) { - val[i] = attr_desc.ints(i); + case proto::AttrType::INT: { + attr.Set(attr_desc.i()); + break; } - attr.Set>(val); - break; - } - case proto::AttrType::FLOATS: { - std::vector val(attr_desc.floats_size()); - for (int i = 0; i < attr_desc.floats_size(); ++i) { - val[i] = attr_desc.floats(i); + case proto::AttrType::FLOAT: { + attr.Set(attr_desc.f()); + break; } - attr.Set>(val); - break; - } - case proto::AttrType::STRINGS: { - std::vector val(attr_desc.strings_size()); - for (int i = 0; i < attr_desc.strings_size(); ++i) { - val[i] = attr_desc.strings(i); + case proto::AttrType::STRING: { + attr.Set(attr_desc.s()); + break; } - attr.Set>(val); - break; - } - case proto::AttrType::LONG: { - attr.Set(attr_desc.l()); - break; - } - default: - // std::cout << " not support " << std::endl; - break; + case proto::AttrType::BOOLEANS: { + std::vector val(attr_desc.bools_size()); + for (int i = 0; i < attr_desc.bools_size(); ++i) { + val[i] = attr_desc.bools(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::INTS: { + std::vector val(attr_desc.ints_size()); + for (int i = 0; i < attr_desc.ints_size(); ++i) { + val[i] = attr_desc.ints(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::FLOATS: { + std::vector val(attr_desc.floats_size()); + for (int i = 0; i < attr_desc.floats_size(); ++i) { + val[i] = attr_desc.floats(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::STRINGS: { + std::vector val(attr_desc.strings_size()); + for (int i = 0; i < attr_desc.strings_size(); ++i) { + val[i] = attr_desc.strings(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::LONG: { + attr.Set(attr_desc.l()); + break; + } + default: + // std::cout << " not support " << std::endl; + break; } // std::cout << "end get attr value" << std::endl; return attr; } Attribute() {} - template Attribute &Set(Args &&... args) { + template + Attribute &Set(Args &&... args) { variant_.Set(args...); return *this; } - template T &Get() const { return variant_.Get(); } + template + T &Get() const { + return variant_.Get(); + } -private: + private: Variant, std::vector, std::vector, bool, std::vector, BlockDesc *, int64_t> @@ -110,10 +114,11 @@ private: using AttributeMap = std::unordered_map; class AttrReader { -public: + public: explicit AttrReader(const AttributeMap &attrs) : attrs_(attrs) {} - template inline T Get(const std::string &name) const { + template + inline T Get(const std::string &name) const { // PADDLE_ENFORCE(attrs_.count(name) != 0, "%s should // be in // AttributeMap", @@ -121,9 +126,9 @@ public: return ((Attribute)attrs_.at(name)).Get(); } -private: + private: const AttributeMap &attrs_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/block_desc.cpp b/src/framework/block_desc.cpp index ed7e25478fe43e62302d897c302ecde4ff30bdea..5f7c1295f1103c711a1d7e551013635000039fad 100644 --- a/src/framework/block_desc.cpp +++ b/src/framework/block_desc.cpp @@ -46,5 +46,5 @@ BlockDesc::BlockDesc(const proto::BlockDesc &desc) : desc_(desc) { } } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/block_desc.h b/src/framework/block_desc.h index 4a71c1b7a0e6826b63370558b2dd1a758d800dcd..02ff14e52e1ca59dbb28f61193ec2b6352672416 100644 --- a/src/framework/block_desc.h +++ b/src/framework/block_desc.h @@ -27,7 +27,7 @@ namespace paddle_mobile { namespace framework { class BlockDesc : PaddleMobileObject { -public: + public: BlockDesc(const proto::BlockDesc &desc); const int &ID() const { return desc_.idx(); } @@ -45,18 +45,19 @@ public: std::vector> Vars() const; std::vector> Ops() const; -private: + private: proto::BlockDesc desc_; std::vector> ops_; std::unordered_map> vars_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile namespace std { -template <> struct hash { +template <> +struct hash { typedef paddle_mobile::framework::BlockDesc argument_type; typedef std::size_t result_type; result_type operator()(argument_type const &s) const noexcept { @@ -66,4 +67,4 @@ template <> struct hash { } }; -} // namespace std +} // namespace std diff --git a/src/framework/data_layout.h b/src/framework/data_layout.h index bb76f224a8d932c04982bef322ef82368f4c82df..d669486fbceea08c10f9dcf2151b90e1e3ab19cc 100644 --- a/src/framework/data_layout.h +++ b/src/framework/data_layout.h @@ -46,15 +46,15 @@ inline DataLayout StringToDataLayout(const std::string &str) { inline std::string DataLayoutToString(const DataLayout &data_layout) { switch (data_layout) { - case DataLayout::kNHWC: - return "NHWC"; - case DataLayout::kNCHW: - return "NCHW"; - case DataLayout::kAnyLayout: - return "ANY_LAYOUT"; - default: - break; - // std::cout << "unknown DataLayou %d", data_layout; + case DataLayout::kNHWC: + return "NHWC"; + case DataLayout::kNCHW: + return "NCHW"; + case DataLayout::kAnyLayout: + return "ANY_LAYOUT"; + default: + break; + // std::cout << "unknown DataLayou %d", data_layout; } } @@ -63,5 +63,5 @@ inline std::ostream &operator<<(std::ostream &out, const DataLayout &l) { return out; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/data_transform.cpp b/src/framework/data_transform.cpp index 996249fc4a840aa57c127e078421a6db84e1fe18..bd01e267a9f374c5fe046680b075c28f93950ed9 100644 --- a/src/framework/data_transform.cpp +++ b/src/framework/data_transform.cpp @@ -88,5 +88,5 @@ void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor, // } } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/data_transform.h b/src/framework/data_transform.h index 13ffdfb39d297694d8a8d62a34e56b6468e9ad8c..f4f43463ffe15d2093d1a11c0f56ea6c2d6587d1 100644 --- a/src/framework/data_transform.h +++ b/src/framework/data_transform.h @@ -37,5 +37,5 @@ void DataTransform(const OpKernelType &expected_kernel_type, void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor, Variable &out_var); -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/data_type.h b/src/framework/data_type.h index 9593c60ed0d3f580d3328661eef831450a3dc197..8a77fc193c3be7318af1a9a8805beeac9feb74c2 100644 --- a/src/framework/data_type.h +++ b/src/framework/data_type.h @@ -40,4 +40,4 @@ namespace framework { // } // } } -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/framework/ddim.cc b/src/framework/ddim.cc index 6bb2d9e498badeeec6fe505785cc8c27179f970e..64af2ed657865b26bd0cd48cee9c20515f0cb0e4 100644 --- a/src/framework/ddim.cc +++ b/src/framework/ddim.cc @@ -19,49 +19,53 @@ namespace framework { /// @cond HIDDEN -template Dim make_dim(const int64_t *d) { +template +Dim make_dim(const int64_t *d) { return Dim(*d, make_dim(d + 1)); } -template <> Dim<0> make_dim<0>(const int64_t *d) { return Dim<0>(*d); } +template <> +Dim<0> make_dim<0>(const int64_t *d) { + return Dim<0>(*d); +} void make_ddim(DDim &ddim, const int64_t *dims, int n) { switch (n) { - case 0: - ddim = make_dim<0>(dims); - break; - case 1: - ddim = make_dim<1>(dims); - break; - case 2: - ddim = make_dim<2>(dims); - break; - case 3: - ddim = make_dim<3>(dims); - break; - case 4: - ddim = make_dim<4>(dims); - break; - case 5: - ddim = make_dim<5>(dims); - break; - case 6: - ddim = make_dim<6>(dims); - break; - case 7: - ddim = make_dim<7>(dims); - break; - case 8: - ddim = make_dim<8>(dims); - break; - case 9: - ddim = make_dim<9>(dims); - break; - default: - // std::cout << "Dynamic dimensions must have between [1, - // 9] - // dimensions."; - break; + case 0: + ddim = make_dim<0>(dims); + break; + case 1: + ddim = make_dim<1>(dims); + break; + case 2: + ddim = make_dim<2>(dims); + break; + case 3: + ddim = make_dim<3>(dims); + break; + case 4: + ddim = make_dim<4>(dims); + break; + case 5: + ddim = make_dim<5>(dims); + break; + case 6: + ddim = make_dim<6>(dims); + break; + case 7: + ddim = make_dim<7>(dims); + break; + case 8: + ddim = make_dim<8>(dims); + break; + case 9: + ddim = make_dim<9>(dims); + break; + default: + // std::cout << "Dynamic dimensions must have between [1, + // 9] + // dimensions."; + break; } } @@ -90,24 +94,28 @@ DDim make_ddim(const std::vector &dims) { // XXX For some reason, putting this in an anonymous namespace causes // errors struct DynamicMutableIndexer : Vistor { -public: + public: explicit DynamicMutableIndexer(int idx) : idx_(idx) {} - template int64_t &operator()(Dim &dim) const { return dim[idx_]; } + template + int64_t &operator()(Dim &dim) const { + return dim[idx_]; + } -private: + private: int idx_; }; struct DynamicConstIndexer : public Vistor { -public: + public: explicit DynamicConstIndexer(int idx) : idx_(idx) {} - template int64_t operator()(const Dim &dim) const { + template + int64_t operator()(const Dim &dim) const { return dim[idx_]; } -private: + private: int idx_; }; @@ -182,7 +190,8 @@ struct VectorizeVisitor : Vistor { explicit VectorizeVisitor(std::vector &v) : vector(v) {} - template void operator()(const T &t) { + template + void operator()(const T &t) { vector.push_back(t.head); this->operator()(t.tail); } @@ -207,7 +216,8 @@ std::vector vectorize2int(const DDim &ddim) { } struct ProductVisitor : Vistor { - template int64_t operator()(const Dim &dim) { + template + int64_t operator()(const Dim &dim) { return product(dim); } }; @@ -233,7 +243,8 @@ struct SliceVectorizeVisitor : Vistor { // ddim slice."); } - template void operator()(const Dim &dim) { + template + void operator()(const Dim &dim) { if (begin == 0) { vector.push_back(dim.head); } else { @@ -264,7 +275,10 @@ DDim slice_ddim(const DDim &ddim, int begin, int end) { /// \cond HIDDEN struct ArityVisitor : Vistor { - template int operator()(Dim) const { return D; } + template + int operator()(Dim) const { + return D; + } }; /// \endcond @@ -282,11 +296,12 @@ int arity(const DDim &d) { struct OSVistor : Vistor { OSVistor(std::ostream &os) : os_(os) {} - template std::ostream &operator()(Dim dim) const { + template + std::ostream &operator()(Dim dim) const { return os_ << dim; } -private: + private: std::ostream &os_; }; @@ -326,5 +341,5 @@ DDim stride_numel(const framework::DDim &ddim) { return framework::make_ddim(strides); } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/ddim.h b/src/framework/ddim.h index 8405aa3b47831047989cee9b1ff1adde83b143f2..12f5559d8836aa541d6d43128b6448fa26deee8f 100644 --- a/src/framework/ddim.h +++ b/src/framework/ddim.h @@ -14,12 +14,12 @@ limitations under the License. */ #pragma once -#include "common/variant.h" -#include "dim.h" #include #include #include #include +#include "common/variant.h" +#include "dim.h" namespace paddle_mobile { namespace framework { @@ -66,11 +66,15 @@ struct DDim { DDim() { var.Set>(Dim<1>()); } - template explicit DDim(const Dim &in) { var.Set>(in); } + template + explicit DDim(const Dim &in) { + var.Set>(in); + } /*implicit*/ DDim(std::initializer_list init_list); - template DDim &operator=(const Dim &in) { + template + DDim &operator=(const Dim &in) { var.Set>(in); return *this; } @@ -159,5 +163,5 @@ DDim flatten_to_1d(const DDim &src); DDim stride(const DDim &ddim); DDim stride_numel(const DDim &ddim); -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/dim.h b/src/framework/dim.h index 5acdaf9f9219986b0001ba587daefc8409b9eace..7fc1462ae90f9c2ff6de046daa0d3f47de446a1c 100644 --- a/src/framework/dim.h +++ b/src/framework/dim.h @@ -24,7 +24,8 @@ namespace paddle_mobile { namespace framework { // Statically sized, statically indexed dimension -template struct Dim { +template +struct Dim { static constexpr int dimensions = i; template @@ -70,7 +71,8 @@ template struct Dim { }; // Base case specialization -template <> struct Dim<0> { +template <> +struct Dim<0> { static constexpr int dimensions = 0; HOSTDEVICE @@ -105,28 +107,37 @@ template <> struct Dim<0> { namespace { // Helper for accessing Dim classes -template struct DimGetter { +template +struct DimGetter { // Return a copy if Dim is const - template HOSTDEVICE static int64_t impl(const D &d) { + template + HOSTDEVICE static int64_t impl(const D &d) { return DimGetter::impl(d.tail); } // Return a reference if Dim is mutable - template HOSTDEVICE static int64_t &impl(D &d) { + template + HOSTDEVICE static int64_t &impl(D &d) { return DimGetter::impl(d.tail); } }; // Eureka! We found the element! -template <> struct DimGetter<0> { +template <> +struct DimGetter<0> { // Return a copy if Dim is const - template HOSTDEVICE static int64_t impl(const D &d) { + template + HOSTDEVICE static int64_t impl(const D &d) { return d.head; } // Return a reference if Dim is mutable - template HOSTDEVICE static int64_t &impl(D &d) { return d.head; } + template + HOSTDEVICE static int64_t &impl(D &d) { + return d.head; + } }; -template HOSTDEVICE int64_t &indexer(Dim &dim, int idx) { +template +HOSTDEVICE int64_t &indexer(Dim &dim, int idx) { #ifndef __CUDA_ARCH__ if (idx < 0) { throw std::invalid_argument("Tried to access a negative dimension"); @@ -140,7 +151,8 @@ template HOSTDEVICE int64_t &indexer(Dim &dim, int idx) { return indexer(dim.tail, idx - 1); } -template <> HOSTDEVICE int64_t &indexer<0>(Dim<0> &dim, int idx) { +template <> +HOSTDEVICE int64_t &indexer<0>(Dim<0> &dim, int idx) { #ifndef __CUDA_ARCH__ throw std::invalid_argument("Invalid index"); #else @@ -156,7 +168,8 @@ template <> HOSTDEVICE int64_t &indexer<0>(Dim<0> &dim, int idx) { #endif } -template HOSTDEVICE int64_t indexer(const Dim &dim, int idx) { +template +HOSTDEVICE int64_t indexer(const Dim &dim, int idx) { #ifndef __CUDA_ARCH__ if (idx < 0) { throw std::invalid_argument("Tried to access a negative dimension"); @@ -170,7 +183,8 @@ template HOSTDEVICE int64_t indexer(const Dim &dim, int idx) { return indexer(dim.tail, idx - 1); } -template <> HOSTDEVICE int64_t indexer<0>(const Dim<0> &dim, int idx) { +template <> +HOSTDEVICE int64_t indexer<0>(const Dim<0> &dim, int idx) { #ifndef __CUDA_ARCH__ throw std::invalid_argument("Invalid index"); #else @@ -186,25 +200,29 @@ template <> HOSTDEVICE int64_t indexer<0>(const Dim<0> &dim, int idx) { #endif } -} // namespace +} // namespace // Static access to constant Dim -template HOSTDEVICE int64_t get(const Dim &d) { +template +HOSTDEVICE int64_t get(const Dim &d) { return DimGetter::impl(d); } // Static access to mutable Dim -template HOSTDEVICE int64_t &get(Dim &d) { +template +HOSTDEVICE int64_t &get(Dim &d) { return DimGetter::impl(d); } // Dynamic access to constant Dim -template HOSTDEVICE int64_t Dim::operator[](int i) const { +template +HOSTDEVICE int64_t Dim::operator[](int i) const { // std::cout << "l: " << l << std::endl; return indexer(*this, i); } // Dynamic access to mutable Dim -template HOSTDEVICE int64_t &Dim::operator[](int i) { +template +HOSTDEVICE int64_t &Dim::operator[](int i) { return indexer(*this, i); } @@ -247,13 +265,15 @@ HOSTDEVICE inline int64_t linearize(const Dim<0> &a, const Dim<0> &b) { } // Product of a Dim -template HOSTDEVICE int64_t product(const Dim &a, int prod = 1) { +template +HOSTDEVICE int64_t product(const Dim &a, int prod = 1) { return prod * a.head * product(a.tail); } // Base case product of a Dim // Notice it is inline because it is no longer a template -template <> HOSTDEVICE inline int64_t product(const Dim<0> &a, int prod) { +template <> +HOSTDEVICE inline int64_t product(const Dim<0> &a, int prod) { return prod; } @@ -282,7 +302,8 @@ HOSTDEVICE Dim ex_prefix_mul(const Dim &src, int mul = 1) { ///\cond HIDDEN // Base case of ex_prefix_mul // Notice it is inline because it is no longer a template -template <> HOSTDEVICE inline Dim<0> ex_prefix_mul(const Dim<0> &src, int mul) { +template <> +HOSTDEVICE inline Dim<0> ex_prefix_mul(const Dim<0> &src, int mul) { return Dim<0>(); } ///\endcond @@ -290,7 +311,8 @@ template <> HOSTDEVICE inline Dim<0> ex_prefix_mul(const Dim<0> &src, int mul) { /** * Add two dimensions together */ -template HOSTDEVICE Dim dim_plus(const Dim &a, const Dim &b) { +template +HOSTDEVICE Dim dim_plus(const Dim &a, const Dim &b) { return Dim(a.head + b.head, dim_plus(a.tail, b.tail)); } @@ -308,7 +330,8 @@ HOSTDEVICE Dim operator+(const Dim &lhs, const Dim &rhs) { /** * Multiply two dimensions together */ -template HOSTDEVICE Dim dim_mult(const Dim &a, const Dim &b) { +template +HOSTDEVICE Dim dim_mult(const Dim &a, const Dim &b) { return Dim(a.head * b.head, dim_mult(a.tail, b.tail)); } @@ -365,8 +388,8 @@ HOSTDEVICE Dim make_dim(Args... idxes) { // Allows us to output a Dim // XXX For some reason, overloading fails to resolve this correctly template -typename std::enable_if<(i > 1), std::ostream &>::type -operator<<(std::ostream &os, const Dim &d) { +typename std::enable_if<(i > 1), std::ostream &>::type operator<<( + std::ostream &os, const Dim &d) { os << d.head << ", " << d.tail; return os; } @@ -374,8 +397,8 @@ operator<<(std::ostream &os, const Dim &d) { // Base case that allows us to output a Dim // XXX I wish this could be an overload instead of a template template -typename std::enable_if<(i == 1), std::ostream &>::type -operator<<(std::ostream &os, const Dim &d) { +typename std::enable_if<(i == 1), std::ostream &>::type operator<<( + std::ostream &os, const Dim &d) { os << d.head; return os; } @@ -384,7 +407,8 @@ inline std::ostream &operator<<(std::ostream &os, const Dim<0> &d) { return os; } -template HOST std::string Dim::to_string() const { +template +HOST std::string Dim::to_string() const { std::stringstream stream; stream << *this; @@ -406,5 +430,5 @@ HOSTDEVICE Dim linear_to_dimension(int linear_index, Dim extents) { return result; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index a57afdd617aa4187933c8d39942112335243a1e1..f36ea54655a2b0e2bc8b24e6698921c9a56ade5b 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -90,5 +90,5 @@ void Executor::predict(const Tensor &t, int block_id) { template class Executor; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/executor.h b/src/framework/executor.h index 951835bc244955ff8778c9d4e5f109b560cdec0c..43207147f6315808ac42b206d1fbdd4e3912b3a8 100644 --- a/src/framework/executor.h +++ b/src/framework/executor.h @@ -34,15 +34,16 @@ SOFTWARE. namespace paddle_mobile { namespace framework { -template class Executor { -public: +template +class Executor { + public: Executor(); Executor(const Program p); std::shared_ptr predict(Tensor &t); -public: + public: const framework::Program program_; std::shared_ptr to_predict_program_; @@ -54,5 +55,5 @@ public: bool use_optimize_ = false; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/framework.pb.cpp b/src/framework/framework.pb.cpp index c4d0ea759849641f8845b1fa3af2f7115e5903f4..636b0ad182eb5ee09057f1baba510e5d82e4a237 100644 --- a/src/framework/framework.pb.cpp +++ b/src/framework/framework.pb.cpp @@ -18,73 +18,73 @@ namespace paddle_mobile { namespace framework { namespace proto { class OpDesc_AttrDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpDesc_Attr_default_instance_; class OpDesc_VarDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpDesc_Var_default_instance_; class OpDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpDesc_default_instance_; class OpProto_VarDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpProto_Var_default_instance_; class OpProto_AttrDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpProto_Attr_default_instance_; class OpProtoDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpProto_default_instance_; class VarType_TensorDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_TensorDesc_default_instance_; class VarType_LoDTensorDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_LoDTensorDesc_default_instance_; class VarType_LoDTensorArrayDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed< VarType_LoDTensorArrayDesc> _instance; } _VarType_LoDTensorArrayDesc_default_instance_; class VarType_ReaderDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_ReaderDesc_default_instance_; class VarType_ChannelDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_ChannelDesc_default_instance_; class VarType_TupleDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_Tuple_default_instance_; class VarTypeDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_default_instance_; class VarDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarDesc_default_instance_; class BlockDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _BlockDesc_default_instance_; class ProgramDescDefaultTypeInternal { -public: + public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _ProgramDesc_default_instance_; @@ -217,39 +217,39 @@ void InitDefaults() { } namespace { void AddDescriptorsImpl() { InitDefaults(); } -} // anonymous namespace +} // anonymous namespace void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } -} // namespace protobuf_framework_2eproto +} // namespace protobuf_framework_2eproto bool VarType_Type_IsValid(int value) { switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - return true; - default: - return false; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + return true; + default: + return false; } } @@ -276,22 +276,22 @@ const VarType_Type VarType::TUPLE; const VarType_Type VarType::Type_MIN; const VarType_Type VarType::Type_MAX; const int VarType::Type_ARRAYSIZE; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 bool AttrType_IsValid(int value) { switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - return true; - default: - return false; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + return true; + default: + return false; } } @@ -310,7 +310,7 @@ const int OpDesc_Attr::kBFieldNumber; const int OpDesc_Attr::kBoolsFieldNumber; const int OpDesc_Attr::kBlockIdxFieldNumber; const int OpDesc_Attr::kLFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OpDesc_Attr::OpDesc_Attr() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -321,9 +321,14 @@ OpDesc_Attr::OpDesc_Attr() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc.Attr) } OpDesc_Attr::OpDesc_Attr(const OpDesc_Attr &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), ints_(from.ints_), - floats_(from.floats_), strings_(from.strings_), bools_(from.bools_) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + ints_(from.ints_), + floats_(from.floats_), + strings_(from.strings_), + bools_(from.bools_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -422,9 +427,8 @@ void OpDesc_Attr::Clear() { bool OpDesc_Attr::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -438,216 +442,223 @@ bool OpDesc_Attr::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; + // required string name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; } - break; - } - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::paddle_mobile::framework::proto::AttrType_IsValid(value)) { - set_type( - static_cast<::paddle_mobile::framework::proto::AttrType>(value)); + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::AttrType_IsValid(value)) { + set_type(static_cast<::paddle_mobile::framework::proto::AttrType>( + value)); + } else { + unknown_fields_stream.WriteVarint32(16u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } } else { - unknown_fields_stream.WriteVarint32(16u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); + goto handle_unusual; } - } else { - goto handle_unusual; + break; } - break; - } - // optional int32 i = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_i(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(input, - &i_))); - } else { - goto handle_unusual; + // optional int32 i = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_i(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(input, + &i_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional float f = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { - set_has_f(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( - input, &f_))); - } else { - goto handle_unusual; + // optional float f = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + set_has_f(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &f_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional string s = 5; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_s())); - } else { - goto handle_unusual; + // optional string s = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_s())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated int32 ints = 6; - case 6: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - 1, 48u, input, this->mutable_ints()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, this->mutable_ints()))); - } else { - goto handle_unusual; + // repeated int32 ints = 6; + case 6: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite:: + ReadRepeatedPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 48u, input, this->mutable_ints()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>( + 50u /* 50 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_ints()))); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated float floats = 7; - case 7: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< - float, - ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( - 1, 61u, input, this->mutable_floats()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - float, - ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( - input, this->mutable_floats()))); - } else { - goto handle_unusual; + // repeated float floats = 7; + case 7: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite:: + ReadRepeatedPrimitive< + float, + ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 61u, input, this->mutable_floats()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>( + 58u /* 58 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + float, + ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_floats()))); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated string strings = 8; - case 8: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->add_strings())); - } else { - goto handle_unusual; + // repeated string strings = 8; + case 8: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_strings())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool b = 10; - case 10: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { - set_has_b(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &b_))); - } else { - goto handle_unusual; + // optional bool b = 10; + case 10: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + set_has_b(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &b_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated bool bools = 11; - case 11: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - 1, 88u, input, this->mutable_bools()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - bool, - ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, this->mutable_bools()))); - } else { - goto handle_unusual; + // repeated bool bools = 11; + case 11: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadRepeatedPrimitive< + bool, + ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 88u, input, this->mutable_bools()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>( + 90u /* 90 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + bool, + ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_bools()))); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional int32 block_idx = 12; - case 12: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { - set_has_block_idx(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &block_idx_))); - } else { - goto handle_unusual; + // optional int32 block_idx = 12; + case 12: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + set_has_block_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &block_idx_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional int64 l = 13; - case 13: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { - set_has_l(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(input, - &l_))); - } else { - goto handle_unusual; + // optional int64 l = 13; + case 13: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { + set_has_l(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(input, + &l_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -770,7 +781,7 @@ size_t OpDesc_Attr::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000005) ^ 0x00000005) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required string name = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); @@ -914,21 +925,18 @@ void OpDesc_Attr::MergeFrom(const OpDesc_Attr &from) { void OpDesc_Attr::CopyFrom(const OpDesc_Attr &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc.Attr) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool OpDesc_Attr::IsInitialized() const { - if ((_has_bits_[0] & 0x00000005) != 0x00000005) - return false; + if ((_has_bits_[0] & 0x00000005) != 0x00000005) return false; return true; } void OpDesc_Attr::Swap(OpDesc_Attr *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void OpDesc_Attr::InternalSwap(OpDesc_Attr *other) { @@ -1157,13 +1165,13 @@ void OpDesc_Attr::add_ints(::google::protobuf::int32 value) { ints_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints) } -const ::google::protobuf::RepeatedField<::google::protobuf::int32> & -OpDesc_Attr::ints() const { +const ::google::protobuf::RepeatedField<::google::protobuf::int32> + &OpDesc_Attr::ints() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) return ints_; } -::google::protobuf::RepeatedField<::google::protobuf::int32> * -OpDesc_Attr::mutable_ints() { +::google::protobuf::RepeatedField<::google::protobuf::int32> + *OpDesc_Attr::mutable_ints() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) return &ints_; } @@ -1245,13 +1253,13 @@ void OpDesc_Attr::add_strings(const char *value, size_t size) { strings_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) } -const ::google::protobuf::RepeatedPtrField<::std::string> & -OpDesc_Attr::strings() const { +const ::google::protobuf::RepeatedPtrField<::std::string> + &OpDesc_Attr::strings() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) return strings_; } -::google::protobuf::RepeatedPtrField<::std::string> * -OpDesc_Attr::mutable_strings() { +::google::protobuf::RepeatedPtrField<::std::string> + *OpDesc_Attr::mutable_strings() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) return &strings_; } @@ -1336,14 +1344,14 @@ void OpDesc_Attr::set_l(::google::protobuf::int64 value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.l) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpDesc_Var::kParameterFieldNumber; const int OpDesc_Var::kArgumentsFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OpDesc_Var::OpDesc_Var() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -1354,8 +1362,10 @@ OpDesc_Var::OpDesc_Var() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc.Var) } OpDesc_Var::OpDesc_Var(const OpDesc_Var &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), arguments_(from.arguments_) { _internal_metadata_.MergeFrom(from._internal_metadata_); parameter_.UnsafeSetDefault( @@ -1420,9 +1430,8 @@ void OpDesc_Var::Clear() { bool OpDesc_Var::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -1436,43 +1445,42 @@ bool OpDesc_Var::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string parameter = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_parameter())); - } else { - goto handle_unusual; + // required string parameter = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_parameter())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated string arguments = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->add_arguments())); - } else { - goto handle_unusual; + // repeated string arguments = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_arguments())); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -1558,21 +1566,18 @@ void OpDesc_Var::MergeFrom(const OpDesc_Var &from) { void OpDesc_Var::CopyFrom(const OpDesc_Var &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc.Var) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool OpDesc_Var::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; return true; } void OpDesc_Var::Swap(OpDesc_Var *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void OpDesc_Var::InternalSwap(OpDesc_Var *other) { @@ -1713,18 +1718,18 @@ void OpDesc_Var::add_arguments(const char *value, size_t size) { arguments_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) } -const ::google::protobuf::RepeatedPtrField<::std::string> & -OpDesc_Var::arguments() const { +const ::google::protobuf::RepeatedPtrField<::std::string> + &OpDesc_Var::arguments() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) return arguments_; } -::google::protobuf::RepeatedPtrField<::std::string> * -OpDesc_Var::mutable_arguments() { +::google::protobuf::RepeatedPtrField<::std::string> + *OpDesc_Var::mutable_arguments() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) return &arguments_; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -1734,7 +1739,7 @@ const int OpDesc::kInputsFieldNumber; const int OpDesc::kOutputsFieldNumber; const int OpDesc::kAttrsFieldNumber; const int OpDesc::kIsTargetFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OpDesc::OpDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -1745,9 +1750,13 @@ OpDesc::OpDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc) } OpDesc::OpDesc(const OpDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), inputs_(from.inputs_), - outputs_(from.outputs_), attrs_(from.attrs_) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + inputs_(from.inputs_), + outputs_(from.outputs_), + attrs_(from.attrs_) { _internal_metadata_.MergeFrom(from._internal_metadata_); type_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -1816,9 +1825,8 @@ void OpDesc::Clear() { bool OpDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -1832,84 +1840,83 @@ bool OpDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_inputs())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_inputs())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.OpDesc.Var - // outputs = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_outputs())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpDesc.Var + // outputs = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_outputs())); + } else { + goto handle_unusual; + } + break; } - break; - } - // required string type = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_type())); - } else { - goto handle_unusual; + // required string type = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs - // = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_attrs())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs + // = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_attrs())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool is_target = 5 [default = false]; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - set_has_is_target(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &is_target_))); - } else { - goto handle_unusual; + // optional bool is_target = 5 [default = false]; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + set_has_is_target(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_target_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -2061,15 +2068,13 @@ void OpDesc::MergeFrom(const OpDesc &from) { void OpDesc::CopyFrom(const OpDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool OpDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; if (!::google::protobuf::internal::AllAreInitialized(this->inputs())) return false; if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) @@ -2080,8 +2085,7 @@ bool OpDesc::IsInitialized() const { } void OpDesc::Swap(OpDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void OpDesc::InternalSwap(OpDesc *other) { @@ -2169,13 +2173,13 @@ void OpDesc::set_allocated_type(::std::string *type) { // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = 1; int OpDesc::inputs_size() const { return inputs_.size(); } void OpDesc::clear_inputs() { inputs_.Clear(); } -const ::paddle_mobile::framework::proto::OpDesc_Var & -OpDesc::inputs(int index) const { +const ::paddle_mobile::framework::proto::OpDesc_Var &OpDesc::inputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs) return inputs_.Get(index); } -::paddle_mobile::framework::proto::OpDesc_Var * -OpDesc::mutable_inputs(int index) { +::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::mutable_inputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs) return inputs_.Mutable(index); } @@ -2184,14 +2188,14 @@ OpDesc::mutable_inputs(int index) { return inputs_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * -OpDesc::mutable_inputs() { + ::paddle_mobile::framework::proto::OpDesc_Var> + *OpDesc::mutable_inputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs) return &inputs_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & -OpDesc::inputs() const { + ::paddle_mobile::framework::proto::OpDesc_Var> + &OpDesc::inputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs) return inputs_; } @@ -2199,13 +2203,13 @@ OpDesc::inputs() const { // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = 2; int OpDesc::outputs_size() const { return outputs_.size(); } void OpDesc::clear_outputs() { outputs_.Clear(); } -const ::paddle_mobile::framework::proto::OpDesc_Var & -OpDesc::outputs(int index) const { +const ::paddle_mobile::framework::proto::OpDesc_Var &OpDesc::outputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs) return outputs_.Get(index); } -::paddle_mobile::framework::proto::OpDesc_Var * -OpDesc::mutable_outputs(int index) { +::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::mutable_outputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs) return outputs_.Mutable(index); } @@ -2214,14 +2218,14 @@ OpDesc::mutable_outputs(int index) { return outputs_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * -OpDesc::mutable_outputs() { + ::paddle_mobile::framework::proto::OpDesc_Var> + *OpDesc::mutable_outputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs) return &outputs_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & -OpDesc::outputs() const { + ::paddle_mobile::framework::proto::OpDesc_Var> + &OpDesc::outputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs) return outputs_; } @@ -2229,13 +2233,13 @@ OpDesc::outputs() const { // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = 4; int OpDesc::attrs_size() const { return attrs_.size(); } void OpDesc::clear_attrs() { attrs_.Clear(); } -const ::paddle_mobile::framework::proto::OpDesc_Attr & -OpDesc::attrs(int index) const { +const ::paddle_mobile::framework::proto::OpDesc_Attr &OpDesc::attrs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs) return attrs_.Get(index); } -::paddle_mobile::framework::proto::OpDesc_Attr * -OpDesc::mutable_attrs(int index) { +::paddle_mobile::framework::proto::OpDesc_Attr *OpDesc::mutable_attrs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs) return attrs_.Mutable(index); } @@ -2244,14 +2248,14 @@ OpDesc::mutable_attrs(int index) { return attrs_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> * -OpDesc::mutable_attrs() { + ::paddle_mobile::framework::proto::OpDesc_Attr> + *OpDesc::mutable_attrs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs) return &attrs_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> & -OpDesc::attrs() const { + ::paddle_mobile::framework::proto::OpDesc_Attr> + &OpDesc::attrs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs) return attrs_; } @@ -2276,7 +2280,7 @@ void OpDesc::set_is_target(bool value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.is_target) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -2286,7 +2290,7 @@ const int OpProto_Var::kCommentFieldNumber; const int OpProto_Var::kDuplicableFieldNumber; const int OpProto_Var::kIntermediateFieldNumber; const int OpProto_Var::kDispensableFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OpProto_Var::OpProto_Var() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -2297,8 +2301,10 @@ OpProto_Var::OpProto_Var() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto.Var) } OpProto_Var::OpProto_Var(const OpProto_Var &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -2394,9 +2400,8 @@ void OpProto_Var::Clear() { bool OpProto_Var::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -2410,85 +2415,84 @@ bool OpProto_Var::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; + // required string name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; } - break; - } - // required string comment = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_comment())); - } else { - goto handle_unusual; + // required string comment = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool duplicable = 3 [default = false]; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_duplicable(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &duplicable_))); - } else { - goto handle_unusual; + // optional bool duplicable = 3 [default = false]; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_duplicable(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &duplicable_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool intermediate = 4 [default = false]; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { - set_has_intermediate(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &intermediate_))); - } else { - goto handle_unusual; + // optional bool intermediate = 4 [default = false]; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + set_has_intermediate(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &intermediate_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool dispensable = 5 [default = false]; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - set_has_dispensable(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &dispensable_))); - } else { - goto handle_unusual; + // optional bool dispensable = 5 [default = false]; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + set_has_dispensable(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &dispensable_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -2568,7 +2572,7 @@ size_t OpProto_Var::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required string name = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); @@ -2644,21 +2648,18 @@ void OpProto_Var::MergeFrom(const OpProto_Var &from) { void OpProto_Var::CopyFrom(const OpProto_Var &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto.Var) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool OpProto_Var::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } void OpProto_Var::Swap(OpProto_Var *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void OpProto_Var::InternalSwap(OpProto_Var *other) { @@ -2873,7 +2874,7 @@ void OpProto_Var::set_dispensable(bool value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.dispensable) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -2882,7 +2883,7 @@ const int OpProto_Attr::kNameFieldNumber; const int OpProto_Attr::kTypeFieldNumber; const int OpProto_Attr::kCommentFieldNumber; const int OpProto_Attr::kGeneratedFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OpProto_Attr::OpProto_Attr() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -2893,8 +2894,10 @@ OpProto_Attr::OpProto_Attr() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto.Attr) } OpProto_Attr::OpProto_Attr(const OpProto_Attr &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -2990,9 +2993,8 @@ void OpProto_Attr::Clear() { bool OpProto_Attr::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -3006,80 +3008,79 @@ bool OpProto_Attr::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; + // required string name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; } - break; - } - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::paddle_mobile::framework::proto::AttrType_IsValid(value)) { - set_type( - static_cast<::paddle_mobile::framework::proto::AttrType>(value)); + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::AttrType_IsValid(value)) { + set_type(static_cast<::paddle_mobile::framework::proto::AttrType>( + value)); + } else { + unknown_fields_stream.WriteVarint32(16u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } } else { - unknown_fields_stream.WriteVarint32(16u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); + goto handle_unusual; } - } else { - goto handle_unusual; + break; } - break; - } - // required string comment = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_comment())); - } else { - goto handle_unusual; + // required string comment = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool generated = 4 [default = false]; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { - set_has_generated(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &generated_))); - } else { - goto handle_unusual; + // optional bool generated = 4 [default = false]; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + set_has_generated(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &generated_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -3160,7 +3161,7 @@ size_t OpProto_Attr::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required string name = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); @@ -3227,21 +3228,18 @@ void OpProto_Attr::MergeFrom(const OpProto_Attr &from) { void OpProto_Attr::CopyFrom(const OpProto_Attr &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto.Attr) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool OpProto_Attr::IsInitialized() const { - if ((_has_bits_[0] & 0x00000007) != 0x00000007) - return false; + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; return true; } void OpProto_Attr::Swap(OpProto_Attr *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void OpProto_Attr::InternalSwap(OpProto_Attr *other) { @@ -3436,7 +3434,7 @@ void OpProto_Attr::set_generated(bool value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.generated) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -3446,7 +3444,7 @@ const int OpProto::kInputsFieldNumber; const int OpProto::kOutputsFieldNumber; const int OpProto::kAttrsFieldNumber; const int OpProto::kCommentFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OpProto::OpProto() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -3457,9 +3455,13 @@ OpProto::OpProto() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto) } OpProto::OpProto(const OpProto &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), inputs_(from.inputs_), - outputs_(from.outputs_), attrs_(from.attrs_) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + inputs_(from.inputs_), + outputs_(from.outputs_), + attrs_(from.attrs_) { _internal_metadata_.MergeFrom(from._internal_metadata_); type_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -3544,9 +3546,8 @@ void OpProto::Clear() { bool OpProto::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -3560,82 +3561,81 @@ bool OpProto::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_type())); - } else { - goto handle_unusual; + // required string type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.OpProto.Var - // inputs = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_inputs())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpProto.Var + // inputs = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_inputs())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.OpProto.Var - // outputs = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_outputs())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpProto.Var + // outputs = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_outputs())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.OpProto.Attr - // attrs = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_attrs())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpProto.Attr + // attrs = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_attrs())); + } else { + goto handle_unusual; + } + break; } - break; - } - // required string comment = 5; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_comment())); - } else { - goto handle_unusual; + // required string comment = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -3721,7 +3721,7 @@ size_t OpProto::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required string type = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->type()); @@ -3810,15 +3810,13 @@ void OpProto::MergeFrom(const OpProto &from) { void OpProto::CopyFrom(const OpProto &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool OpProto::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; if (!::google::protobuf::internal::AllAreInitialized(this->inputs())) return false; if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) @@ -3829,8 +3827,7 @@ bool OpProto::IsInitialized() const { } void OpProto::Swap(OpProto *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void OpProto::InternalSwap(OpProto *other) { @@ -3918,13 +3915,13 @@ void OpProto::set_allocated_type(::std::string *type) { // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = 2; int OpProto::inputs_size() const { return inputs_.size(); } void OpProto::clear_inputs() { inputs_.Clear(); } -const ::paddle_mobile::framework::proto::OpProto_Var & -OpProto::inputs(int index) const { +const ::paddle_mobile::framework::proto::OpProto_Var &OpProto::inputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs) return inputs_.Get(index); } -::paddle_mobile::framework::proto::OpProto_Var * -OpProto::mutable_inputs(int index) { +::paddle_mobile::framework::proto::OpProto_Var *OpProto::mutable_inputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs) return inputs_.Mutable(index); } @@ -3933,14 +3930,14 @@ OpProto::mutable_inputs(int index) { return inputs_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * -OpProto::mutable_inputs() { + ::paddle_mobile::framework::proto::OpProto_Var> + *OpProto::mutable_inputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs) return &inputs_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & -OpProto::inputs() const { + ::paddle_mobile::framework::proto::OpProto_Var> + &OpProto::inputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs) return inputs_; } @@ -3948,13 +3945,13 @@ OpProto::inputs() const { // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = 3; int OpProto::outputs_size() const { return outputs_.size(); } void OpProto::clear_outputs() { outputs_.Clear(); } -const ::paddle_mobile::framework::proto::OpProto_Var & -OpProto::outputs(int index) const { +const ::paddle_mobile::framework::proto::OpProto_Var &OpProto::outputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs) return outputs_.Get(index); } -::paddle_mobile::framework::proto::OpProto_Var * -OpProto::mutable_outputs(int index) { +::paddle_mobile::framework::proto::OpProto_Var *OpProto::mutable_outputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs) return outputs_.Mutable(index); } @@ -3963,14 +3960,14 @@ OpProto::mutable_outputs(int index) { return outputs_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * -OpProto::mutable_outputs() { + ::paddle_mobile::framework::proto::OpProto_Var> + *OpProto::mutable_outputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs) return &outputs_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & -OpProto::outputs() const { + ::paddle_mobile::framework::proto::OpProto_Var> + &OpProto::outputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs) return outputs_; } @@ -3978,13 +3975,13 @@ OpProto::outputs() const { // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = 4; int OpProto::attrs_size() const { return attrs_.size(); } void OpProto::clear_attrs() { attrs_.Clear(); } -const ::paddle_mobile::framework::proto::OpProto_Attr & -OpProto::attrs(int index) const { +const ::paddle_mobile::framework::proto::OpProto_Attr &OpProto::attrs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs) return attrs_.Get(index); } -::paddle_mobile::framework::proto::OpProto_Attr * -OpProto::mutable_attrs(int index) { +::paddle_mobile::framework::proto::OpProto_Attr *OpProto::mutable_attrs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs) return attrs_.Mutable(index); } @@ -3993,14 +3990,14 @@ OpProto::mutable_attrs(int index) { return attrs_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> * -OpProto::mutable_attrs() { + ::paddle_mobile::framework::proto::OpProto_Attr> + *OpProto::mutable_attrs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs) return &attrs_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> & -OpProto::attrs() const { + ::paddle_mobile::framework::proto::OpProto_Attr> + &OpProto::attrs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs) return attrs_; } @@ -4071,14 +4068,14 @@ void OpProto::set_allocated_comment(::std::string *comment) { // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.comment) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_TensorDesc::kDataTypeFieldNumber; const int VarType_TensorDesc::kDimsFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType_TensorDesc::VarType_TensorDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -4089,8 +4086,11 @@ VarType_TensorDesc::VarType_TensorDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.TensorDesc) } VarType_TensorDesc::VarType_TensorDesc(const VarType_TensorDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), dims_(from.dims_) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + dims_(from.dims_) { _internal_metadata_.MergeFrom(from._internal_metadata_); data_type_ = from.data_type_; // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.TensorDesc) @@ -4118,8 +4118,8 @@ const VarType_TensorDesc &VarType_TensorDesc::default_instance() { return *internal_default_instance(); } -VarType_TensorDesc * -VarType_TensorDesc::New(::google::protobuf::Arena *arena) const { +VarType_TensorDesc *VarType_TensorDesc::New( + ::google::protobuf::Arena *arena) const { VarType_TensorDesc *n = new VarType_TensorDesc; if (arena != NULL) { arena->Own(n); @@ -4141,9 +4141,8 @@ void VarType_TensorDesc::Clear() { bool VarType_TensorDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -4157,65 +4156,67 @@ bool VarType_TensorDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { - set_data_type( - static_cast<::paddle_mobile::framework::proto::VarType_Type>( - value)); + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + set_data_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(8u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } } else { - unknown_fields_stream.WriteVarint32(8u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); + goto handle_unusual; } - } else { - goto handle_unusual; + break; } - break; - } - // repeated int64 dims = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( - 1, 16u, input, this->mutable_dims()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_dims()))); - } else { - goto handle_unusual; + // repeated int64 dims = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite:: + ReadRepeatedPrimitive< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 16u, input, this->mutable_dims()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>( + 18u /* 18 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dims()))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -4301,21 +4302,18 @@ void VarType_TensorDesc::MergeFrom(const VarType_TensorDesc &from) { void VarType_TensorDesc::CopyFrom(const VarType_TensorDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.TensorDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool VarType_TensorDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; return true; } void VarType_TensorDesc::Swap(VarType_TensorDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType_TensorDesc::InternalSwap(VarType_TensorDesc *other) { @@ -4347,8 +4345,8 @@ void VarType_TensorDesc::clear_data_type() { data_type_ = 0; clear_has_data_type(); } -::paddle_mobile::framework::proto::VarType_Type -VarType_TensorDesc::data_type() const { +::paddle_mobile::framework::proto::VarType_Type VarType_TensorDesc::data_type() + const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) return static_cast<::paddle_mobile::framework::proto::VarType_Type>( data_type_); @@ -4376,25 +4374,25 @@ void VarType_TensorDesc::add_dims(::google::protobuf::int64 value) { dims_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims) } -const ::google::protobuf::RepeatedField<::google::protobuf::int64> & -VarType_TensorDesc::dims() const { +const ::google::protobuf::RepeatedField<::google::protobuf::int64> + &VarType_TensorDesc::dims() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) return dims_; } -::google::protobuf::RepeatedField<::google::protobuf::int64> * -VarType_TensorDesc::mutable_dims() { +::google::protobuf::RepeatedField<::google::protobuf::int64> + *VarType_TensorDesc::mutable_dims() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) return &dims_; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_LoDTensorDesc::kTensorFieldNumber; const int VarType_LoDTensorDesc::kLodLevelFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType_LoDTensorDesc::VarType_LoDTensorDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -4405,8 +4403,10 @@ VarType_LoDTensorDesc::VarType_LoDTensorDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) } VarType_LoDTensorDesc::VarType_LoDTensorDesc(const VarType_LoDTensorDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); if (from.has_tensor()) { tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( @@ -4432,8 +4432,7 @@ VarType_LoDTensorDesc::~VarType_LoDTensorDesc() { } void VarType_LoDTensorDesc::SharedDtor() { - if (this != internal_default_instance()) - delete tensor_; + if (this != internal_default_instance()) delete tensor_; } void VarType_LoDTensorDesc::SetCachedSize(int size) const { @@ -4446,8 +4445,8 @@ const VarType_LoDTensorDesc &VarType_LoDTensorDesc::default_instance() { return *internal_default_instance(); } -VarType_LoDTensorDesc * -VarType_LoDTensorDesc::New(::google::protobuf::Arena *arena) const { +VarType_LoDTensorDesc *VarType_LoDTensorDesc::New( + ::google::protobuf::Arena *arena) const { VarType_LoDTensorDesc *n = new VarType_LoDTensorDesc; if (arena != NULL) { arena->Own(n); @@ -4472,9 +4471,8 @@ void VarType_LoDTensorDesc::Clear() { bool VarType_LoDTensorDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -4488,48 +4486,47 @@ bool VarType_LoDTensorDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required - // .paddle_mobile.framework.proto.VarType.TensorDesc tensor - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_tensor())); - } else { - goto handle_unusual; + // required + // .paddle_mobile.framework.proto.VarType.TensorDesc tensor + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional int32 lod_level = 2 [default = 0]; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_lod_level(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &lod_level_))); - } else { - goto handle_unusual; + // optional int32 lod_level = 2 [default = 0]; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_lod_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lod_level_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -4622,25 +4619,21 @@ void VarType_LoDTensorDesc::MergeFrom(const VarType_LoDTensorDesc &from) { void VarType_LoDTensorDesc::CopyFrom(const VarType_LoDTensorDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool VarType_LoDTensorDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; if (has_tensor()) { - if (!this->tensor_->IsInitialized()) - return false; + if (!this->tensor_->IsInitialized()) return false; } return true; } void VarType_LoDTensorDesc::Swap(VarType_LoDTensorDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType_LoDTensorDesc::InternalSwap(VarType_LoDTensorDesc *other) { @@ -4737,14 +4730,14 @@ void VarType_LoDTensorDesc::set_lod_level(::google::protobuf::int32 value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_LoDTensorArrayDesc::kTensorFieldNumber; const int VarType_LoDTensorArrayDesc::kLodLevelFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType_LoDTensorArrayDesc::VarType_LoDTensorArrayDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -4756,8 +4749,10 @@ VarType_LoDTensorArrayDesc::VarType_LoDTensorArrayDesc() } VarType_LoDTensorArrayDesc::VarType_LoDTensorArrayDesc( const VarType_LoDTensorArrayDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); if (from.has_tensor()) { tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( @@ -4783,8 +4778,7 @@ VarType_LoDTensorArrayDesc::~VarType_LoDTensorArrayDesc() { } void VarType_LoDTensorArrayDesc::SharedDtor() { - if (this != internal_default_instance()) - delete tensor_; + if (this != internal_default_instance()) delete tensor_; } void VarType_LoDTensorArrayDesc::SetCachedSize(int size) const { @@ -4798,8 +4792,8 @@ VarType_LoDTensorArrayDesc::default_instance() { return *internal_default_instance(); } -VarType_LoDTensorArrayDesc * -VarType_LoDTensorArrayDesc::New(::google::protobuf::Arena *arena) const { +VarType_LoDTensorArrayDesc *VarType_LoDTensorArrayDesc::New( + ::google::protobuf::Arena *arena) const { VarType_LoDTensorArrayDesc *n = new VarType_LoDTensorArrayDesc; if (arena != NULL) { arena->Own(n); @@ -4824,9 +4818,8 @@ void VarType_LoDTensorArrayDesc::Clear() { bool VarType_LoDTensorArrayDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -4840,48 +4833,47 @@ bool VarType_LoDTensorArrayDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required - // .paddle_mobile.framework.proto.VarType.TensorDesc tensor - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_tensor())); - } else { - goto handle_unusual; + // required + // .paddle_mobile.framework.proto.VarType.TensorDesc tensor + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional int32 lod_level = 2 [default = 0]; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_lod_level(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &lod_level_))); - } else { - goto handle_unusual; + // optional int32 lod_level = 2 [default = 0]; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_lod_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lod_level_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -4976,25 +4968,21 @@ void VarType_LoDTensorArrayDesc::MergeFrom( void VarType_LoDTensorArrayDesc::CopyFrom( const VarType_LoDTensorArrayDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool VarType_LoDTensorArrayDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; if (has_tensor()) { - if (!this->tensor_->IsInitialized()) - return false; + if (!this->tensor_->IsInitialized()) return false; } return true; } void VarType_LoDTensorArrayDesc::Swap(VarType_LoDTensorArrayDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType_LoDTensorArrayDesc::InternalSwap( @@ -5096,13 +5084,13 @@ void VarType_LoDTensorArrayDesc::set_lod_level( // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_ReaderDesc::kLodTensorFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType_ReaderDesc::VarType_ReaderDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -5113,8 +5101,10 @@ VarType_ReaderDesc::VarType_ReaderDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.ReaderDesc) } VarType_ReaderDesc::VarType_ReaderDesc(const VarType_ReaderDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), lod_tensor_(from.lod_tensor_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.ReaderDesc) @@ -5139,8 +5129,8 @@ const VarType_ReaderDesc &VarType_ReaderDesc::default_instance() { return *internal_default_instance(); } -VarType_ReaderDesc * -VarType_ReaderDesc::New(::google::protobuf::Arena *arena) const { +VarType_ReaderDesc *VarType_ReaderDesc::New( + ::google::protobuf::Arena *arena) const { VarType_ReaderDesc *n = new VarType_ReaderDesc; if (arena != NULL) { arena->Own(n); @@ -5161,9 +5151,8 @@ void VarType_ReaderDesc::Clear() { bool VarType_ReaderDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -5177,33 +5166,32 @@ bool VarType_ReaderDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated - // .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_lod_tensor())); - } else { - goto handle_unusual; + // repeated + // .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_lod_tensor())); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -5280,8 +5268,7 @@ void VarType_ReaderDesc::MergeFrom(const VarType_ReaderDesc &from) { void VarType_ReaderDesc::CopyFrom(const VarType_ReaderDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } @@ -5293,8 +5280,7 @@ bool VarType_ReaderDesc::IsInitialized() const { } void VarType_ReaderDesc::Swap(VarType_ReaderDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType_ReaderDesc::InternalSwap(VarType_ReaderDesc *other) { @@ -5332,26 +5318,26 @@ VarType_ReaderDesc::add_lod_tensor() { return lod_tensor_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * -VarType_ReaderDesc::mutable_lod_tensor() { + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + *VarType_ReaderDesc::mutable_lod_tensor() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) return &lod_tensor_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & -VarType_ReaderDesc::lod_tensor() const { + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + &VarType_ReaderDesc::lod_tensor() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) return lod_tensor_; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_ChannelDesc::kDataTypeFieldNumber; const int VarType_ChannelDesc::kCapacityFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType_ChannelDesc::VarType_ChannelDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -5362,8 +5348,10 @@ VarType_ChannelDesc::VarType_ChannelDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.ChannelDesc) } VarType_ChannelDesc::VarType_ChannelDesc(const VarType_ChannelDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&capacity_, &from.capacity_, static_cast(reinterpret_cast(&data_type_) - @@ -5397,8 +5385,8 @@ const VarType_ChannelDesc &VarType_ChannelDesc::default_instance() { return *internal_default_instance(); } -VarType_ChannelDesc * -VarType_ChannelDesc::New(::google::protobuf::Arena *arena) const { +VarType_ChannelDesc *VarType_ChannelDesc::New( + ::google::protobuf::Arena *arena) const { VarType_ChannelDesc *n = new VarType_ChannelDesc; if (arena != NULL) { arena->Own(n); @@ -5425,9 +5413,8 @@ void VarType_ChannelDesc::Clear() { bool VarType_ChannelDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -5441,58 +5428,57 @@ bool VarType_ChannelDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { - set_data_type( - static_cast<::paddle_mobile::framework::proto::VarType_Type>( - value)); + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + set_data_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(8u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } } else { - unknown_fields_stream.WriteVarint32(8u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); + goto handle_unusual; } - } else { - goto handle_unusual; + break; } - break; - } - // required int64 capacity = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_capacity(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( - input, &capacity_))); - } else { - goto handle_unusual; + // required int64 capacity = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_capacity(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &capacity_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -5556,7 +5542,7 @@ size_t VarType_ChannelDesc::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required int64 capacity = 2; total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( this->capacity()); @@ -5602,21 +5588,18 @@ void VarType_ChannelDesc::MergeFrom(const VarType_ChannelDesc &from) { void VarType_ChannelDesc::CopyFrom(const VarType_ChannelDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool VarType_ChannelDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } void VarType_ChannelDesc::Swap(VarType_ChannelDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType_ChannelDesc::InternalSwap(VarType_ChannelDesc *other) { @@ -5648,8 +5631,8 @@ void VarType_ChannelDesc::clear_data_type() { data_type_ = 0; clear_has_data_type(); } -::paddle_mobile::framework::proto::VarType_Type -VarType_ChannelDesc::data_type() const { +::paddle_mobile::framework::proto::VarType_Type VarType_ChannelDesc::data_type() + const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) return static_cast<::paddle_mobile::framework::proto::VarType_Type>( data_type_); @@ -5684,13 +5667,13 @@ void VarType_ChannelDesc::set_capacity(::google::protobuf::int64 value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_Tuple::kElementTypeFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType_Tuple::VarType_Tuple() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -5701,8 +5684,10 @@ VarType_Tuple::VarType_Tuple() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.Tuple) } VarType_Tuple::VarType_Tuple(const VarType_Tuple &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), element_type_(from.element_type_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.Tuple) @@ -5748,9 +5733,8 @@ void VarType_Tuple::Clear() { bool VarType_Tuple::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -5764,50 +5748,50 @@ bool VarType_Tuple::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .paddle_mobile.framework.proto.VarType.Type - // element_type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { - add_element_type( - static_cast<::paddle_mobile::framework::proto::VarType_Type>( - value)); + // repeated .paddle_mobile.framework.proto.VarType.Type + // element_type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + add_element_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>( + 10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedEnumPreserveUnknowns( + input, 1, + ::paddle_mobile::framework::proto::VarType_Type_IsValid, + &unknown_fields_stream, this->mutable_element_type()))); } else { - unknown_fields_stream.WriteVarint32(tag); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); + goto handle_unusual; } - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedEnumPreserveUnknowns( - input, 1, - ::paddle_mobile::framework::proto::VarType_Type_IsValid, - &unknown_fields_stream, this->mutable_element_type()))); - } else { - goto handle_unusual; + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -5880,8 +5864,7 @@ void VarType_Tuple::MergeFrom(const VarType_Tuple &from) { void VarType_Tuple::CopyFrom(const VarType_Tuple &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.Tuple) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } @@ -5889,8 +5872,7 @@ void VarType_Tuple::CopyFrom(const VarType_Tuple &from) { bool VarType_Tuple::IsInitialized() const { return true; } void VarType_Tuple::Swap(VarType_Tuple *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType_Tuple::InternalSwap(VarType_Tuple *other) { @@ -5912,8 +5894,8 @@ void VarType_Tuple::InternalSwap(VarType_Tuple *other) { // = 1; int VarType_Tuple::element_type_size() const { return element_type_.size(); } void VarType_Tuple::clear_element_type() { element_type_.Clear(); } -::paddle_mobile::framework::proto::VarType_Type -VarType_Tuple::element_type(int index) const { +::paddle_mobile::framework::proto::VarType_Type VarType_Tuple::element_type( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.Tuple.element_type) return static_cast<::paddle_mobile::framework::proto::VarType_Type>( element_type_.Get(index)); @@ -5930,8 +5912,8 @@ void VarType_Tuple::add_element_type( element_type_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type) } -const ::google::protobuf::RepeatedField & -VarType_Tuple::element_type() const { +const ::google::protobuf::RepeatedField &VarType_Tuple::element_type() + const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) return element_type_; } @@ -5940,7 +5922,7 @@ VarType_Tuple::element_type() const { return &element_type_; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -5952,7 +5934,7 @@ const int VarType::kTensorArrayFieldNumber; const int VarType::kReaderFieldNumber; const int VarType::kChannelFieldNumber; const int VarType::kTupleFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarType::VarType() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -5963,8 +5945,10 @@ VarType::VarType() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType) } VarType::VarType(const VarType &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); if (from.has_selected_rows()) { selected_rows_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( @@ -6020,18 +6004,12 @@ VarType::~VarType() { } void VarType::SharedDtor() { - if (this != internal_default_instance()) - delete selected_rows_; - if (this != internal_default_instance()) - delete lod_tensor_; - if (this != internal_default_instance()) - delete tensor_array_; - if (this != internal_default_instance()) - delete reader_; - if (this != internal_default_instance()) - delete channel_; - if (this != internal_default_instance()) - delete tuple_; + if (this != internal_default_instance()) delete selected_rows_; + if (this != internal_default_instance()) delete lod_tensor_; + if (this != internal_default_instance()) delete tensor_array_; + if (this != internal_default_instance()) delete reader_; + if (this != internal_default_instance()) delete channel_; + if (this != internal_default_instance()) delete tuple_; } void VarType::SetCachedSize(int size) const { @@ -6095,9 +6073,8 @@ void VarType::Clear() { bool VarType::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -6111,126 +6088,126 @@ bool VarType::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required .paddle_mobile.framework.proto.VarType.Type type - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { - set_type(static_cast<::paddle_mobile::framework::proto::VarType_Type>( - value)); + // required .paddle_mobile.framework.proto.VarType.Type type + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + set_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(8u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } } else { - unknown_fields_stream.WriteVarint32(8u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); + goto handle_unusual; } - } else { - goto handle_unusual; + break; } - break; - } - // optional - // .paddle_mobile.framework.proto.VarType.TensorDesc - // selected_rows = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_selected_rows())); - } else { - goto handle_unusual; + // optional + // .paddle_mobile.framework.proto.VarType.TensorDesc + // selected_rows = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_selected_rows())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_lod_tensor())); - } else { - goto handle_unusual; + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_lod_tensor())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc - // tensor_array = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_tensor_array())); - } else { - goto handle_unusual; + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc + // tensor_array = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_tensor_array())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional - // .paddle_mobile.framework.proto.VarType.ReaderDesc reader - // = 5; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_reader())); - } else { - goto handle_unusual; + // optional + // .paddle_mobile.framework.proto.VarType.ReaderDesc reader + // = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_reader())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional - // .paddle_mobile.framework.proto.VarType.ChannelDesc - // channel = - // 6; - case 6: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_channel())); - } else { - goto handle_unusual; + // optional + // .paddle_mobile.framework.proto.VarType.ChannelDesc + // channel = + // 6; + case 6: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_channel())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional .paddle_mobile.framework.proto.VarType.Tuple - // tuple = 7; - case 7: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_tuple())); - } else { - goto handle_unusual; + // optional .paddle_mobile.framework.proto.VarType.Tuple + // tuple = 7; + case 7: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_tuple())); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -6440,41 +6417,33 @@ void VarType::MergeFrom(const VarType &from) { void VarType::CopyFrom(const VarType &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool VarType::IsInitialized() const { - if ((_has_bits_[0] & 0x00000040) != 0x00000040) - return false; + if ((_has_bits_[0] & 0x00000040) != 0x00000040) return false; if (has_selected_rows()) { - if (!this->selected_rows_->IsInitialized()) - return false; + if (!this->selected_rows_->IsInitialized()) return false; } if (has_lod_tensor()) { - if (!this->lod_tensor_->IsInitialized()) - return false; + if (!this->lod_tensor_->IsInitialized()) return false; } if (has_tensor_array()) { - if (!this->tensor_array_->IsInitialized()) - return false; + if (!this->tensor_array_->IsInitialized()) return false; } if (has_reader()) { - if (!this->reader_->IsInitialized()) - return false; + if (!this->reader_->IsInitialized()) return false; } if (has_channel()) { - if (!this->channel_->IsInitialized()) - return false; + if (!this->channel_->IsInitialized()) return false; } return true; } void VarType::Swap(VarType *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarType::InternalSwap(VarType *other) { @@ -6691,8 +6660,8 @@ void VarType::clear_reader() { reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc::Clear(); clear_has_reader(); } -const ::paddle_mobile::framework::proto::VarType_ReaderDesc & -VarType::reader() const { +const ::paddle_mobile::framework::proto::VarType_ReaderDesc &VarType::reader() + const { const ::paddle_mobile::framework::proto::VarType_ReaderDesc *p = reader_; // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.reader) return p != NULL @@ -6741,8 +6710,8 @@ void VarType::clear_channel() { channel_->::paddle_mobile::framework::proto::VarType_ChannelDesc::Clear(); clear_has_channel(); } -const ::paddle_mobile::framework::proto::VarType_ChannelDesc & -VarType::channel() const { +const ::paddle_mobile::framework::proto::VarType_ChannelDesc &VarType::channel() + const { const ::paddle_mobile::framework::proto::VarType_ChannelDesc *p = channel_; // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.channel) return p != NULL @@ -6827,7 +6796,7 @@ void VarType::set_allocated_tuple( // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tuple) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -6835,7 +6804,7 @@ void VarType::set_allocated_tuple( const int VarDesc::kNameFieldNumber; const int VarDesc::kTypeFieldNumber; const int VarDesc::kPersistableFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 VarDesc::VarDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -6846,8 +6815,10 @@ VarDesc::VarDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarDesc) } VarDesc::VarDesc(const VarDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -6883,8 +6854,7 @@ VarDesc::~VarDesc() { void VarDesc::SharedDtor() { name_.DestroyNoArena( &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) - delete type_; + if (this != internal_default_instance()) delete type_; } void VarDesc::SetCachedSize(int size) const { @@ -6930,9 +6900,8 @@ void VarDesc::Clear() { bool VarDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -6946,57 +6915,56 @@ bool VarDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; + // required string name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; } - break; - } - // required .paddle_mobile.framework.proto.VarType type = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_type())); - } else { - goto handle_unusual; + // required .paddle_mobile.framework.proto.VarType type = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, mutable_type())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional bool persistable = 3 [default = false]; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_persistable(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &persistable_))); - } else { - goto handle_unusual; + // optional bool persistable = 3 [default = false]; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_persistable(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &persistable_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -7065,7 +7033,7 @@ size_t VarDesc::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required string name = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); @@ -7123,25 +7091,21 @@ void VarDesc::MergeFrom(const VarDesc &from) { void VarDesc::CopyFrom(const VarDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool VarDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; if (has_type()) { - if (!this->type_->IsInitialized()) - return false; + if (!this->type_->IsInitialized()) return false; } return true; } void VarDesc::Swap(VarDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void VarDesc::InternalSwap(VarDesc *other) { @@ -7229,8 +7193,7 @@ bool VarDesc::has_type() const { return (_has_bits_[0] & 0x00000002u) != 0; } void VarDesc::set_has_type() { _has_bits_[0] |= 0x00000002u; } void VarDesc::clear_has_type() { _has_bits_[0] &= ~0x00000002u; } void VarDesc::clear_type() { - if (type_ != NULL) - type_->::paddle_mobile::framework::proto::VarType::Clear(); + if (type_ != NULL) type_->::paddle_mobile::framework::proto::VarType::Clear(); clear_has_type(); } const ::paddle_mobile::framework::proto::VarType &VarDesc::type() const { @@ -7289,7 +7252,7 @@ void VarDesc::set_persistable(bool value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.persistable) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== @@ -7299,7 +7262,7 @@ const int BlockDesc::kParentIdxFieldNumber; const int BlockDesc::kVarsFieldNumber; const int BlockDesc::kOpsFieldNumber; const int BlockDesc::kForwardBlockIdxFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 BlockDesc::BlockDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -7310,8 +7273,11 @@ BlockDesc::BlockDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.BlockDesc) } BlockDesc::BlockDesc(const BlockDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), vars_(from.vars_), + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + vars_(from.vars_), ops_(from.ops_) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&idx_, &from.idx_, @@ -7377,9 +7343,8 @@ void BlockDesc::Clear() { bool BlockDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -7393,88 +7358,87 @@ bool BlockDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required int32 idx = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - set_has_idx(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(input, - &idx_))); - } else { - goto handle_unusual; + // required int32 idx = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + set_has_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &idx_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // required int32 parent_idx = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_parent_idx(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &parent_idx_))); - } else { - goto handle_unusual; + // required int32 parent_idx = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_parent_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &parent_idx_))); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_vars())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_vars())); + } else { + goto handle_unusual; + } + break; } - break; - } - // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_ops())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_ops())); + } else { + goto handle_unusual; + } + break; } - break; - } - // optional int32 forward_block_idx = 5 [default = -1]; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - set_has_forward_block_idx(); - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( - input, &forward_block_idx_))); - } else { - goto handle_unusual; + // optional int32 forward_block_idx = 5 [default = -1]; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + set_has_forward_block_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &forward_block_idx_))); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -7556,7 +7520,7 @@ size_t BlockDesc::ByteSizeLong() const { total_size += _internal_metadata_.unknown_fields().size(); if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. + 0) { // All required fields are present. // required int32 idx = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->idx()); @@ -7634,15 +7598,13 @@ void BlockDesc::MergeFrom(const BlockDesc &from) { void BlockDesc::CopyFrom(const BlockDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.BlockDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } bool BlockDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; if (!::google::protobuf::internal::AllAreInitialized(this->vars())) return false; if (!::google::protobuf::internal::AllAreInitialized(this->ops())) @@ -7651,8 +7613,7 @@ bool BlockDesc::IsInitialized() const { } void BlockDesc::Swap(BlockDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void BlockDesc::InternalSwap(BlockDesc *other) { @@ -7715,8 +7676,8 @@ void BlockDesc::set_parent_idx(::google::protobuf::int32 value) { // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; int BlockDesc::vars_size() const { return vars_.size(); } void BlockDesc::clear_vars() { vars_.Clear(); } -const ::paddle_mobile::framework::proto::VarDesc & -BlockDesc::vars(int index) const { +const ::paddle_mobile::framework::proto::VarDesc &BlockDesc::vars( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars) return vars_.Get(index); } @@ -7734,8 +7695,8 @@ BlockDesc::vars(int index) const { return &vars_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> & -BlockDesc::vars() const { + ::paddle_mobile::framework::proto::VarDesc> + &BlockDesc::vars() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars) return vars_; } @@ -7743,8 +7704,8 @@ BlockDesc::vars() const { // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; int BlockDesc::ops_size() const { return ops_.size(); } void BlockDesc::clear_ops() { ops_.Clear(); } -const ::paddle_mobile::framework::proto::OpDesc & -BlockDesc::ops(int index) const { +const ::paddle_mobile::framework::proto::OpDesc &BlockDesc::ops( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops) return ops_.Get(index); } @@ -7762,8 +7723,8 @@ BlockDesc::ops(int index) const { return &ops_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> & -BlockDesc::ops() const { + ::paddle_mobile::framework::proto::OpDesc> + &BlockDesc::ops() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops) return ops_; } @@ -7788,13 +7749,13 @@ void BlockDesc::set_forward_block_idx(::google::protobuf::int32 value) { // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int ProgramDesc::kBlocksFieldNumber; -#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 ProgramDesc::ProgramDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { @@ -7805,8 +7766,11 @@ ProgramDesc::ProgramDesc() // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.ProgramDesc) } ProgramDesc::ProgramDesc(const ProgramDesc &from) - : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), - _has_bits_(from._has_bits_), _cached_size_(0), blocks_(from.blocks_) { + : ::google::protobuf::MessageLite(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_), + _cached_size_(0), + blocks_(from.blocks_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.ProgramDesc) } @@ -7851,9 +7815,8 @@ void ProgramDesc::Clear() { bool ProgramDesc::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream *input) { -#define DO_(EXPRESSION) \ - if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ - goto failure +#define DO_(EXPRESSION) \ + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( ::google::protobuf::NewPermanentCallback( @@ -7867,32 +7830,31 @@ bool ProgramDesc::MergePartialFromCodedStream( ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; - if (!p.second) - goto handle_unusual; + if (!p.second) goto handle_unusual; switch ( ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .paddle_mobile.framework.proto.BlockDesc blocks - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_blocks())); - } else { - goto handle_unusual; + // repeated .paddle_mobile.framework.proto.BlockDesc blocks + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite:: + ReadMessageNoVirtual(input, add_blocks())); + } else { + goto handle_unusual; + } + break; } - break; - } - default: { - handle_unusual: - if (tag == 0) { - goto success; + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } } } success: @@ -7964,8 +7926,7 @@ void ProgramDesc::MergeFrom(const ProgramDesc &from) { void ProgramDesc::CopyFrom(const ProgramDesc &from) { // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.ProgramDesc) - if (&from == this) - return; + if (&from == this) return; Clear(); MergeFrom(from); } @@ -7977,8 +7938,7 @@ bool ProgramDesc::IsInitialized() const { } void ProgramDesc::Swap(ProgramDesc *other) { - if (other == this) - return; + if (other == this) return; InternalSwap(other); } void ProgramDesc::InternalSwap(ProgramDesc *other) { @@ -7999,13 +7959,13 @@ void ProgramDesc::InternalSwap(ProgramDesc *other) { // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; int ProgramDesc::blocks_size() const { return blocks_.size(); } void ProgramDesc::clear_blocks() { blocks_.Clear(); } -const ::paddle_mobile::framework::proto::BlockDesc & -ProgramDesc::blocks(int index) const { +const ::paddle_mobile::framework::proto::BlockDesc &ProgramDesc::blocks( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks) return blocks_.Get(index); } -::paddle_mobile::framework::proto::BlockDesc * -ProgramDesc::mutable_blocks(int index) { +::paddle_mobile::framework::proto::BlockDesc *ProgramDesc::mutable_blocks( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.ProgramDesc.blocks) return blocks_.Mutable(index); } @@ -8014,24 +7974,24 @@ ProgramDesc::mutable_blocks(int index) { return blocks_.Add(); } ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> * -ProgramDesc::mutable_blocks() { + ::paddle_mobile::framework::proto::BlockDesc> + *ProgramDesc::mutable_blocks() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks) return &blocks_; } const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> & -ProgramDesc::blocks() const { + ::paddle_mobile::framework::proto::BlockDesc> + &ProgramDesc::blocks() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks) return blocks_; } -#endif // PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) -} // namespace proto -} // namespace framework -} // namespace paddle_mobile +} // namespace proto +} // namespace framework +} // namespace paddle_mobile // @@protoc_insertion_point(global_scope) diff --git a/src/framework/framework.pb.h b/src/framework/framework.pb.h index 34a055d7c4be2935a877d2cb30ed77542df75c5c..25f3dcb0b4835d40a7ceae0e0e66cc459d601ef5 100644 --- a/src/framework/framework.pb.h +++ b/src/framework/framework.pb.h @@ -21,14 +21,14 @@ #include #include -#include // IWYU pragma: export +#include // IWYU pragma: export #include #include #include #include #include #include -#include // IWYU pragma: export +#include // IWYU pragma: export // @@protoc_insertion_point(includes) namespace paddle_mobile { namespace framework { @@ -86,9 +86,9 @@ extern VarType_TensorDescDefaultTypeInternal class VarType_Tuple; class VarType_TupleDefaultTypeInternal; extern VarType_TupleDefaultTypeInternal _VarType_Tuple_default_instance_; -} // namespace proto -} // namespace framework -} // namespace paddle_mobile +} // namespace proto +} // namespace framework +} // namespace paddle_mobile namespace paddle_mobile { namespace framework { @@ -108,7 +108,7 @@ struct TableStruct { }; void AddDescriptors(); void InitDefaults(); -} // namespace protobuf_framework_2eproto +} // namespace protobuf_framework_2eproto enum VarType_Type { VarType_Type_BOOL = 0, @@ -160,7 +160,7 @@ class OpDesc_Attr MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc.Attr) */ { -public: + public: OpDesc_Attr(); virtual ~OpDesc_Attr(); @@ -177,8 +177,7 @@ public: inline OpDesc_Attr &operator=(OpDesc_Attr &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -224,17 +223,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(OpDesc_Attr *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -250,8 +249,8 @@ public: ::google::protobuf::int32 ints(int index) const; void set_ints(int index, ::google::protobuf::int32 value); void add_ints(::google::protobuf::int32 value); - const ::google::protobuf::RepeatedField<::google::protobuf::int32> & - ints() const; + const ::google::protobuf::RepeatedField<::google::protobuf::int32> &ints() + const; ::google::protobuf::RepeatedField<::google::protobuf::int32> *mutable_ints(); // repeated float floats = 7; @@ -369,7 +368,7 @@ public: void set_block_idx(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Attr) -private: + private: void set_has_name(); void clear_has_name(); void set_has_type(); @@ -415,7 +414,7 @@ class OpDesc_Var MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc.Var) */ { -public: + public: OpDesc_Var(); virtual ~OpDesc_Var(); @@ -432,8 +431,7 @@ public: inline OpDesc_Var &operator=(OpDesc_Var &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -478,17 +476,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(OpDesc_Var *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -535,7 +533,7 @@ public: void set_allocated_parameter(::std::string *parameter); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Var) -private: + private: void set_has_parameter(); void clear_has_parameter(); @@ -554,7 +552,7 @@ class OpDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc) */ { -public: + public: OpDesc(); virtual ~OpDesc(); @@ -569,8 +567,7 @@ public: inline OpDesc &operator=(OpDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -615,17 +612,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(OpDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -646,11 +643,11 @@ public: ::paddle_mobile::framework::proto::OpDesc_Var *mutable_inputs(int index); ::paddle_mobile::framework::proto::OpDesc_Var *add_inputs(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * - mutable_inputs(); + ::paddle_mobile::framework::proto::OpDesc_Var> + *mutable_inputs(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & - inputs() const; + ::paddle_mobile::framework::proto::OpDesc_Var> + &inputs() const; // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = // 2; @@ -661,11 +658,11 @@ public: ::paddle_mobile::framework::proto::OpDesc_Var *mutable_outputs(int index); ::paddle_mobile::framework::proto::OpDesc_Var *add_outputs(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * - mutable_outputs(); + ::paddle_mobile::framework::proto::OpDesc_Var> + *mutable_outputs(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & - outputs() const; + ::paddle_mobile::framework::proto::OpDesc_Var> + &outputs() const; // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = // 4; @@ -676,11 +673,11 @@ public: ::paddle_mobile::framework::proto::OpDesc_Attr *mutable_attrs(int index); ::paddle_mobile::framework::proto::OpDesc_Attr *add_attrs(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> * - mutable_attrs(); + ::paddle_mobile::framework::proto::OpDesc_Attr> + *mutable_attrs(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> & - attrs() const; + ::paddle_mobile::framework::proto::OpDesc_Attr> + &attrs() const; // required string type = 3; bool has_type() const; @@ -705,7 +702,7 @@ public: void set_is_target(bool value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc) -private: + private: void set_has_type(); void clear_has_type(); void set_has_is_target(); @@ -735,7 +732,7 @@ class OpProto_Var MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto.Var) */ { -public: + public: OpProto_Var(); virtual ~OpProto_Var(); @@ -752,8 +749,7 @@ public: inline OpProto_Var &operator=(OpProto_Var &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -799,17 +795,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(OpProto_Var *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -870,7 +866,7 @@ public: void set_dispensable(bool value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Var) -private: + private: void set_has_name(); void clear_has_name(); void set_has_comment(); @@ -903,7 +899,7 @@ class OpProto_Attr MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto.Attr) */ { -public: + public: OpProto_Attr(); virtual ~OpProto_Attr(); @@ -920,8 +916,7 @@ public: inline OpProto_Attr &operator=(OpProto_Attr &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -967,17 +962,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(OpProto_Attr *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1031,7 +1026,7 @@ public: void set_generated(bool value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Attr) -private: + private: void set_has_name(); void clear_has_name(); void set_has_type(); @@ -1061,7 +1056,7 @@ class OpProto MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto) */ { -public: + public: OpProto(); virtual ~OpProto(); @@ -1076,8 +1071,7 @@ public: inline OpProto &operator=(OpProto &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1122,17 +1116,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(OpProto *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1153,27 +1147,27 @@ public: ::paddle_mobile::framework::proto::OpProto_Var *mutable_inputs(int index); ::paddle_mobile::framework::proto::OpProto_Var *add_inputs(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * - mutable_inputs(); + ::paddle_mobile::framework::proto::OpProto_Var> + *mutable_inputs(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & - inputs() const; + ::paddle_mobile::framework::proto::OpProto_Var> + &inputs() const; // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = // 3; int outputs_size() const; void clear_outputs(); static const int kOutputsFieldNumber = 3; - const ::paddle_mobile::framework::proto::OpProto_Var & - outputs(int index) const; + const ::paddle_mobile::framework::proto::OpProto_Var &outputs( + int index) const; ::paddle_mobile::framework::proto::OpProto_Var *mutable_outputs(int index); ::paddle_mobile::framework::proto::OpProto_Var *add_outputs(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * - mutable_outputs(); + ::paddle_mobile::framework::proto::OpProto_Var> + *mutable_outputs(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & - outputs() const; + ::paddle_mobile::framework::proto::OpProto_Var> + &outputs() const; // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = // 4; @@ -1184,11 +1178,11 @@ public: ::paddle_mobile::framework::proto::OpProto_Attr *mutable_attrs(int index); ::paddle_mobile::framework::proto::OpProto_Attr *add_attrs(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> * - mutable_attrs(); + ::paddle_mobile::framework::proto::OpProto_Attr> + *mutable_attrs(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> & - attrs() const; + ::paddle_mobile::framework::proto::OpProto_Attr> + &attrs() const; // required string type = 1; bool has_type() const; @@ -1221,7 +1215,7 @@ public: void set_allocated_comment(::std::string *comment); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto) -private: + private: void set_has_type(); void clear_has_type(); void set_has_comment(); @@ -1254,7 +1248,7 @@ class VarType_TensorDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.TensorDesc) */ { -public: + public: VarType_TensorDesc(); virtual ~VarType_TensorDesc(); @@ -1272,8 +1266,7 @@ public: inline VarType_TensorDesc &operator=(VarType_TensorDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1303,8 +1296,8 @@ public: inline VarType_TensorDesc *New() const PROTOBUF_FINAL { return New(NULL); } - VarType_TensorDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + VarType_TensorDesc *New(::google::protobuf::Arena *arena) const + PROTOBUF_FINAL; void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) PROTOBUF_FINAL; void CopyFrom(const VarType_TensorDesc &from); @@ -1320,17 +1313,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType_TensorDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1346,8 +1339,8 @@ public: ::google::protobuf::int64 dims(int index) const; void set_dims(int index, ::google::protobuf::int64 value); void add_dims(::google::protobuf::int64 value); - const ::google::protobuf::RepeatedField<::google::protobuf::int64> & - dims() const; + const ::google::protobuf::RepeatedField<::google::protobuf::int64> &dims() + const; ::google::protobuf::RepeatedField<::google::protobuf::int64> *mutable_dims(); // required .paddle_mobile.framework.proto.VarType.Type @@ -1359,7 +1352,7 @@ public: void set_data_type(::paddle_mobile::framework::proto::VarType_Type value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.TensorDesc) -private: + private: void set_has_data_type(); void clear_has_data_type(); @@ -1378,7 +1371,7 @@ class VarType_LoDTensorDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.LoDTensorDesc) */ { -public: + public: VarType_LoDTensorDesc(); virtual ~VarType_LoDTensorDesc(); @@ -1394,11 +1387,10 @@ public: *this = ::std::move(from); } - inline VarType_LoDTensorDesc & - operator=(VarType_LoDTensorDesc &&from) noexcept { + inline VarType_LoDTensorDesc &operator=( + VarType_LoDTensorDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1430,8 +1422,8 @@ public: inline VarType_LoDTensorDesc *New() const PROTOBUF_FINAL { return New(NULL); } - VarType_LoDTensorDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + VarType_LoDTensorDesc *New(::google::protobuf::Arena *arena) const + PROTOBUF_FINAL; void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) PROTOBUF_FINAL; void CopyFrom(const VarType_LoDTensorDesc &from); @@ -1447,17 +1439,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType_LoDTensorDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1485,7 +1477,7 @@ public: void set_lod_level(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorDesc) -private: + private: void set_has_tensor(); void clear_has_tensor(); void set_has_lod_level(); @@ -1506,14 +1498,14 @@ class VarType_LoDTensorArrayDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) */ { -public: + public: VarType_LoDTensorArrayDesc(); virtual ~VarType_LoDTensorArrayDesc(); VarType_LoDTensorArrayDesc(const VarType_LoDTensorArrayDesc &from); - inline VarType_LoDTensorArrayDesc & - operator=(const VarType_LoDTensorArrayDesc &from) { + inline VarType_LoDTensorArrayDesc &operator=( + const VarType_LoDTensorArrayDesc &from) { CopyFrom(from); return *this; } @@ -1523,11 +1515,10 @@ public: *this = ::std::move(from); } - inline VarType_LoDTensorArrayDesc & - operator=(VarType_LoDTensorArrayDesc &&from) noexcept { + inline VarType_LoDTensorArrayDesc &operator=( + VarType_LoDTensorArrayDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1562,8 +1553,8 @@ public: return New(NULL); } - VarType_LoDTensorArrayDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + VarType_LoDTensorArrayDesc *New(::google::protobuf::Arena *arena) const + PROTOBUF_FINAL; void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) PROTOBUF_FINAL; void CopyFrom(const VarType_LoDTensorArrayDesc &from); @@ -1579,17 +1570,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType_LoDTensorArrayDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1617,7 +1608,7 @@ public: void set_lod_level(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) -private: + private: void set_has_tensor(); void clear_has_tensor(); void set_has_lod_level(); @@ -1638,7 +1629,7 @@ class VarType_ReaderDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.ReaderDesc) */ { -public: + public: VarType_ReaderDesc(); virtual ~VarType_ReaderDesc(); @@ -1656,8 +1647,7 @@ public: inline VarType_ReaderDesc &operator=(VarType_ReaderDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1687,8 +1677,8 @@ public: inline VarType_ReaderDesc *New() const PROTOBUF_FINAL { return New(NULL); } - VarType_ReaderDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + VarType_ReaderDesc *New(::google::protobuf::Arena *arena) const + PROTOBUF_FINAL; void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) PROTOBUF_FINAL; void CopyFrom(const VarType_ReaderDesc &from); @@ -1704,17 +1694,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType_ReaderDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1729,20 +1719,20 @@ public: int lod_tensor_size() const; void clear_lod_tensor(); static const int kLodTensorFieldNumber = 1; - const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & - lod_tensor(int index) const; - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * - mutable_lod_tensor(int index); + const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc &lod_tensor( + int index) const; + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *mutable_lod_tensor( + int index); ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *add_lod_tensor(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * - mutable_lod_tensor(); + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + *mutable_lod_tensor(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & - lod_tensor() const; + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + &lod_tensor() const; // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ReaderDesc) -private: + private: ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; @@ -1759,7 +1749,7 @@ class VarType_ChannelDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.ChannelDesc) */ { -public: + public: VarType_ChannelDesc(); virtual ~VarType_ChannelDesc(); @@ -1777,8 +1767,7 @@ public: inline VarType_ChannelDesc &operator=(VarType_ChannelDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1810,8 +1799,8 @@ public: inline VarType_ChannelDesc *New() const PROTOBUF_FINAL { return New(NULL); } - VarType_ChannelDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + VarType_ChannelDesc *New(::google::protobuf::Arena *arena) const + PROTOBUF_FINAL; void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) PROTOBUF_FINAL; void CopyFrom(const VarType_ChannelDesc &from); @@ -1827,17 +1816,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType_ChannelDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1862,7 +1851,7 @@ public: void set_data_type(::paddle_mobile::framework::proto::VarType_Type value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ChannelDesc) -private: + private: void set_has_data_type(); void clear_has_data_type(); void set_has_capacity(); @@ -1886,7 +1875,7 @@ class VarType_Tuple MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.Tuple) */ { -public: + public: VarType_Tuple(); virtual ~VarType_Tuple(); @@ -1903,8 +1892,7 @@ public: inline VarType_Tuple &operator=(VarType_Tuple &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1950,17 +1938,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType_Tuple *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -1982,7 +1970,7 @@ public: ::google::protobuf::RepeatedField *mutable_element_type(); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.Tuple) -private: + private: ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; @@ -1997,7 +1985,7 @@ class VarType MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType) */ { -public: + public: VarType(); virtual ~VarType(); @@ -2012,8 +2000,7 @@ public: inline VarType &operator=(VarType &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -2058,17 +2045,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarType *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -2117,8 +2104,8 @@ public: bool has_selected_rows() const; void clear_selected_rows(); static const int kSelectedRowsFieldNumber = 2; - const ::paddle_mobile::framework::proto::VarType_TensorDesc & - selected_rows() const; + const ::paddle_mobile::framework::proto::VarType_TensorDesc &selected_rows() + const; ::paddle_mobile::framework::proto::VarType_TensorDesc * mutable_selected_rows(); ::paddle_mobile::framework::proto::VarType_TensorDesc * @@ -2132,8 +2119,8 @@ public: bool has_lod_tensor() const; void clear_lod_tensor(); static const int kLodTensorFieldNumber = 3; - const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & - lod_tensor() const; + const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc &lod_tensor() + const; ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * mutable_lod_tensor(); ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * @@ -2187,8 +2174,8 @@ public: const ::paddle_mobile::framework::proto::VarType_Tuple &tuple() const; ::paddle_mobile::framework::proto::VarType_Tuple *mutable_tuple(); ::paddle_mobile::framework::proto::VarType_Tuple *release_tuple(); - void - set_allocated_tuple(::paddle_mobile::framework::proto::VarType_Tuple *tuple); + void set_allocated_tuple( + ::paddle_mobile::framework::proto::VarType_Tuple *tuple); // required .paddle_mobile.framework.proto.VarType.Type type = // 1; @@ -2199,7 +2186,7 @@ public: void set_type(::paddle_mobile::framework::proto::VarType_Type value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType) -private: + private: void set_has_type(); void clear_has_type(); void set_has_selected_rows(); @@ -2235,7 +2222,7 @@ class VarDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarDesc) */ { -public: + public: VarDesc(); virtual ~VarDesc(); @@ -2250,8 +2237,7 @@ public: inline VarDesc &operator=(VarDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -2296,17 +2282,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(VarDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -2347,7 +2333,7 @@ public: void set_persistable(bool value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarDesc) -private: + private: void set_has_name(); void clear_has_name(); void set_has_type(); @@ -2374,7 +2360,7 @@ class BlockDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.BlockDesc) */ { -public: + public: BlockDesc(); virtual ~BlockDesc(); @@ -2391,8 +2377,7 @@ public: inline BlockDesc &operator=(BlockDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -2437,17 +2422,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(BlockDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -2464,11 +2449,11 @@ public: ::paddle_mobile::framework::proto::VarDesc *mutable_vars(int index); ::paddle_mobile::framework::proto::VarDesc *add_vars(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> * - mutable_vars(); + ::paddle_mobile::framework::proto::VarDesc> + *mutable_vars(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> & - vars() const; + ::paddle_mobile::framework::proto::VarDesc> + &vars() const; // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; int ops_size() const; @@ -2478,11 +2463,11 @@ public: ::paddle_mobile::framework::proto::OpDesc *mutable_ops(int index); ::paddle_mobile::framework::proto::OpDesc *add_ops(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> * - mutable_ops(); + ::paddle_mobile::framework::proto::OpDesc> + *mutable_ops(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> & - ops() const; + ::paddle_mobile::framework::proto::OpDesc> + &ops() const; // required int32 idx = 1; bool has_idx() const; @@ -2506,7 +2491,7 @@ public: void set_forward_block_idx(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.BlockDesc) -private: + private: void set_has_idx(); void clear_has_idx(); void set_has_parent_idx(); @@ -2539,7 +2524,7 @@ class ProgramDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.ProgramDesc) */ { -public: + public: ProgramDesc(); virtual ~ProgramDesc(); @@ -2556,8 +2541,7 @@ public: inline ProgramDesc &operator=(ProgramDesc &&from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -2603,17 +2587,17 @@ public: void DiscardUnknownFields(); int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } -private: + private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(ProgramDesc *other); -private: + private: inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } inline void *MaybeArenaPtr() const { return NULL; } -public: + public: ::std::string GetTypeName() const PROTOBUF_FINAL; // nested types @@ -2630,14 +2614,14 @@ public: ::paddle_mobile::framework::proto::BlockDesc *mutable_blocks(int index); ::paddle_mobile::framework::proto::BlockDesc *add_blocks(); ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> * - mutable_blocks(); + ::paddle_mobile::framework::proto::BlockDesc> + *mutable_blocks(); const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> & - blocks() const; + ::paddle_mobile::framework::proto::BlockDesc> + &blocks() const; // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.ProgramDesc) -private: + private: ::google::protobuf::internal::InternalMetadataWithArenaLite _internal_metadata_; ::google::protobuf::internal::HasBits<1> _has_bits_; @@ -2655,8 +2639,8 @@ private: #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ - // OpDesc_Attr +#endif // __GNUC__ + // OpDesc_Attr // required string name = 1; inline bool OpDesc_Attr::has_name() const { @@ -2737,8 +2721,8 @@ inline ::paddle_mobile::framework::proto::AttrType OpDesc_Attr::type() const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.type) return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); } -inline void -OpDesc_Attr::set_type(::paddle_mobile::framework::proto::AttrType value) { +inline void OpDesc_Attr::set_type( + ::paddle_mobile::framework::proto::AttrType value) { assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); set_has_type(); type_ = value; @@ -2865,13 +2849,13 @@ inline void OpDesc_Attr::add_ints(::google::protobuf::int32 value) { ints_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints) } -inline const ::google::protobuf::RepeatedField<::google::protobuf::int32> & -OpDesc_Attr::ints() const { +inline const ::google::protobuf::RepeatedField<::google::protobuf::int32> + &OpDesc_Attr::ints() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) return ints_; } -inline ::google::protobuf::RepeatedField<::google::protobuf::int32> * -OpDesc_Attr::mutable_ints() { +inline ::google::protobuf::RepeatedField<::google::protobuf::int32> + *OpDesc_Attr::mutable_ints() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) return &ints_; } @@ -2891,8 +2875,8 @@ inline void OpDesc_Attr::add_floats(float value) { floats_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.floats) } -inline const ::google::protobuf::RepeatedField & -OpDesc_Attr::floats() const { +inline const ::google::protobuf::RepeatedField &OpDesc_Attr::floats() + const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) return floats_; } @@ -2955,13 +2939,13 @@ inline void OpDesc_Attr::add_strings(const char *value, size_t size) { strings_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) } -inline const ::google::protobuf::RepeatedPtrField<::std::string> & -OpDesc_Attr::strings() const { +inline const ::google::protobuf::RepeatedPtrField<::std::string> + &OpDesc_Attr::strings() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) return strings_; } -inline ::google::protobuf::RepeatedPtrField<::std::string> * -OpDesc_Attr::mutable_strings() { +inline ::google::protobuf::RepeatedPtrField<::std::string> + *OpDesc_Attr::mutable_strings() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) return &strings_; } @@ -3001,8 +2985,8 @@ inline void OpDesc_Attr::add_bools(bool value) { bools_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.bools) } -inline const ::google::protobuf::RepeatedField & -OpDesc_Attr::bools() const { +inline const ::google::protobuf::RepeatedField &OpDesc_Attr::bools() + const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) return bools_; } @@ -3180,13 +3164,13 @@ inline void OpDesc_Var::add_arguments(const char *value, size_t size) { arguments_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) } -inline const ::google::protobuf::RepeatedPtrField<::std::string> & -OpDesc_Var::arguments() const { +inline const ::google::protobuf::RepeatedPtrField<::std::string> + &OpDesc_Var::arguments() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) return arguments_; } -inline ::google::protobuf::RepeatedPtrField<::std::string> * -OpDesc_Var::mutable_arguments() { +inline ::google::protobuf::RepeatedPtrField<::std::string> + *OpDesc_Var::mutable_arguments() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) return &arguments_; } @@ -3263,13 +3247,13 @@ inline void OpDesc::set_allocated_type(::std::string *type) { // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = 1; inline int OpDesc::inputs_size() const { return inputs_.size(); } inline void OpDesc::clear_inputs() { inputs_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpDesc_Var & -OpDesc::inputs(int index) const { +inline const ::paddle_mobile::framework::proto::OpDesc_Var &OpDesc::inputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs) return inputs_.Get(index); } -inline ::paddle_mobile::framework::proto::OpDesc_Var * -OpDesc::mutable_inputs(int index) { +inline ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::mutable_inputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs) return inputs_.Mutable(index); } @@ -3278,14 +3262,14 @@ inline ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::add_inputs() { return inputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * -OpDesc::mutable_inputs() { + ::paddle_mobile::framework::proto::OpDesc_Var> + *OpDesc::mutable_inputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs) return &inputs_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & -OpDesc::inputs() const { + ::paddle_mobile::framework::proto::OpDesc_Var> + &OpDesc::inputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs) return inputs_; } @@ -3293,13 +3277,13 @@ OpDesc::inputs() const { // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = 2; inline int OpDesc::outputs_size() const { return outputs_.size(); } inline void OpDesc::clear_outputs() { outputs_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpDesc_Var & -OpDesc::outputs(int index) const { +inline const ::paddle_mobile::framework::proto::OpDesc_Var &OpDesc::outputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs) return outputs_.Get(index); } -inline ::paddle_mobile::framework::proto::OpDesc_Var * -OpDesc::mutable_outputs(int index) { +inline ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::mutable_outputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs) return outputs_.Mutable(index); } @@ -3308,14 +3292,14 @@ inline ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::add_outputs() { return outputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * -OpDesc::mutable_outputs() { + ::paddle_mobile::framework::proto::OpDesc_Var> + *OpDesc::mutable_outputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs) return &outputs_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & -OpDesc::outputs() const { + ::paddle_mobile::framework::proto::OpDesc_Var> + &OpDesc::outputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs) return outputs_; } @@ -3323,13 +3307,13 @@ OpDesc::outputs() const { // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = 4; inline int OpDesc::attrs_size() const { return attrs_.size(); } inline void OpDesc::clear_attrs() { attrs_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpDesc_Attr & -OpDesc::attrs(int index) const { +inline const ::paddle_mobile::framework::proto::OpDesc_Attr &OpDesc::attrs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs) return attrs_.Get(index); } -inline ::paddle_mobile::framework::proto::OpDesc_Attr * -OpDesc::mutable_attrs(int index) { +inline ::paddle_mobile::framework::proto::OpDesc_Attr *OpDesc::mutable_attrs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs) return attrs_.Mutable(index); } @@ -3338,14 +3322,14 @@ inline ::paddle_mobile::framework::proto::OpDesc_Attr *OpDesc::add_attrs() { return attrs_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> * -OpDesc::mutable_attrs() { + ::paddle_mobile::framework::proto::OpDesc_Attr> + *OpDesc::mutable_attrs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs) return &attrs_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> & -OpDesc::attrs() const { + ::paddle_mobile::framework::proto::OpDesc_Attr> + &OpDesc::attrs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs) return attrs_; } @@ -3658,8 +3642,8 @@ inline ::paddle_mobile::framework::proto::AttrType OpProto_Attr::type() const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.type) return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); } -inline void -OpProto_Attr::set_type(::paddle_mobile::framework::proto::AttrType value) { +inline void OpProto_Attr::set_type( + ::paddle_mobile::framework::proto::AttrType value) { assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); set_has_type(); type_ = value; @@ -3828,13 +3812,13 @@ inline void OpProto::set_allocated_type(::std::string *type) { // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = 2; inline int OpProto::inputs_size() const { return inputs_.size(); } inline void OpProto::clear_inputs() { inputs_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpProto_Var & -OpProto::inputs(int index) const { +inline const ::paddle_mobile::framework::proto::OpProto_Var &OpProto::inputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs) return inputs_.Get(index); } -inline ::paddle_mobile::framework::proto::OpProto_Var * -OpProto::mutable_inputs(int index) { +inline ::paddle_mobile::framework::proto::OpProto_Var *OpProto::mutable_inputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs) return inputs_.Mutable(index); } @@ -3843,14 +3827,14 @@ inline ::paddle_mobile::framework::proto::OpProto_Var *OpProto::add_inputs() { return inputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * -OpProto::mutable_inputs() { + ::paddle_mobile::framework::proto::OpProto_Var> + *OpProto::mutable_inputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs) return &inputs_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & -OpProto::inputs() const { + ::paddle_mobile::framework::proto::OpProto_Var> + &OpProto::inputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs) return inputs_; } @@ -3858,13 +3842,13 @@ OpProto::inputs() const { // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = 3; inline int OpProto::outputs_size() const { return outputs_.size(); } inline void OpProto::clear_outputs() { outputs_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpProto_Var & -OpProto::outputs(int index) const { +inline const ::paddle_mobile::framework::proto::OpProto_Var &OpProto::outputs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs) return outputs_.Get(index); } -inline ::paddle_mobile::framework::proto::OpProto_Var * -OpProto::mutable_outputs(int index) { +inline ::paddle_mobile::framework::proto::OpProto_Var *OpProto::mutable_outputs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs) return outputs_.Mutable(index); } @@ -3873,14 +3857,14 @@ inline ::paddle_mobile::framework::proto::OpProto_Var *OpProto::add_outputs() { return outputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * -OpProto::mutable_outputs() { + ::paddle_mobile::framework::proto::OpProto_Var> + *OpProto::mutable_outputs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs) return &outputs_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & -OpProto::outputs() const { + ::paddle_mobile::framework::proto::OpProto_Var> + &OpProto::outputs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs) return outputs_; } @@ -3888,13 +3872,13 @@ OpProto::outputs() const { // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = 4; inline int OpProto::attrs_size() const { return attrs_.size(); } inline void OpProto::clear_attrs() { attrs_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpProto_Attr & -OpProto::attrs(int index) const { +inline const ::paddle_mobile::framework::proto::OpProto_Attr &OpProto::attrs( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs) return attrs_.Get(index); } -inline ::paddle_mobile::framework::proto::OpProto_Attr * -OpProto::mutable_attrs(int index) { +inline ::paddle_mobile::framework::proto::OpProto_Attr *OpProto::mutable_attrs( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs) return attrs_.Mutable(index); } @@ -3903,14 +3887,14 @@ inline ::paddle_mobile::framework::proto::OpProto_Attr *OpProto::add_attrs() { return attrs_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> * -OpProto::mutable_attrs() { + ::paddle_mobile::framework::proto::OpProto_Attr> + *OpProto::mutable_attrs() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs) return &attrs_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> & -OpProto::attrs() const { + ::paddle_mobile::framework::proto::OpProto_Attr> + &OpProto::attrs() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs) return attrs_; } @@ -4032,13 +4016,13 @@ inline void VarType_TensorDesc::add_dims(::google::protobuf::int64 value) { dims_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims) } -inline const ::google::protobuf::RepeatedField<::google::protobuf::int64> & -VarType_TensorDesc::dims() const { +inline const ::google::protobuf::RepeatedField<::google::protobuf::int64> + &VarType_TensorDesc::dims() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) return dims_; } -inline ::google::protobuf::RepeatedField<::google::protobuf::int64> * -VarType_TensorDesc::mutable_dims() { +inline ::google::protobuf::RepeatedField<::google::protobuf::int64> + *VarType_TensorDesc::mutable_dims() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) return &dims_; } @@ -4121,8 +4105,8 @@ inline ::google::protobuf::int32 VarType_LoDTensorDesc::lod_level() const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) return lod_level_; } -inline void -VarType_LoDTensorDesc::set_lod_level(::google::protobuf::int32 value) { +inline void VarType_LoDTensorDesc::set_lod_level( + ::google::protobuf::int32 value) { set_has_lod_level(); lod_level_ = value; // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) @@ -4206,8 +4190,8 @@ inline ::google::protobuf::int32 VarType_LoDTensorArrayDesc::lod_level() const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) return lod_level_; } -inline void -VarType_LoDTensorArrayDesc::set_lod_level(::google::protobuf::int32 value) { +inline void VarType_LoDTensorArrayDesc::set_lod_level( + ::google::protobuf::int32 value) { set_has_lod_level(); lod_level_ = value; // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) @@ -4239,14 +4223,14 @@ VarType_ReaderDesc::add_lod_tensor() { return lod_tensor_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * -VarType_ReaderDesc::mutable_lod_tensor() { + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + *VarType_ReaderDesc::mutable_lod_tensor() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) return &lod_tensor_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & -VarType_ReaderDesc::lod_tensor() const { + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + &VarType_ReaderDesc::lod_tensor() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) return lod_tensor_; } @@ -4336,13 +4320,13 @@ inline void VarType_Tuple::add_element_type( element_type_.Add(value); // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type) } -inline const ::google::protobuf::RepeatedField & -VarType_Tuple::element_type() const { +inline const ::google::protobuf::RepeatedField + &VarType_Tuple::element_type() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) return element_type_; } -inline ::google::protobuf::RepeatedField * -VarType_Tuple::mutable_element_type() { +inline ::google::protobuf::RepeatedField + *VarType_Tuple::mutable_element_type() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) return &element_type_; } @@ -4365,8 +4349,8 @@ inline ::paddle_mobile::framework::proto::VarType_Type VarType::type() const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.type) return static_cast<::paddle_mobile::framework::proto::VarType_Type>(type_); } -inline void -VarType::set_type(::paddle_mobile::framework::proto::VarType_Type value) { +inline void VarType::set_type( + ::paddle_mobile::framework::proto::VarType_Type value) { assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); set_has_type(); type_ = value; @@ -4654,8 +4638,8 @@ inline void VarType::clear_tuple() { tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); clear_has_tuple(); } -inline const ::paddle_mobile::framework::proto::VarType_Tuple & -VarType::tuple() const { +inline const ::paddle_mobile::framework::proto::VarType_Tuple &VarType::tuple() + const { const ::paddle_mobile::framework::proto::VarType_Tuple *p = tuple_; // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tuple) return p != NULL @@ -4770,8 +4754,7 @@ inline bool VarDesc::has_type() const { inline void VarDesc::set_has_type() { _has_bits_[0] |= 0x00000002u; } inline void VarDesc::clear_has_type() { _has_bits_[0] &= ~0x00000002u; } inline void VarDesc::clear_type() { - if (type_ != NULL) - type_->::paddle_mobile::framework::proto::VarType::Clear(); + if (type_ != NULL) type_->::paddle_mobile::framework::proto::VarType::Clear(); clear_has_type(); } inline const ::paddle_mobile::framework::proto::VarType &VarDesc::type() const { @@ -4798,8 +4781,8 @@ inline ::paddle_mobile::framework::proto::VarType *VarDesc::release_type() { type_ = NULL; return temp; } -inline void -VarDesc::set_allocated_type(::paddle_mobile::framework::proto::VarType *type) { +inline void VarDesc::set_allocated_type( + ::paddle_mobile::framework::proto::VarType *type) { delete type_; type_ = type; if (type) { @@ -4877,13 +4860,13 @@ inline void BlockDesc::set_parent_idx(::google::protobuf::int32 value) { // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; inline int BlockDesc::vars_size() const { return vars_.size(); } inline void BlockDesc::clear_vars() { vars_.Clear(); } -inline const ::paddle_mobile::framework::proto::VarDesc & -BlockDesc::vars(int index) const { +inline const ::paddle_mobile::framework::proto::VarDesc &BlockDesc::vars( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars) return vars_.Get(index); } -inline ::paddle_mobile::framework::proto::VarDesc * -BlockDesc::mutable_vars(int index) { +inline ::paddle_mobile::framework::proto::VarDesc *BlockDesc::mutable_vars( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.vars) return vars_.Mutable(index); } @@ -4892,14 +4875,14 @@ inline ::paddle_mobile::framework::proto::VarDesc *BlockDesc::add_vars() { return vars_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> * -BlockDesc::mutable_vars() { + ::paddle_mobile::framework::proto::VarDesc> + *BlockDesc::mutable_vars() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.vars) return &vars_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> & -BlockDesc::vars() const { + ::paddle_mobile::framework::proto::VarDesc> + &BlockDesc::vars() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars) return vars_; } @@ -4907,13 +4890,13 @@ BlockDesc::vars() const { // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; inline int BlockDesc::ops_size() const { return ops_.size(); } inline void BlockDesc::clear_ops() { ops_.Clear(); } -inline const ::paddle_mobile::framework::proto::OpDesc & -BlockDesc::ops(int index) const { +inline const ::paddle_mobile::framework::proto::OpDesc &BlockDesc::ops( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops) return ops_.Get(index); } -inline ::paddle_mobile::framework::proto::OpDesc * -BlockDesc::mutable_ops(int index) { +inline ::paddle_mobile::framework::proto::OpDesc *BlockDesc::mutable_ops( + int index) { // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.ops) return ops_.Mutable(index); } @@ -4922,14 +4905,14 @@ inline ::paddle_mobile::framework::proto::OpDesc *BlockDesc::add_ops() { return ops_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> * -BlockDesc::mutable_ops() { + ::paddle_mobile::framework::proto::OpDesc> + *BlockDesc::mutable_ops() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.ops) return &ops_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> & -BlockDesc::ops() const { + ::paddle_mobile::framework::proto::OpDesc> + &BlockDesc::ops() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops) return ops_; } @@ -4965,8 +4948,8 @@ inline void BlockDesc::set_forward_block_idx(::google::protobuf::int32 value) { // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; inline int ProgramDesc::blocks_size() const { return blocks_.size(); } inline void ProgramDesc::clear_blocks() { blocks_.Clear(); } -inline const ::paddle_mobile::framework::proto::BlockDesc & -ProgramDesc::blocks(int index) const { +inline const ::paddle_mobile::framework::proto::BlockDesc &ProgramDesc::blocks( + int index) const { // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks) return blocks_.Get(index); } @@ -4980,23 +4963,23 @@ inline ::paddle_mobile::framework::proto::BlockDesc *ProgramDesc::add_blocks() { return blocks_.Add(); } inline ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> * -ProgramDesc::mutable_blocks() { + ::paddle_mobile::framework::proto::BlockDesc> + *ProgramDesc::mutable_blocks() { // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks) return &blocks_; } inline const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> & -ProgramDesc::blocks() const { + ::paddle_mobile::framework::proto::BlockDesc> + &ProgramDesc::blocks() const { // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks) return blocks_; } #ifdef __GNUC__ #pragma GCC diagnostic pop -#endif // __GNUC__ -#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS - // ------------------------------------------------------------------- +#endif // __GNUC__ +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + // ------------------------------------------------------------------- // ------------------------------------------------------------------- @@ -5028,9 +5011,9 @@ ProgramDesc::blocks() const { // @@protoc_insertion_point(namespace_scope) -} // namespace proto -} // namespace framework -} // namespace paddle_mobile +} // namespace proto +} // namespace framework +} // namespace paddle_mobile namespace google { namespace protobuf { @@ -5042,9 +5025,9 @@ template <> struct is_proto_enum<::paddle_mobile::framework::proto::AttrType> : ::google::protobuf::internal::true_type {}; -} // namespace protobuf -} // namespace google +} // namespace protobuf +} // namespace google // @@protoc_insertion_point(global_scope) -#endif // PROTOBUF_framework_2eproto__INCLUDED +#endif // PROTOBUF_framework_2eproto__INCLUDED diff --git a/src/framework/lod_tensor.cc b/src/framework/lod_tensor.cc index a76dc99a546caae5cfc4bac491da7e186462889d..a1696206d3c6cba66b468729b76cea7f1dccae76 100644 --- a/src/framework/lod_tensor.cc +++ b/src/framework/lod_tensor.cc @@ -13,10 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "lod_tensor.h" -#include -#include #include #include +#include +#include namespace paddle_mobile { namespace framework { @@ -105,8 +105,7 @@ LoD SliceInLevel(const LoD &in, size_t level, size_t elem_begin, LoD ToAbsOffset(const LoD &in) { // the lowest level stores relative offsets - if (in.empty() || in.size() == 1) - return in; + if (in.empty() || in.size() == 1) return in; LoD result = in; for (auto level = static_cast(in.size() - 2); level >= 0; level--) { for (size_t i = 0; i < in[level].size(); ++i) { @@ -138,23 +137,19 @@ bool operator==(const LoD &a, const LoD &b) { } bool CheckLoD(const LoD &in, int tensor_height) { - if (in.empty()) - return true; + if (in.empty()) return true; for (const auto &level : in) { // check: there should be more than 2 offsets existing in each // level. - if (level.size() < 2) - return false; + if (level.size() < 2) return false; // check: the first offset(the begin offset) of each level // should be 0. - if (level.front() != 0) - return false; + if (level.front() != 0) return false; // check: all the offsets in a level should be ascending(no same // items // allows). if (!std::is_sorted(level.begin(), level.begin(), [](size_t a, size_t b) { - if (a < b) - return true; + if (a < b) return true; return false; })) { std::cout << "ascending error"; @@ -174,22 +169,19 @@ bool CheckLoD(const LoD &in, int tensor_height) { // goes // first. for (size_t level = 0; level < in.size() - 1; level++) { - if (in[level].back() != in[level + 1].size() - 1) - return false; + if (in[level].back() != in[level + 1].size() - 1) return false; } return true; } bool CheckAbsLoD(const LoD &in, int tensor_height) { - if (in.empty()) - return true; + if (in.empty()) return true; for (const auto &level : in) { // check: all the offsets in a level should be ascending(no same // items // allows). if (!std::is_sorted(level.begin(), level.begin(), [](size_t a, size_t b) { - if (a < b) - return true; + if (a < b) return true; return false; })) { return false; @@ -197,14 +189,12 @@ bool CheckAbsLoD(const LoD &in, int tensor_height) { // check: there should be more than 2 offsets existing in each // level. - if (level.size() < 2) - return false; + if (level.size() < 2) return false; // check: the first offset of each level should be 0, and the // last should be // the same(the height of underlying tensor). - if (level.front() != 0) - return false; + if (level.front() != 0) return false; if (tensor_height < 0) { tensor_height = level.back(); } else if ((size_t)tensor_height != level.back()) { @@ -242,7 +232,7 @@ void AppendLoD(LoD *lod, const LoD &lod_length) { // lod."); if (lod->empty()) { for (size_t i = 0; i < lod_length.size(); ++i) { - lod->emplace_back(1, 0); // size = 1, value = 0; + lod->emplace_back(1, 0); // size = 1, value = 0; } *lod = LoD(lod_length.size(), std::vector({0})); } @@ -255,7 +245,7 @@ void AppendLoD(LoD *lod, const LoD &lod_length) { } void SerializeToStream(std::ostream &os, const LoDTensor &tensor) { - { // the 1st field, uint32_t version for LoDTensor + { // the 1st field, uint32_t version for LoDTensor constexpr uint32_t version = 0; os.write(reinterpret_cast(&version), sizeof(version)); } @@ -307,5 +297,5 @@ void DeserializeFromStream(std::istream &is, LoDTensor *tensor) { TensorFromStream(is, static_cast(tensor)); } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/lod_tensor.h b/src/framework/lod_tensor.h index be4e268ca266ecb552fe4a66888324296d152f49..2c7a09e2efed0bc8239327bacfe9bbef8e3734d5 100644 --- a/src/framework/lod_tensor.h +++ b/src/framework/lod_tensor.h @@ -14,12 +14,12 @@ limitations under the License. */ #pragma once -#include "tensor.h" -#include "tensor_util.h" #include #include #include #include +#include "tensor.h" +#include "tensor_util.h" namespace paddle_mobile { @@ -102,7 +102,7 @@ bool CheckAbsLoD(const LoD &in, int tensor_height = -1); * see https://en.wikipedia.org/wiki/Level_of_details for reference. */ class LoDTensor : public Tensor { -public: + public: LoDTensor() : Tensor() {} explicit LoDTensor(const LoD &lod) : lod_(lod) {} @@ -139,7 +139,7 @@ public: return (lod_)[level].size() - 1; } -private: + private: LoD lod_; }; @@ -189,9 +189,8 @@ LoDTensor LodExpand(const LoDTensor &source, const LoD &lod, size_t level) { // Returns: // LoD = [[1, 4], [2, 4, 2, 3, 2]] // pair = {11, 24} -std::pair> -GetSubLoDAndAbsoluteOffset(const LoD &lod, size_t start_idx, size_t end_idx, - size_t start_level); +std::pair> GetSubLoDAndAbsoluteOffset( + const LoD &lod, size_t start_idx, size_t end_idx, size_t start_level); void AppendLoD(LoD *lod, const LoD &lod_length); @@ -204,5 +203,5 @@ void SerializeToStream(std::ostream &os, const LoDTensor &tensor); void DeserializeFromStream(std::istream &is, LoDTensor *tensor); -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/op_desc.cpp b/src/framework/op_desc.cpp index f6a5cf68ff1608eac3a771a11175e5823f318869..d7b946424e6af07119d1579a150494c207b0989c 100644 --- a/src/framework/op_desc.cpp +++ b/src/framework/op_desc.cpp @@ -55,5 +55,5 @@ const std::unordered_map &OpDesc::GetAttrMap() const { return attrs_; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/op_desc.h b/src/framework/op_desc.h index 61fe4c99899ba9d3f1c29e660a992fa443ab2163..e2465989bb0c65398de80128085b7eb546318eb3 100644 --- a/src/framework/op_desc.h +++ b/src/framework/op_desc.h @@ -26,7 +26,7 @@ namespace paddle_mobile { namespace framework { class OpDesc : PaddleMobileObject { -public: + public: OpDesc(const proto::OpDesc &desc); const std::vector &Input(const std::string &name) const; const std::vector &Output(const std::string &name) const; @@ -40,12 +40,12 @@ public: const std::string &Type() { return desc_.type(); }; -private: + private: proto::OpDesc desc_; VariableNameMap inputs_; VariableNameMap outputs_; AttributeMap attrs_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/op_info.h b/src/framework/op_info.h index 69c99a8ed2097a143f6a56c7d5ad6f94d9ade40c..fe55594d20d8e8a4b6c13d67078ed1a862170664 100644 --- a/src/framework/op_info.h +++ b/src/framework/op_info.h @@ -24,7 +24,8 @@ SOFTWARE. namespace paddle_mobile { namespace framework { -template struct OpInfo { +template +struct OpInfo { OpCreator creator_; const OpCreator &Creator() const { // PADDLE_ENFORCE_NOT_NULL(creator_, @@ -34,12 +35,15 @@ template struct OpInfo { } }; -template class OpInfoMap; +template +class OpInfoMap; -template static OpInfoMap *g_op_info_map = nullptr; +template +static OpInfoMap *g_op_info_map = nullptr; -template class OpInfoMap { -public: +template +class OpInfoMap { + public: static OpInfoMap &Instance() { if (g_op_info_map == nullptr) { g_op_info_map = new OpInfoMap(); @@ -83,12 +87,12 @@ public: return &map_; } -private: + private: OpInfoMap() = default; std::unordered_map> map_; // DISABLE_COPY_AND_ASSIGN(OpInfoMap); }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/op_kernel_type.h b/src/framework/op_kernel_type.h index 67aa0d7ad9eab550568e5a92f557b3551afe0721..fef8db0327d0bb5594d967446c7b4ebc46ade6fc 100644 --- a/src/framework/op_kernel_type.h +++ b/src/framework/op_kernel_type.h @@ -60,5 +60,5 @@ inline bool TransFromNeeded(const OpKernelType &l, const OpKernelType &r) { NeedTransformLayout(l.data_layout_, r.data_layout_); } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/op_proto_maker.h b/src/framework/op_proto_maker.h index c4e8fed0cd9b0d86856d817cb0c699f51bec74ee..3ec9bf16116cf64d156385832e7fbb003dde21a2 100644 --- a/src/framework/op_proto_maker.h +++ b/src/framework/op_proto_maker.h @@ -22,5 +22,5 @@ namespace paddle_mobile { namespace framework { // this class not only make proto but also init attribute checkers. class OpProtoAndCheckerMaker {}; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/operator.cpp b/src/framework/operator.cpp index 17a2b48150238391396913c3ad9bb9c1c782b6c0..a91b2a0a7cf4d508e66c074b877c7b6d2d389d01 100644 --- a/src/framework/operator.cpp +++ b/src/framework/operator.cpp @@ -28,7 +28,10 @@ OperatorBase::OperatorBase(const std::string &type, const VariableNameMap &outputs, const AttributeMap &attrs, std::shared_ptr scope) - : type_(type), inputs_(inputs), outputs_(outputs), attrs_(attrs), + : type_(type), + inputs_(inputs), + outputs_(outputs), + attrs_(attrs), scope_(scope) { CheckAllInputOutputSet(); } @@ -38,5 +41,5 @@ void OperatorBase::CheckAllInputOutputSet() const {} template class OperatorBase; template class OperatorWithKernel; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/operator.h b/src/framework/operator.h index b3306d284888c73d4bf0ca53b5355abebeb5b2c5..6250abf9138c7d71f0a29f7530097a531a4e6072 100644 --- a/src/framework/operator.h +++ b/src/framework/operator.h @@ -48,8 +48,9 @@ static std::unordered_map< {"feed", {{"X"}, {"Out"}}}, {"fetch", {{"X"}, {"Out"}}}}; -template class OperatorBase : PaddleMobileObject { -public: +template +class OperatorBase : PaddleMobileObject { + public: OperatorBase(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const AttributeMap &attrs, std::shared_ptr scope); @@ -66,20 +67,20 @@ public: } } -protected: + protected: std::shared_ptr scope_; std::string type_; VariableNameMap inputs_; VariableNameMap outputs_; AttributeMap attrs_; -private: + private: void CheckAllInputOutputSet() const; }; template class OperatorWithKernel : public OperatorBase { -public: + public: OperatorWithKernel(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const AttributeMap &attrs, std::shared_ptr scope) @@ -88,12 +89,13 @@ public: virtual void Run() const = 0; }; -template class OpKernelBase : PaddleMobileObject { -public: +template +class OpKernelBase : PaddleMobileObject { + public: virtual void Compute(const P ¶) const = 0; virtual ~OpKernelBase() = default; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/paddle_mobile_object.h b/src/framework/paddle_mobile_object.h index 2dbd31abc9dcc61201dc57f36e1efb0f859e19d2..062bac75b26354cd5872cf6c2bf600a6847d3d46 100644 --- a/src/framework/paddle_mobile_object.h +++ b/src/framework/paddle_mobile_object.h @@ -18,19 +18,19 @@ SOFTWARE. #pragma once -#include "stdio.h" #include +#include "stdio.h" namespace paddle_mobile { class PaddleMobileObject { -public: + public: virtual std::string ToString() { char address[128] = {0}; sprintf(address, "%p", this); return std::string(address); } -private: + private: }; -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/framework/program-optimize/node.cpp b/src/framework/program-optimize/node.cpp index 63faaac255857bd2b5b022ecb9e6b2f41df1fdfe..a6cc775e4ceb7161614a571fcd392b0090924791 100644 --- a/src/framework/program-optimize/node.cpp +++ b/src/framework/program-optimize/node.cpp @@ -92,5 +92,5 @@ Print &operator<<(Print &printer, const Node &node) { return printer; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/program-optimize/node.h b/src/framework/program-optimize/node.h index e241e81efdd1d7098d170557cc5ec5693908386e..0a6cb0a524cc25eb48bc2c0511cdb25c4ca7cbd5 100644 --- a/src/framework/program-optimize/node.h +++ b/src/framework/program-optimize/node.h @@ -29,7 +29,7 @@ namespace paddle_mobile { namespace framework { class Node : PaddleMobileObject { -public: + public: Node(const std::string &type) : type_(type) {} Node(std::shared_ptr op_desc) : op_desc_(op_desc), type_(op_desc->Type()){}; @@ -39,7 +39,7 @@ public: Node &To(int index); uint depth(uint begin = 0); -private: + private: std::shared_ptr op_desc_; std::string ToString(std::string blank, const Node *node) const; std::vector> outputs_; @@ -48,5 +48,5 @@ private: }; Print &operator<<(Print &printer, const Node &node); -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/program-optimize/program_optimize.cpp b/src/framework/program-optimize/program_optimize.cpp index e8fe3a690a7c68af579905f9117a1a85d3621bda..ea923790a9fecec31952b5b19eb86310c226df6f 100644 --- a/src/framework/program-optimize/program_optimize.cpp +++ b/src/framework/program-optimize/program_optimize.cpp @@ -24,8 +24,8 @@ namespace framework { std::shared_ptr ProgramOptimize::Optimize() {} -std::shared_ptr -ProgramOptimize::FushionOptimize(std::shared_ptr ori_des) { +std::shared_ptr ProgramOptimize::FushionOptimize( + std::shared_ptr ori_des) { for (int i = 0; i < ori_des->Blocks().size(); ++i) { std::unordered_map> output_nodes; std::shared_ptr begin_node; @@ -69,5 +69,5 @@ ProgramOptimize::FushionOptimize(std::shared_ptr ori_des) { } return ori_des; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/program-optimize/program_optimize.h b/src/framework/program-optimize/program_optimize.h index be4e933cda056e81286be861f297357abe61d542..bb32493bf2cf238d0ed81d2c71dccd93fce58666 100644 --- a/src/framework/program-optimize/program_optimize.h +++ b/src/framework/program-optimize/program_optimize.h @@ -26,16 +26,16 @@ namespace paddle_mobile { namespace framework { class ProgramOptimize { -public: + public: ProgramOptimize() {} std::shared_ptr Optimize(); - std::shared_ptr - FushionOptimize(std::shared_ptr ori_des); + std::shared_ptr FushionOptimize( + std::shared_ptr ori_des); -private: + private: // std::shared_ptr ori_desc_; std::vector>> outputs_nodes_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/program.cpp b/src/framework/program.cpp index 5050ca3aba021e8758a4d13f45c2054302e2b611..a3b9cf6a4ffeb8e684d6b0eeafa93ff34142cef0 100644 --- a/src/framework/program.cpp +++ b/src/framework/program.cpp @@ -18,4 +18,4 @@ SOFTWARE. namespace paddle_mobile { namespace framework {} -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/framework/program.h b/src/framework/program.h index 8844757e2140e045fef8f6a889b501be659a3280..07f175bf37ddbe20de6532424a7e47b59ff0c69e 100644 --- a/src/framework/program.h +++ b/src/framework/program.h @@ -28,13 +28,13 @@ namespace framework { template class Program : PaddleMobileObject { -public: + public: std::shared_ptr originProgram; std::shared_ptr optimizeProgram; std::shared_ptr scope; -private: + private: }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/program_desc.cpp b/src/framework/program_desc.cpp index a6a9d30a69c515ef7754b7422bfbe916257a8d8d..4f6a4699bde5e19ee61e502ef15efd9296a08973 100644 --- a/src/framework/program_desc.cpp +++ b/src/framework/program_desc.cpp @@ -18,5 +18,5 @@ std::shared_ptr ProgramDesc::Block(size_t idx) { return blocks_[idx]; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/program_desc.h b/src/framework/program_desc.h index a86d403c707c25ff1dbb9d3b048ce338338084de..79adc70a6f7520942246af6f863be972ca4f1039 100644 --- a/src/framework/program_desc.h +++ b/src/framework/program_desc.h @@ -28,15 +28,15 @@ namespace paddle_mobile { namespace framework { class ProgramDesc : PaddleMobileObject { -public: + public: ProgramDesc(const proto::ProgramDesc &desc); std::shared_ptr Block(size_t idx); const std::vector> &Blocks() { return blocks_; }; -private: + private: std::vector> blocks_; proto::ProgramDesc desc_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/scope.cc b/src/framework/scope.cc index 490c37a088c6d33ab8450199686b2607fee28311..b7f3926a8f6ddce4ce6ec24666881d58b6f25e25 100644 --- a/src/framework/scope.cc +++ b/src/framework/scope.cc @@ -115,5 +115,5 @@ Variable *Scope::FindVarLocally(const std::string &name) const { return nullptr; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/scope.h b/src/framework/scope.h index 8b0e074ade7e13ce76fc57b741c4a1cca914e3b4..13e569e52bc89ad287fb76b471fc770f8bf1924c 100644 --- a/src/framework/scope.h +++ b/src/framework/scope.h @@ -18,15 +18,15 @@ SOFTWARE. ==============================================================================*/ #pragma once +#include //std::list +#include //std::mutex +#include //std::unordered_map #include "variable.h" -#include //std::list -#include //std::mutex -#include //std::unordered_map namespace paddle_mobile { namespace framework { class Scope { -public: + public: Scope() {} ~Scope() {} @@ -67,7 +67,7 @@ public: Variable *FindVarLocally(const std::string &name) const; -private: + private: // Call Scope::NewScope for a sub-scope. explicit Scope(Scope const *parent) : parent_(parent) {} @@ -77,5 +77,5 @@ private: mutable std::mutex mutex_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/selected_rows.h b/src/framework/selected_rows.h index b4e2dcb972c192dda1b07bf8dd245d50c7f7d2b6..3488450e234ad073b6e9eff25502a329b3c79d70 100644 --- a/src/framework/selected_rows.h +++ b/src/framework/selected_rows.h @@ -27,7 +27,7 @@ namespace paddle_mobile { namespace framework { class SelectedRows { -public: + public: SelectedRows(const std::vector &rows, const int64_t &height) : rows_(rows), height_(height) { value_.reset(new Tensor()); @@ -67,7 +67,7 @@ public: return make_ddim(dims); } -private: + private: // Notice: rows can be duplicate. We can have {0, 4, 7, 0, 5, 7, 9} // here. // SelectedRows are simply concated when adding together. Until a @@ -77,5 +77,5 @@ private: int64_t height_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/tensor.h b/src/framework/tensor.h index 8f0374c3bbcdd48ed5fe70daa5f65cc1680d01a5..c77d95d849d3d17e5cb6976a26907f657af3a0ab 100644 --- a/src/framework/tensor.h +++ b/src/framework/tensor.h @@ -26,9 +26,11 @@ limitations under the License. */ namespace paddle_mobile { namespace framework { -template struct SizeOfTypeFunctor; +template +struct SizeOfTypeFunctor; -template struct SizeOfTypeFunctor { +template +struct SizeOfTypeFunctor { size_t operator()(std::type_index type) const { if (typeid(T).hash_code() == type.hash_code()) { return sizeof(T); @@ -38,7 +40,8 @@ template struct SizeOfTypeFunctor { } }; -template <> struct SizeOfTypeFunctor<> { +template <> +struct SizeOfTypeFunctor<> { size_t operator()(std::type_index type) const { return 0UL; } }; @@ -66,11 +69,12 @@ static inline size_t SizeOfType(std::type_index type) { class LoDTensor; class Tensor { -public: + public: Tensor() : offset_(0) {} /*! Return a pointer to mutable memory block. */ - template inline T *data() { + template + inline T *data() { check_memory_size(); // PADDLE_ENFORCE(std::is_same::value || // holder_->type().hash_code() == @@ -82,7 +86,8 @@ public: } /*! Return a pointer to constant memory block. */ - template inline const T *data() const { + template + inline const T *data() const { check_memory_size(); // PADDLE_ENFORCE(std::is_same::value || // holder_->type().hash_code() == @@ -100,7 +105,8 @@ public: * @brief Return a pointer to mutable memory block. * @note If not exist, then allocation. */ - template inline T *mutable_data() { + template + inline T *mutable_data() { static_assert(std::is_pod::value, "T must be POD"); return reinterpret_cast(mutable_data(typeid(T))); } @@ -141,7 +147,8 @@ public: * * @note If not exist, then allocation. */ - template inline T *mutable_data(DDim dims) { + template + inline T *mutable_data(DDim dims) { static_assert(std::is_pod::value, "T must be POD"); Resize(dims); return mutable_data(); @@ -235,7 +242,7 @@ public: inline void set_layout(const DataLayout layout) { layout_ = layout; } -private: + private: /** * @note Placeholder hides type T, so it doesn't appear as a * template @@ -257,7 +264,8 @@ private: PlaceholderImpl(size_t size, std::type_index type) : ptr_(static_cast(memory::Alloc(size)), memory::PODDeleter()), - size_(size), type_(type) { + size_(size), + type_(type) { // PADDLE_ENFORCE_NOT_NULL(ptr_, // "Insufficient %s // memory to allocation.", @@ -329,5 +337,5 @@ inline Tensor ReshapeToMatrix(const Tensor &src, int num_col_dims) { return res; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/tensor_util.cc b/src/framework/tensor_util.cc index 5ad00a0b9503a3306239d019f9063099f0d049ac..7047ef4e406bf7cb8f29f65ef3b73f5e30605fdc 100644 --- a/src/framework/tensor_util.cc +++ b/src/framework/tensor_util.cc @@ -51,7 +51,8 @@ void TensorCopySync(const Tensor &src, Tensor *dst) { memory::Copy(dst_ptr, src_ptr, size); } -template struct AnyDTypeVisitor { +template +struct AnyDTypeVisitor { Predicate predicate_; const Tensor &tensor_; Tensor *out_; @@ -59,7 +60,8 @@ template struct AnyDTypeVisitor { AnyDTypeVisitor(Predicate predicate, const Tensor &tensor, Tensor *out) : predicate_(predicate), tensor_(tensor), out_(out) {} - template void operator()() const { + template + void operator()() const { // auto t = EigenVector::Flatten(tensor_); // auto o = EigenScalar::From(*out_); // return any of predicate_(t) is true. @@ -74,7 +76,8 @@ inline void AnyImpl(Predicate predicate, const Tensor &tensor, AnyDTypeVisitor(predicate, tensor, out)); } -template struct AnyVisitor { +template +struct AnyVisitor { const framework::Tensor &tensor_; Predicate predicate_; @@ -130,11 +133,11 @@ bool TensorContainsInf(const framework::Tensor &tensor) { } void TensorToStream(std::ostream &os, const Tensor &tensor) { - { // the 1st field, uint32_t version + { // the 1st field, uint32_t version constexpr uint32_t version = 0; os.write(reinterpret_cast(&version), sizeof(version)); } - { // the 2nd field, tensor description + { // the 2nd field, tensor description // int32_t size // void* protobuf message proto::VarType::TensorDesc desc; @@ -148,7 +151,7 @@ void TensorToStream(std::ostream &os, const Tensor &tensor) { auto out = desc.SerializeAsString(); os.write(out.data(), size); } - { // the 3rd field, tensor data + { // the 3rd field, tensor data uint64_t size = tensor.memory_size(); auto *data_ptr = tensor.data(); // PADDLE_ENFORCE(size < @@ -164,7 +167,8 @@ struct DeserializedDataFunctor { DeserializedDataFunctor(void **buf, Tensor *tensor) : buf_(buf), tensor_(tensor) {} - template void operator()() { + template + void operator()() { *buf_ = tensor_->mutable_data(); } @@ -177,7 +181,7 @@ void TensorFromStream(std::istream &is, framework::Tensor *tensor) { is.read(reinterpret_cast(&version), sizeof(version)); // PADDLE_ENFORCE_EQ(version, 0U, "Only version 0 is supported"); proto::VarType::TensorDesc desc; - { // int32_t size + { // int32_t size // proto buffer int32_t size; is.read(reinterpret_cast(&size), sizeof(size)); @@ -186,7 +190,7 @@ void TensorFromStream(std::istream &is, framework::Tensor *tensor) { // PADDLE_ENFORCE(desc.ParseFromArray(buf.get(), size), // "Cannot parse tensor desc"); } - { // read tensor + { // read tensor std::vector dims; dims.reserve(static_cast(desc.dims().size())); std::copy(desc.dims().begin(), desc.dims().end(), std::back_inserter(dims)); @@ -199,5 +203,5 @@ void TensorFromStream(std::istream &is, framework::Tensor *tensor) { } } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/tensor_util.h b/src/framework/tensor_util.h index 2d91febf6129e94a29801ddd5df031329e604f68..7cecc67cdcfaf3030ff0b2a8f29be1ae9ddc218c 100644 --- a/src/framework/tensor_util.h +++ b/src/framework/tensor_util.h @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once +#include #include "framework.pb.h" #include "memory/t_malloc.h" #include "platform/data_type.h" #include "tensor.h" -#include namespace paddle_mobile { namespace framework { @@ -62,5 +62,5 @@ void TensorToVector(const Tensor &src, std::vector *dst) { memory::Copy(dst_ptr, src_ptr, size); } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/var_desc.cpp b/src/framework/var_desc.cpp index 4e2fa2be2b2baa009d16c03e699273a973d081b0..f0049e04897e00d36a9e0c2c0ec00e6249ca7b6d 100644 --- a/src/framework/var_desc.cpp +++ b/src/framework/var_desc.cpp @@ -24,5 +24,5 @@ namespace framework { VarDesc::VarDesc(const proto::VarDesc &desc) : desc_(desc) {} -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/var_desc.h b/src/framework/var_desc.h index 6852966a878c5be81de406b77b147f32d53de570..82d07a383e640efa77b9c06c7ba0136a64ec7e14 100644 --- a/src/framework/var_desc.h +++ b/src/framework/var_desc.h @@ -25,7 +25,7 @@ namespace paddle_mobile { namespace framework { class VarDesc { -public: + public: VarDesc(const proto::VarDesc &desc); std::string Name() const { return desc_.name(); } @@ -36,33 +36,33 @@ public: const proto::VarType::ChannelDesc &channel_desc() const { switch (desc_.type().type()) { - case proto::VarType::CHANNEL: - return desc_.type().channel(); - default: - break; + case proto::VarType::CHANNEL: + return desc_.type().channel(); + default: + break; } } const proto::VarType::TensorDesc &tensor_desc() const { switch (desc_.type().type()) { - case proto::VarType::SELECTED_ROWS: - return desc_.type().selected_rows(); - case proto::VarType::LOD_TENSOR: - return desc_.type().lod_tensor().tensor(); - case proto::VarType::LOD_TENSOR_ARRAY: - return desc_.type().tensor_array().tensor(); - default: - break; + case proto::VarType::SELECTED_ROWS: + return desc_.type().selected_rows(); + case proto::VarType::LOD_TENSOR: + return desc_.type().lod_tensor().tensor(); + case proto::VarType::LOD_TENSOR_ARRAY: + return desc_.type().tensor_array().tensor(); + default: + break; } } proto::VarType::Type GetDataType() const { switch (desc_.type().type()) { - case proto::VarType::CHANNEL: - return channel_desc().data_type(); - break; - default: - return tensor_desc().data_type(); + case proto::VarType::CHANNEL: + return channel_desc().data_type(); + break; + default: + return tensor_desc().data_type(); } } @@ -80,9 +80,9 @@ public: return this->RepeatedToVector(tensor_desc().dims()); } -private: + private: proto::VarDesc desc_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/var_type.h b/src/framework/var_type.h index 06db5ed1d66bcb4cd4f6237b7d51ca27259307b2..8ead7901d526f3a0a8ddcef6888178254a3ebb73 100644 --- a/src/framework/var_type.h +++ b/src/framework/var_type.h @@ -35,5 +35,5 @@ inline proto::VarType::Type ToVarType(std::type_index type) { } } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/framework/variable.h b/src/framework/variable.h index 5d1a17943e78abd2006517855e709fd3d3315d6b..3a9cf3843ff4745f374c18f8a5dcbb05ad329149 100644 --- a/src/framework/variable.h +++ b/src/framework/variable.h @@ -18,18 +18,19 @@ SOFTWARE. ==============================================================================*/ #pragma once -#include "paddle_mobile_object.h" #include #include #include #include #include +#include "paddle_mobile_object.h" namespace paddle_mobile { namespace framework { class Variable : public PaddleMobileObject { -public: - template const T *Get() const { + public: + template + const T *Get() const { return static_cast(holder_->Ptr()); } @@ -37,7 +38,8 @@ public: const std::string *Name() { return name_; } - template T *GetMutable() { + template + T *GetMutable() { if (!IsType()) { if (*Name() == "pixel") { // std::cout << " reset " << *Name() << @@ -48,7 +50,8 @@ public: return static_cast(holder_->Ptr()); } - template bool IsType() const { + template + bool IsType() const { if (holder_) { // printf("not null \n"); printf(" holder type : %s, this type %s \n", holder_->Type().name(), @@ -67,7 +70,7 @@ public: void SetName(const std::string *name) { name_ = name; } -private: + private: struct Placeholder { Placeholder() = default; virtual ~Placeholder() = default; @@ -76,7 +79,8 @@ private: virtual void *Ptr() const = 0; }; - template struct PlaceholderImp : public Placeholder { + template + struct PlaceholderImp : public Placeholder { explicit PlaceholderImp(T *ptr) : ptr_(ptr), type_(typeid(T)) {} virtual const std::type_info &Type() const { return type_; } @@ -92,5 +96,5 @@ private: friend class Scope; const std::string *name_; }; -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/io.cpp b/src/io.cpp index c6dc3a3416dce5f3802817195040ba13bb53aeba..c66e78d10dcbf317f9cf0943ec585b87cbeb5473 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -18,13 +18,13 @@ SOFTWARE. #include +#include "../src/io.h" #include "common/log.h" #include "framework/framework.pb.h" #include "framework/lod_tensor.h" #include "framework/program_desc.h" #include "framework/scope.h" #include "framework/tensor.h" -#include "io.h" namespace paddle_mobile { @@ -41,26 +41,20 @@ void ReadBinaryFile(const std::string &filename, std::string *contents) { template void Loader::LoadVar(framework::LoDTensor *tensor, const std::string &file_path) { - // LOG(kLOG_DEBUG) << " to load " << file_path; - // Log(kLOG_DEBUG) << "123"; - std::ifstream is(file_path); - std::streampos pos = is.tellg(); // save current position + std::fpos pos; + pos = is.tellg(); // save current position is.seekg(0, std::ios::end); - // LOG(kLOG_DEBUG) << " file length = " << is.tellg(); - is.seekg(pos); // restore saved position + is.seekg(pos); // restore saved position // 1. version uint32_t version; is.read(reinterpret_cast(&version), sizeof(version)); - // LOG(kLOG_INFO) << " version: " << version; // 2 Lod information uint64_t lod_level; is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); - // LOG(kLOG_DEBUG) << " load level: " << lod_level; - // LOG(kLOG_DEBUG) << " lod info: "; auto &lod = *tensor->mutable_lod(); lod.resize(lod_level); for (uint64_t i = 0; i < lod_level; ++i) { @@ -69,8 +63,8 @@ void Loader::LoadVar(framework::LoDTensor *tensor, std::vector tmp(size / sizeof(size_t)); is.read(reinterpret_cast(tmp.data()), static_cast(size)); - for (int j = 0; j < tmp.size(); ++j) { - LOG(kLOG_DEBUG1) << " lod - " << tmp[j]; + for (auto j : tmp) { + LOG(kLOG_DEBUG1) << " lod - " << j; } lod[i] = tmp; } @@ -78,26 +72,19 @@ void Loader::LoadVar(framework::LoDTensor *tensor, // 3. tensor version uint32_t tensor_version; is.read(reinterpret_cast(&tensor_version), sizeof(tensor_version)); - // std::cout << " tensor_version: " << tensor_version << std::endl; // 4. tensor desc int32_t size; is.read(reinterpret_cast(&size), sizeof(size)); - // std::cout << " tensor desc size: " << size << std::endl; std::unique_ptr buf(new char[size]); is.read(reinterpret_cast(buf.get()), size); framework::proto::VarType::TensorDesc desc; desc.ParseFromArray(buf.get(), size); - // std::cout << " desc dims size " << desc.dims().size() << - // std::endl; int memory_size = 1; - for (int l = 0; l < desc.dims().size(); ++l) { - // std::cout << " dim " << l << " value: " << desc.dims()[l] - // << - // std::endl; - memory_size *= desc.dims()[l]; + for (auto l : desc.dims()) { + memory_size *= l; } std::vector dims; @@ -105,50 +92,39 @@ void Loader::LoadVar(framework::LoDTensor *tensor, std::copy(desc.dims().begin(), desc.dims().end(), std::back_inserter(dims)); tensor->Resize(framework::make_ddim(dims)); - void *memory; + void *memory = tensor; int type_size = 0; - // std::cout << " desc pre type: "; switch (desc.data_type()) { - case framework::proto::VarType::FP16: - // std::cout << "FP16" << std::endl; - type_size = 2; - break; - case framework::proto::VarType::FP32: - type_size = 4; - memory = tensor->mutable_data(); - // std::cout << "FP32" << std::endl; - break; - case framework::proto::VarType::FP64: - type_size = 8; - // std::cout << "FP64" << std::endl; - break; - case framework::proto::VarType::INT32: - type_size = 4; - // std::cout << "INT32" << std::endl; - break; - case framework::proto::VarType::INT64: - type_size = 8; - // std::cout << "INT64" << std::endl; - break; - case framework::proto::VarType::BOOL: - type_size = 1; - // std::cout << "BOOL" << std::endl; - break; - default: - break; - // std::cout << " not support" << std::endl; + case framework::proto::VarType::FP16: + type_size = 2; + break; + case framework::proto::VarType::FP32: + type_size = 4; + memory = tensor->mutable_data(); + break; + case framework::proto::VarType::FP64: + type_size = 8; + break; + case framework::proto::VarType::INT32: + type_size = 4; + break; + case framework::proto::VarType::INT64: + type_size = 8; + break; + case framework::proto::VarType::BOOL: + type_size = 1; + break; + default: + break; } - // std::cout << " malloc size: " << memory_size * type_size << - // std::endl; is.read(static_cast(memory), memory_size * type_size); - // std::cout << " memory: " << memory << std::endl; is.close(); -}; +} template -const framework::Program -Loader::Load(const std::string &dirname) { +const framework::Program Loader::Load( + const std::string &dirname) { std::string model_filename = dirname + "/__model__"; std::string program_desc_str; ReadBinaryFile(model_filename, &program_desc_str); @@ -165,10 +141,9 @@ Loader::Load(const std::string &dirname) { std::make_shared(); program.scope = scope; - auto block = originProgramDesc->Block(0); + originProgramDesc->Block(0); - for (auto block : originProgramDesc->Blocks()) { - // std::cout << "for block" << std::endl; + for (const auto &block : originProgramDesc->Blocks()) { for (int i = 0; i < block->Vars().size(); ++i) { std::shared_ptr var_desc = block->Vars()[i]; auto var = scope->Var(var_desc->Name()); @@ -176,20 +151,18 @@ Loader::Load(const std::string &dirname) { if (var_desc->Persistable() && var_desc->GetType() != framework::proto::VarType::FEED_MINIBATCH && var_desc->GetType() != framework::proto::VarType::FETCH_LIST) { - framework::LoDTensor *tensor = - var->GetMutable(); + auto tensor = var->GetMutable(); // to load LoadVar(tensor, dirname + "/" + var_desc->Name()); } } else { - // std::cout << "非 lod" << std::endl; + // TODO by someone } } } #ifdef PADDLE_MOBILE_DEBUG - for (int i = 0; i < program_desc_proto.blocks().size(); ++i) { - framework::proto::BlockDesc block = program_desc_proto.blocks()[i]; + for (const auto &block : program_desc_proto.blocks()) { LOG(kLOG_DEBUG) << "block: " << block.idx(); for (int j = 0; j < block.ops().size(); ++j) { if (j == 2) { @@ -200,65 +173,64 @@ Loader::Load(const std::string &dirname) { for (int m = 0; m < op.inputs_size(); ++m) { const framework::proto::OpDesc::Var &var = op.inputs(m); LOG(kLOG_DEBUG2) << "input parameter: " << var.parameter(); - for (int n = 0; n < var.arguments().size(); ++n) { - LOG(kLOG_DEBUG3) << "argument - " << var.arguments()[n]; + for (const auto &n : var.arguments()) { + LOG(kLOG_DEBUG3) << "argument - " << n; } } for (int y = 0; y < op.outputs_size(); ++y) { const framework::proto::OpDesc::Var &var = op.outputs(y); LOG(kLOG_DEBUG2) << "out parameter: " << var.parameter(); - for (int z = 0; z < var.arguments().size(); ++z) { - LOG(kLOG_DEBUG3) << "argument - " << var.arguments()[z]; + for (const auto &z : var.arguments()) { + LOG(kLOG_DEBUG3) << "argument - " << z; } } - for (int x = 0; x < op.attrs().size(); ++x) { - const framework::proto::OpDesc_Attr attr = op.attrs()[x]; + for (const auto &attr : op.attrs()) { LOG(kLOG_DEBUG2) << "attr name: " << attr.name(); switch (attr.type()) { - case framework::proto::AttrType::BOOLEAN: - LOG(kLOG_DEBUG3) << "boolen: " << attr.b(); - break; - case framework::proto::AttrType::INT: - LOG(kLOG_DEBUG3) << "int: " << attr.i(); - break; - case framework::proto::AttrType::FLOAT: - LOG(kLOG_DEBUG3) << "float: " << attr.f(); - case framework::proto::AttrType::STRING: - LOG(kLOG_DEBUG3) << "string: " << attr.s(); - case framework::proto::AttrType::BOOLEANS: - for (int y = 0; y < attr.bools_size(); ++y) { - LOG(kLOG_DEBUG3) << "bools: " << attr.bools(y); - } - case framework::proto::AttrType::LONG: - LOG(kLOG_DEBUG3) << "long: " << attr.l(); - case framework::proto::AttrType::FLOATS: - for (int y = 0; y < attr.floats_size(); ++y) { - LOG(kLOG_DEBUG3) << "floats: " << attr.floats(y); - } - case framework::proto::AttrType::INTS: - for (int y = 0; y < attr.ints_size(); ++y) { - LOG(kLOG_DEBUG3) << "ints: " << attr.ints(y); - } - case framework::proto::AttrType::STRINGS: - for (int y = 0; y < attr.strings_size(); ++y) { - LOG(kLOG_DEBUG3) << "strings: " << attr.strings(y); - } + case framework::proto::AttrType::BOOLEAN: + LOG(kLOG_DEBUG3) << "boolen: " << attr.b(); + break; + case framework::proto::AttrType::INT: + LOG(kLOG_DEBUG3) << "int: " << attr.i(); + break; + case framework::proto::AttrType::FLOAT: + LOG(kLOG_DEBUG3) << "float: " << attr.f(); + case framework::proto::AttrType::STRING: + LOG(kLOG_DEBUG3) << "string: " << attr.s(); + case framework::proto::AttrType::BOOLEANS: + for (int y = 0; y < attr.bools_size(); ++y) { + LOG(kLOG_DEBUG3) << "bools: " << attr.bools(y); + } + case framework::proto::AttrType::LONG: + LOG(kLOG_DEBUG3) << "long: " << attr.l(); + case framework::proto::AttrType::FLOATS: + for (int y = 0; y < attr.floats_size(); ++y) { + LOG(kLOG_DEBUG3) << "floats: " << attr.floats(y); + } + case framework::proto::AttrType::INTS: + for (int y = 0; y < attr.ints_size(); ++y) { + LOG(kLOG_DEBUG3) << "ints: " << attr.ints(y); + } + case framework::proto::AttrType::STRINGS: + for (int y = 0; y < attr.strings_size(); ++y) { + LOG(kLOG_DEBUG3) << "strings: " << attr.strings(y); + } + case framework::proto::BLOCK: + break; } } } - for (int k = 0; k < block.vars().size(); ++k) { - framework::proto::VarDesc var = block.vars()[k]; + for (const auto &var : block.vars()) { if (var.type().type() == framework::proto::VarType::LOD_TENSOR) { LOG(kLOG_DEBUG1) << "var name: " << var.name(); const framework::proto::VarType::TensorDesc &tensor_desc = var.type().lod_tensor().tensor(); LOG(kLOG_DEBUG2) << "in var tensor desc dims size: " << tensor_desc.dims().size(); - int memory_size = 1; for (int l = 0; l < tensor_desc.dims().size(); ++l) { LOG(kLOG_DEBUG3) << "var tensor desc dim " << l << " value: " << tensor_desc.dims()[l]; @@ -268,28 +240,20 @@ Loader::Load(const std::string &dirname) { if (var.persistable() && var.type().type() != framework::proto::VarType::FEED_MINIBATCH && var.type().type() != framework::proto::VarType::FETCH_LIST) { - // std::cout << " to load " << var.name() << - // std::endl; std::string file_path = dirname + "/" + var.name(); std::ifstream is(file_path); - std::streampos pos = is.tellg(); // save current position + std::fpos pos; + pos = is.tellg(); // save current position is.seekg(0, std::ios::end); - // std::cout << " file length = " << is.tellg() << - // std::endl; - is.seekg(pos); // restore saved position + is.seekg(pos); // restore saved position // 1. version uint32_t version; is.read(reinterpret_cast(&version), sizeof(version)); - // std::cout << " version: " << version << - // std::endl; // 2 Lod information uint64_t lod_level; is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); - // std::cout << " load level: " << lod_level << - // std::endl; - // std::cout << " lod info: " << std::endl; for (uint64_t i = 0; i < lod_level; ++i) { uint64_t size; is.read(reinterpret_cast(&size), sizeof(size)); @@ -297,83 +261,53 @@ Loader::Load(const std::string &dirname) { is.read(reinterpret_cast(tmp.data()), static_cast(size)); for (int j = 0; j < tmp.size(); ++j) { - // std::cout << " lod - " << tmp[j] << - // std::endl; } } - uint32_t tensor_version; is.read(reinterpret_cast(&version), sizeof(version)); - // std::cout << " tensor_version: " << - // tensor_version << - // std::endl; int32_t size; is.read(reinterpret_cast(&size), sizeof(size)); - // std::cout << " tensor desc size: " << size << - // std::endl; std::unique_ptr buf(new char[size]); is.read(reinterpret_cast(buf.get()), size); framework::proto::VarType::TensorDesc desc; desc.ParseFromArray(buf.get(), size); - // std::cout << " desc dims size " << - // desc.dims().size() << - // std::endl; int memory_size = 1; - for (int l = 0; l < desc.dims().size(); ++l) { - // std::cout << " dim " << l << " value: " - // << - // desc.dims()[l] - // << std::endl; - memory_size *= desc.dims()[l]; + for (long long l : desc.dims()) { + memory_size *= l; } int type_size = 0; - // std::cout << " desc pre type: "; switch (desc.data_type()) { - case framework::proto::VarType::FP16: - // std::cout << "FP16" << std::endl; - type_size = 2; - break; - case framework::proto::VarType::FP32: - type_size = 4; - // std::cout << "FP32" << std::endl; - break; - case framework::proto::VarType::FP64: - type_size = 8; - // std::cout << "FP64" << std::endl; - break; - case framework::proto::VarType::INT32: - type_size = 4; - // std::cout << "INT32" << std::endl; - break; - case framework::proto::VarType::INT64: - type_size = 8; - // std::cout << "INT64" << std::endl; - break; - case framework::proto::VarType::BOOL: - type_size = 1; - // std::cout << "BOOL" << std::endl; - break; - default: - break; - // std::cout << " not support" << - // std::endl; + case framework::proto::VarType::FP16: + type_size = 2; + break; + case framework::proto::VarType::FP32: + type_size = 4; + break; + case framework::proto::VarType::FP64: + type_size = 8; + break; + case framework::proto::VarType::INT32: + type_size = 4; + break; + case framework::proto::VarType::INT64: + type_size = 8; + break; + case framework::proto::VarType::BOOL: + type_size = 1; + break; + default: + break; } - // std::cout << " malloc size: " << memory_size * - // type_size - // << std::endl; void *memory = malloc(memory_size * type_size); is.read(static_cast(memory), memory_size * type_size); - // std::cout << " memory: " << memory << - // std::endl; is.close(); } else { - // std::cout << " *not load " - // << " var : " << var.name() << std::endl; + // TODO } } } @@ -384,4 +318,4 @@ Loader::Load(const std::string &dirname) { template class Loader; -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/io.h b/src/io.h index 25837358c2f96f6214f5b3e15ea87a85452a5853..6eb73eec72bd851664e100a40c7c9a8c6dc59884 100644 --- a/src/io.h +++ b/src/io.h @@ -29,11 +29,11 @@ namespace paddle_mobile { template class Loader : PaddleMobileObject { -public: + public: const framework::Program Load(const std::string &dirname); -private: + private: void LoadVar(framework::LoDTensor *tensor, const std::string &file_path); }; -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/memory/t_malloc.cc b/src/memory/t_malloc.cc index 5b3086a8b04fe9f10e8151d5af781c24306de180..aefd37c62ad5e8e6b84fba81f7f937410d13e9d7 100644 --- a/src/memory/t_malloc.cc +++ b/src/memory/t_malloc.cc @@ -47,5 +47,5 @@ void Free(void *ptr) { } } -} // namespace memory -} // namespace paddle_mobile +} // namespace memory +} // namespace paddle_mobile diff --git a/src/memory/t_malloc.h b/src/memory/t_malloc.h index cd2e0e68358d1b592d63853d3d2bfe0ae3df5a0f..30d0b03682212d606ea2139d5572f5334eea302d 100644 --- a/src/memory/t_malloc.h +++ b/src/memory/t_malloc.h @@ -37,10 +37,11 @@ void Free(void *ptr); * std::unique_ptr in tensor.h. * static_cast */ -template class PODDeleter { +template +class PODDeleter { static_assert(std::is_pod::value, "T must be POD"); -public: + public: explicit PODDeleter(){}; void operator()(T *ptr) { Free(static_cast(ptr)); } @@ -54,11 +55,12 @@ public: * std::unique_ptr in tensor.h. * reinterpret_cast */ -template class PlainDeleter { -public: +template +class PlainDeleter { + public: explicit PlainDeleter(){}; void operator()(T *ptr) { Free(reinterpret_cast(ptr)); } }; -} // namespace memory -} // namespace paddle_mobile +} // namespace memory +} // namespace paddle_mobile diff --git a/src/operators/batchnorm_op.cpp b/src/operators/batchnorm_op.cpp index 199c5c157ebf88a1794a61085d79facb9f4afc58..078bfcd1c14db7afadd39cddd116daab02f5b62f 100644 --- a/src/operators/batchnorm_op.cpp +++ b/src/operators/batchnorm_op.cpp @@ -27,5 +27,5 @@ void BatchNormOp::InferShape() const { param_.OutputY()->Resize(x_dims); } template class BatchNormOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/batchnorm_op.h b/src/operators/batchnorm_op.h index a914221d18a1748daffb2647d476f39c56c380ea..bba7e9167af3d389b0997d3ce52d8cebe662157e 100644 --- a/src/operators/batchnorm_op.h +++ b/src/operators/batchnorm_op.h @@ -27,7 +27,7 @@ using namespace framework; template class BatchNormOp : public framework::OperatorWithKernel { -public: + public: BatchNormOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap attrs, @@ -44,9 +44,9 @@ public: using framework::OperatorWithKernel::OperatorWithKernel; void InferShape() const override; -protected: + protected: BatchNormParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/concat_op.cpp b/src/operators/concat_op.cpp index 09b1f615c0dcf703e55de23adec7fd6ae4f0d533..a59f0e916fe5080012d5e0dc25251b375a47da10 100644 --- a/src/operators/concat_op.cpp +++ b/src/operators/concat_op.cpp @@ -60,5 +60,5 @@ void ConcatOp::InferShape() const { } template class ConcatOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/concat_op.h b/src/operators/concat_op.h index 57bebf1553d091c3a543878f60e8a0590f7370c2..2adfd34d0982db2449ba1ee97fc2ee583c05c48a 100644 --- a/src/operators/concat_op.h +++ b/src/operators/concat_op.h @@ -26,7 +26,7 @@ using namespace framework; template class ConcatOp : public framework::OperatorWithKernel { -public: + public: ConcatOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap attrs, std::shared_ptr scope) @@ -42,9 +42,9 @@ public: using framework::OperatorWithKernel::OperatorWithKernel; void InferShape() const override; -protected: + protected: ConcatParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/conv_op.cpp b/src/operators/conv_op.cpp index 27ad954e160174322b953404134c699c93531372..248ed4798b0b7bdb8236698d37d55207278b4cde 100644 --- a/src/operators/conv_op.cpp +++ b/src/operators/conv_op.cpp @@ -71,5 +71,5 @@ void ConvOp::InferShape() const { template class ConvOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/conv_op.h b/src/operators/conv_op.h index 99b5d004d5b3e9c4ae215508ab6bc602675c4c93..bf32ecb8fa59e7549b0fe8f89b4d1ccc473f2462 100644 --- a/src/operators/conv_op.h +++ b/src/operators/conv_op.h @@ -28,7 +28,7 @@ using namespace framework; template class ConvOp : public framework::OperatorWithKernel { -public: + public: ConvOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, std::shared_ptr scope) @@ -45,9 +45,9 @@ public: this->ClearVariables({"Filter", "Input"}); } -private: + private: ConvParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/elementwise_add_op.cpp b/src/operators/elementwise_add_op.cpp index 54c0316c33e1d27114c8364a73bbd3ef8b2c92a0..b4f32874664f79f30057b2b70d1894fe8b69ee54 100644 --- a/src/operators/elementwise_add_op.cpp +++ b/src/operators/elementwise_add_op.cpp @@ -27,5 +27,5 @@ void ElementwiseAddOp::InferShape() const { param_.Out()->Resize(x_dim); } template class ElementwiseAddOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/elementwise_add_op.h b/src/operators/elementwise_add_op.h index 92509f098d5af686754e3797aab87d6d3626c21a..39a795f4274c3ce4133bce4efbf25563e4e6524c 100644 --- a/src/operators/elementwise_add_op.h +++ b/src/operators/elementwise_add_op.h @@ -27,7 +27,7 @@ using namespace framework; template class ElementwiseAddOp : public framework::OperatorWithKernel { -public: + public: ElementwiseAddOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap attrs, @@ -44,8 +44,8 @@ public: using framework::OperatorWithKernel::OperatorWithKernel; void InferShape() const override; -protected: + protected: ElementwiseAddParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/batchnorm_kernel.cpp b/src/operators/kernel/arm/batchnorm_kernel.cpp index 97351c2394c0b2a88a6b7442bbd6140ee1dfbff0..4dd78676cfd7a34d18b28a6f9b5cbb6b54310afc 100644 --- a/src/operators/kernel/arm/batchnorm_kernel.cpp +++ b/src/operators/kernel/arm/batchnorm_kernel.cpp @@ -88,5 +88,5 @@ void BatchNormKernel::Compute(const BatchNormParam ¶m) const { DLOG << "new_bias_ptr : " << new_bias_ptr[5]; DLOG << "out_ptr : " << out_ptr[102]; } -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/concat_kernel.cpp b/src/operators/kernel/arm/concat_kernel.cpp index 3806cbeea7c35d7286757494da74062d284fc27e..ccc609a4e05930cf4884868d2b88a7e3b1019d61 100644 --- a/src/operators/kernel/arm/concat_kernel.cpp +++ b/src/operators/kernel/arm/concat_kernel.cpp @@ -18,8 +18,9 @@ limitations under the License. */ namespace paddle_mobile { namespace operators { -template class ConcatFunctor { -public: +template +class ConcatFunctor { + public: void operator()(const std::vector &input, const int axis, framework::Tensor *output) { size_t num = input.size(); @@ -112,5 +113,5 @@ void ConcatKernel::Compute(const ConcatParam ¶m) const { } } -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/conv_kernel.cpp b/src/operators/kernel/arm/conv_kernel.cpp index 16c944b93b403fb0a855c22de2fd48a18834bcf3..c7ef4e7d2cf5c7461151332c61f119f5d34520f8 100644 --- a/src/operators/kernel/arm/conv_kernel.cpp +++ b/src/operators/kernel/arm/conv_kernel.cpp @@ -34,7 +34,8 @@ bool IsExpand(const std::vector &filter_dim, return !(filter_1 && strides_1 && padding_0 && dilation_1); } -template <> void ConvKernel::Compute(const ConvParam ¶m) const { +template <> +void ConvKernel::Compute(const ConvParam ¶m) const { LOG(kLOG_DEBUG) << param; const Tensor *input = param.Input(); @@ -148,5 +149,5 @@ template <> void ConvKernel::Compute(const ConvParam ¶m) const { template class ConvKernel; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/elementwise_add_kernel.cpp b/src/operators/kernel/arm/elementwise_add_kernel.cpp index 9ae34fe170f76dea149ced01aa0a27fd904042b1..e7405f123353e3755867b6437d3e0525732a3aee 100644 --- a/src/operators/kernel/arm/elementwise_add_kernel.cpp +++ b/src/operators/kernel/arm/elementwise_add_kernel.cpp @@ -19,7 +19,8 @@ limitations under the License. */ namespace paddle_mobile { namespace operators { -template struct AddFunctor { +template +struct AddFunctor { inline T operator()(T a, T b) const { return a + b; } }; @@ -37,5 +38,5 @@ void ElementwiseAddKernel::Compute( template class ElementwiseAddKernel; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/lrn_kernel.cpp b/src/operators/kernel/arm/lrn_kernel.cpp index bc9c871afd122a7389081409bc7e5d042dcb7c1d..6ecee1d97078625b026fb90bdb22153bfbddb639 100644 --- a/src/operators/kernel/arm/lrn_kernel.cpp +++ b/src/operators/kernel/arm/lrn_kernel.cpp @@ -23,7 +23,8 @@ SOFTWARE. namespace paddle_mobile { namespace operators { -template <> void LrnKernel::Compute(const LrnParam ¶m) const { +template <> +void LrnKernel::Compute(const LrnParam ¶m) const { const Tensor *input_x = param.InputX(); auto x_dims = input_x->dims(); /// data_format = NCHW @@ -43,5 +44,5 @@ template <> void LrnKernel::Compute(const LrnParam ¶m) const { template class LrnKernel; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/mul_kernel.cpp b/src/operators/kernel/arm/mul_kernel.cpp index abd5d4d5fccefeb6fcf04fea4af610ae87a4253e..610481c158bdd82b64243922ade0dd5f1ffb9ae0 100644 --- a/src/operators/kernel/arm/mul_kernel.cpp +++ b/src/operators/kernel/arm/mul_kernel.cpp @@ -23,7 +23,8 @@ SOFTWARE. namespace paddle_mobile { namespace operators { -template <> void MulKernel::Compute(const MulParam ¶m) const { +template <> +void MulKernel::Compute(const MulParam ¶m) const { const Tensor *input_x = param.InputX(); const Tensor *input_y = param.InputY(); Tensor *out = param.Out(); @@ -49,5 +50,5 @@ template <> void MulKernel::Compute(const MulParam ¶m) const { template class MulKernel; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/arm/pool_kernel.cpp b/src/operators/kernel/arm/pool_kernel.cpp index 6678e468d7fc08ea99819b507a6a32e416645160..11c6296f8f41e438fcefd71a9deb831fba8abcf3 100644 --- a/src/operators/kernel/arm/pool_kernel.cpp +++ b/src/operators/kernel/arm/pool_kernel.cpp @@ -15,8 +15,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==============================================================================*/ -#include "common/log.h" #include +#include "common/log.h" namespace paddle_mobile { namespace operators { @@ -36,7 +36,8 @@ inline void PoolBasic(std::string pooling_type, std::vector ksize, } } -template <> void PoolKernel::Compute(const PoolParam ¶m) const { +template <> +void PoolKernel::Compute(const PoolParam ¶m) const { const Tensor *in_x = param.Input(); Tensor *out = param.Output(); std::string pooling_type = param.PoolingType(); @@ -73,5 +74,5 @@ template <> void PoolKernel::Compute(const PoolParam ¶m) const { // PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); // } } -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/batchnorm_kernel.h b/src/operators/kernel/batchnorm_kernel.h index 4434c162834ed0b04df138fba0159feda9f7624a..fff57bf5ac4378ebdc70a1c66935f3e9d06f251a 100644 --- a/src/operators/kernel/batchnorm_kernel.h +++ b/src/operators/kernel/batchnorm_kernel.h @@ -28,9 +28,9 @@ using namespace framework; template class BatchNormKernel : public framework::OpKernelBase { -public: + public: void Compute(const BatchNormParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/concat_kernel.h b/src/operators/kernel/concat_kernel.h index 9672ff6ab7128f10d6cdcde3c73f8bdcc3b71003..d2a846edaa44a9acf63afb502c984dddb7a166c6 100644 --- a/src/operators/kernel/concat_kernel.h +++ b/src/operators/kernel/concat_kernel.h @@ -26,9 +26,9 @@ using namespace framework; template class ConcatKernel : public framework::OpKernelBase { -public: + public: void Compute(const ConcatParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/conv_kernel.h b/src/operators/kernel/conv_kernel.h index c1043f5ffdbd66690cbf4dae150379415c5b0aa3..a027079bcadcca0b090f8144130320a9c2aa9673 100644 --- a/src/operators/kernel/conv_kernel.h +++ b/src/operators/kernel/conv_kernel.h @@ -31,8 +31,8 @@ using namespace framework; template class ConvKernel : public framework::OpKernelBase { -public: + public: void Compute(const ConvParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/elementwise_add_kernel.h b/src/operators/kernel/elementwise_add_kernel.h index e542268a94a598578da746ab703a8ac80d0df1ed..ec4793fcd3b44580781b3665c7c0deb846e8668c 100644 --- a/src/operators/kernel/elementwise_add_kernel.h +++ b/src/operators/kernel/elementwise_add_kernel.h @@ -29,8 +29,8 @@ using namespace framework; template class ElementwiseAddKernel : public framework::OpKernelBase { -public: + public: void Compute(const ElementwiseAddParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/fpga/conv_kernel.cpp b/src/operators/kernel/fpga/conv_kernel.cpp index cc4700b5cf6b359178c01a83e8ad13db95851663..c533fc18613d716a2c6ff87876d7e29391feeca3 100644 --- a/src/operators/kernel/fpga/conv_kernel.cpp +++ b/src/operators/kernel/fpga/conv_kernel.cpp @@ -25,4 +25,4 @@ namespace operators { // // template class ConvKernel; } -} // namespace paddle_mobile +} // namespace paddle_mobile diff --git a/src/operators/kernel/lrn_kernel.h b/src/operators/kernel/lrn_kernel.h index 8f7469377095379eea6ffe2ff9b0cb4c8e03905f..2f3168947435f91725ca035030e06202e57ffb7b 100644 --- a/src/operators/kernel/lrn_kernel.h +++ b/src/operators/kernel/lrn_kernel.h @@ -25,7 +25,8 @@ namespace operators { using namespace framework; -template struct LRNFunctor { +template +struct LRNFunctor { void operator()(const framework::Tensor &input, framework::Tensor *out, int N, int C, int H, int W, int n, T k, T alpha, T beta) { auto input_ptr = input.data(); @@ -67,8 +68,8 @@ template struct LRNFunctor { template class LrnKernel : public framework::OpKernelBase { -public: + public: void Compute(const LrnParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/mul_kernel.h b/src/operators/kernel/mul_kernel.h index 2f29bc04a774f97f378e004bf9d589f492040236..094afa7641d6cc192c18c86c4a10b4f62db48e1e 100644 --- a/src/operators/kernel/mul_kernel.h +++ b/src/operators/kernel/mul_kernel.h @@ -28,8 +28,8 @@ using namespace framework; template class MulKernel : public framework::OpKernelBase { -public: + public: void Compute(const MulParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/kernel/pool_kernel.h b/src/operators/kernel/pool_kernel.h index aa763ea45e7d952a498f4f0726067efb0c0992bf..dc5cdc71847527c7cbf994ca7db2cb82878d7915 100644 --- a/src/operators/kernel/pool_kernel.h +++ b/src/operators/kernel/pool_kernel.h @@ -28,8 +28,8 @@ using namespace framework; template class PoolKernel : public framework::OpKernelBase { -public: + public: void Compute(const PoolParam ¶m) const; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/lrn_op.cpp b/src/operators/lrn_op.cpp index e9d52e0be65da39cc4cc0dec5b68170b88987dd1..208d76392f55f04d2dd8a2c755f4df5ac4291ec5 100644 --- a/src/operators/lrn_op.cpp +++ b/src/operators/lrn_op.cpp @@ -21,10 +21,11 @@ SOFTWARE. namespace paddle_mobile { namespace operators { -template void LrnOp::InferShape() const { +template +void LrnOp::InferShape() const { auto x_dims = param_.InputX()->dims(); param_.Out()->Resize(x_dims); } template class LrnOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/lrn_op.h b/src/operators/lrn_op.h index b65da61089e5d50f5e66a8515a91d5e9259fd85f..0864cea07fb21ba1816b6740116fbdc46644dac2 100644 --- a/src/operators/lrn_op.h +++ b/src/operators/lrn_op.h @@ -27,7 +27,7 @@ using namespace framework; template class LrnOp : public framework::OperatorWithKernel { -public: + public: LrnOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap attrs, std::shared_ptr scope) @@ -43,9 +43,9 @@ public: using framework::OperatorWithKernel::OperatorWithKernel; void InferShape() const override; -protected: + protected: LrnParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/elementwise_op_function.h b/src/operators/math/elementwise_op_function.h index 3ff20cdc04380b08e5ff64bbda69cd9df056eb93..55ec1e161514624b9e0ceae266c4e684e8d7e380 100644 --- a/src/operators/math/elementwise_op_function.h +++ b/src/operators/math/elementwise_op_function.h @@ -58,8 +58,7 @@ inline void trim_trailing_singular_dims(framework::DDim *dims) { // Remove trailing dimensions of size 1 for y auto actual_dims_size = dims->size(); for (; actual_dims_size != 0; --actual_dims_size) { - if ((*dims)[actual_dims_size - 1] != 1) - break; + if ((*dims)[actual_dims_size - 1] != 1) break; } if (actual_dims_size != dims->size()) { auto actual_dims = framework::vectorize(*dims); @@ -68,8 +67,9 @@ inline void trim_trailing_singular_dims(framework::DDim *dims) { } } -template class RowwiseTransformIterator { -public: +template +class RowwiseTransformIterator { + public: RowwiseTransformIterator(const T *ptr, int n) : ptr_(ptr), i_(0), n_(n) {} RowwiseTransformIterator &operator++() { @@ -90,7 +90,7 @@ public: const T &operator*() { return ptr_[i_]; } -private: + private: const T *ptr_; int i_; int64_t n_; @@ -100,8 +100,9 @@ private: /// dimension /// in (4,20,2) is 2 , /// (20,1) move 1 stride , to fill(add) 2 element with the same number. -template class MidWiseTransformIterator { -public: +template +class MidWiseTransformIterator { + public: MidWiseTransformIterator(const T *ptr, int n, int post) : ptr_(ptr), i_(0), j_(0), n_(n), post_(post) {} @@ -127,7 +128,7 @@ public: const T &operator*() { return ptr_[i_]; } -private: + private: const T *ptr_; int64_t i_; int64_t j_; @@ -137,11 +138,14 @@ private: template class TransformFunctor { -public: + public: TransformFunctor(const framework::Tensor *x, const framework::Tensor *y, framework::Tensor *z, Functor func) - : x_(x->data()), y_(y->data()), z_(z->mutable_data()), - nx_(x->numel()), func_(func) {} + : x_(x->data()), + y_(y->data()), + z_(z->mutable_data()), + nx_(x->numel()), + func_(func) {} inline void Run() const { math::Transform trans; @@ -159,7 +163,7 @@ public: trans(x_, x_ + nx_, MidWiseTransformIterator(y_, n, post), z_, func_); } -private: + private: const T *x_; const T *y_; OutType *z_; @@ -202,5 +206,5 @@ void ElementwiseComputeEx(const framework::Tensor *x, } } -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/im2col.cc b/src/operators/math/im2col.cc index 848c5118ebfc34a5a9397f1ebd531f88053255b9..4868cbeaaf2046f7bb0e46df4984248d68ba5664 100644 --- a/src/operators/math/im2col.cc +++ b/src/operators/math/im2col.cc @@ -25,8 +25,9 @@ namespace math { * [input_channels, filter_height, filter_width, output_height, * output_width] */ -template class Im2ColFunctor { -public: +template +class Im2ColFunctor { + public: void operator()(const framework::Tensor &im, const std::vector &dilation, const std::vector &stride, const std::vector &padding, framework::Tensor *col) { @@ -93,8 +94,9 @@ public: * [input_channels, filter_height, filter_width, output_height, * output_width] */ -template class Col2ImFunctor { -public: +template +class Col2ImFunctor { + public: void operator()(const framework::Tensor &col, const std::vector &dilation, const std::vector &stride, @@ -165,8 +167,9 @@ template class Col2ImFunctor; * [output_height, output_width, input_channels, filter_height, * filter_width] */ -template class Im2ColFunctor { -public: +template +class Im2ColFunctor { + public: void operator()(const framework::Tensor &im, const std::vector &dilation, const std::vector &stride, const std::vector &padding, framework::Tensor *col) { @@ -237,8 +240,9 @@ public: * [output_height, output_width, input_channels, filter_height, * filter_width] */ -template class Col2ImFunctor { -public: +template +class Col2ImFunctor { + public: void operator()(const framework::Tensor &col, const std::vector &dilation, const std::vector &stride, @@ -309,6 +313,6 @@ template class Im2ColFunctor; template class Col2ImFunctor; template class Col2ImFunctor; -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/im2col.h b/src/operators/math/im2col.h index 22667950eda09a67c9ca0c71dccf8c9fe20c89c0..bb107c727c1b06ad8711e951ceec63d6c4b34b07 100644 --- a/src/operators/math/im2col.h +++ b/src/operators/math/im2col.h @@ -89,7 +89,7 @@ enum class ColFormat { kCFO = 0, kOCF = 1 }; */ template class Im2ColFunctor { -public: + public: void operator()(const framework::Tensor &im, const std::vector &dilation, const std::vector &stride, const std::vector &padding, framework::Tensor *col); @@ -97,13 +97,13 @@ public: template class Col2ImFunctor { -public: + public: void operator()(const framework::Tensor &col, const std::vector &dilation, const std::vector &stride, const std::vector &padding, framework::Tensor *im); }; -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/math_function.cc b/src/operators/math/math_function.cc index 30038ce0ba7be699a4ab7d2351bdc43c1979c0da..8df826e1f1235bc0d4d12da10be046128ec0708f 100644 --- a/src/operators/math/math_function.cc +++ b/src/operators/math/math_function.cc @@ -119,6 +119,6 @@ void matmul(const framework::Tensor &matrix_a, bool trans_a, matrix_b.data(), beta, matrix_out->data()); } -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/math_function.h b/src/operators/math/math_function.h index c6cfea885601846123ab026d823d885d600ac77c..d641d4ee308abe4a16d61106ac450086b9de1c4d 100644 --- a/src/operators/math/math_function.h +++ b/src/operators/math/math_function.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "framework/tensor.h" #include #include +#include "framework/tensor.h" namespace paddle_mobile { namespace operators { @@ -37,6 +37,6 @@ template void matmul(const framework::Tensor &matrix_a, bool trans_a, const framework::Tensor &matrix_b, bool trans_b, T alpha, framework::Tensor *matrix_out, T beta); -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/pool3x3.h b/src/operators/math/pool3x3.h index 3d4cc7975a12e03646a91184250dd53ce5faeb69..5d892dad3877d849841364599fe9e58eca679a13 100644 --- a/src/operators/math/pool3x3.h +++ b/src/operators/math/pool3x3.h @@ -19,7 +19,7 @@ SOFTWARE. #if __ARM_NEON #include -#endif // __ARM_NEON +#endif // __ARM_NEON static void Pool3x3Max() { // todo impl with neon diff --git a/src/operators/math/pool_2x2.h b/src/operators/math/pool_2x2.h index b1ab4fadbba173eda12d5e8fb23713094f220129..13fbf79e4457093666745d777adeafdf9e0791ee 100644 --- a/src/operators/math/pool_2x2.h +++ b/src/operators/math/pool_2x2.h @@ -19,7 +19,7 @@ SOFTWARE. #if __ARM_NEON #include -#endif // __ARM_NEON +#endif // __ARM_NEON static void Pool2x2Max() { // todo impl with neon diff --git a/src/operators/math/pooling.cpp b/src/operators/math/pooling.cpp index 58b230b525748271223ded2ad89bc5cfa883bf84..6a702a94888bb94f27e1137198fb561ab9b8b5f5 100644 --- a/src/operators/math/pooling.cpp +++ b/src/operators/math/pooling.cpp @@ -30,12 +30,11 @@ namespace math { */ template class PoolFunctor { -public: + public: void operator()(const framework::Tensor &input, const std::vector &ksize, const std::vector &strides, const std::vector &paddings, PoolProcess pool_process, framework::Tensor *output) { - const int batch_size = input.dims()[0]; const int input_height = input.dims()[2]; @@ -93,6 +92,6 @@ public: template class PoolFunctor, float>; template class PoolFunctor, float>; -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/pooling.h b/src/operators/math/pooling.h index 08ff7c07c6f54c14c1f3390625d25f8d6ae6a5c6..120c00dea047f15c07a4a9275571fca9a9eb8205 100644 --- a/src/operators/math/pooling.h +++ b/src/operators/math/pooling.h @@ -37,8 +37,9 @@ namespace math { * in pool pooling, and finally takes the average. * MaxPoolGrad and AvgPoolGrad are gradient operations respectively. */ -template class MaxPool { -public: +template +class MaxPool { + public: inline T initial() { return static_cast(-FLT_MAX); } inline void compute(const T &x, T *y) { *y = *y > x ? *y : x; } @@ -46,8 +47,9 @@ public: inline void finalize(const T &pool_field, T *y) {} }; -template class AvgPool { -public: +template +class AvgPool { + public: inline T initial() { return static_cast(0); } inline void compute(const T &x, T *y) { *y += x; } @@ -57,12 +59,12 @@ public: template class PoolFunctor { -public: + public: void operator()(const framework::Tensor &input, const std::vector &ksize, const std::vector &strides, const std::vector &paddings, PoolProcess pool_compute, framework::Tensor *output); }; } -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/transform.h b/src/operators/math/transform.h index 85691e376c70475ee369a1aef434bebcfa29467e..c7e5cb5bee08dbf367ea63aaf8a8f0269590910e 100644 --- a/src/operators/math/transform.h +++ b/src/operators/math/transform.h @@ -50,6 +50,6 @@ struct Transform { std::transform(first1, last1, first2, result, op); } }; -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/vol2col.cc b/src/operators/math/vol2col.cc index c2ceabe020fb9029e50400fddc70715a6f45b44d..011bcb02720ab3f39e65e332dec266c46870e19d 100644 --- a/src/operators/math/vol2col.cc +++ b/src/operators/math/vol2col.cc @@ -25,8 +25,9 @@ using Tensor = paddle_mobile::framework::Tensor; * [input_channels, filter_depth, filter_height, filter_width, * output_depth, output_height, output_width] */ -template class Vol2ColFunctor { -public: +template +class Vol2ColFunctor { + public: void operator()(const Tensor &vol, const std::vector &dilations, const std::vector &strides, const std::vector &paddings, Tensor *col) const { @@ -111,8 +112,9 @@ public: * [input_channels, filter_depth, filter_height, filter_width, * output_depth, output_height, output_width] */ -template class Col2VolFunctor { -public: +template +class Col2VolFunctor { + public: void operator()(const Tensor &col, const std::vector &dilations, const std::vector &strides, const std::vector &paddings, Tensor *vol) const { @@ -196,6 +198,6 @@ template class Vol2ColFunctor; template class Col2VolFunctor; template class Col2VolFunctor; -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/math/vol2col.h b/src/operators/math/vol2col.h index 64b81811f01dee5ea2d9a4874a42f7cf36c43a32..55a8b0dc388a02e72fc23d4faaa2b48534bc7421 100644 --- a/src/operators/math/vol2col.h +++ b/src/operators/math/vol2col.h @@ -72,20 +72,22 @@ namespace math { */ using Tensor = paddle_mobile::framework::Tensor; -template class Vol2ColFunctor { -public: +template +class Vol2ColFunctor { + public: void operator()(const Tensor &vol, const std::vector &dilations, const std::vector &strides, const std::vector &paddings, Tensor *col) const; }; -template class Col2VolFunctor { -public: +template +class Col2VolFunctor { + public: void operator()(const Tensor &col, const std::vector &dilations, const std::vector &strides, const std::vector &paddings, Tensor *vol) const; }; -} // namespace math -} // namespace operators -} // namespace paddle_mobile +} // namespace math +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/mul_op.cpp b/src/operators/mul_op.cpp index 056ce696e391b4295fcc12c7a50ffb089ac1123b..4140bf6b9e0d9a91ed67e0180c8a59b03fa84f7b 100644 --- a/src/operators/mul_op.cpp +++ b/src/operators/mul_op.cpp @@ -21,7 +21,8 @@ SOFTWARE. namespace paddle_mobile { namespace operators { -template void MulOp::InferShape() const { +template +void MulOp::InferShape() const { auto x_dims = param_.InputX()->dims(); auto y_dims = param_.InputY()->dims(); int x_num_col_dims = param_.XNumColDims(); @@ -52,5 +53,5 @@ template void MulOp::InferShape() const { param_.Out()->Resize(ddim); } template class MulOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/mul_op.h b/src/operators/mul_op.h index 055acbf0f70c801030bbcbce6f427312f6645067..1eb24773e06465d3d3a5d99c3d2c31d81e7163cd 100644 --- a/src/operators/mul_op.h +++ b/src/operators/mul_op.h @@ -27,7 +27,7 @@ using namespace framework; template class MulOp : public framework::OperatorWithKernel { -public: + public: MulOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap attrs, std::shared_ptr scope) @@ -43,9 +43,9 @@ public: using framework::OperatorWithKernel::OperatorWithKernel; void InferShape() const override; -protected: + protected: MulParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/op_param.cpp b/src/operators/op_param.cpp index 80a488150df27ad11a836d54b040368d87e01f66..cbe9d414c4af26d0086bb5829b26f3817410867e 100644 --- a/src/operators/op_param.cpp +++ b/src/operators/op_param.cpp @@ -40,5 +40,5 @@ Print &operator<<(Print &printer, const ConvParam &conv_param) { printer << " output dims: " << conv_param.Output()->dims(); return printer; } -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/op_param.h b/src/operators/op_param.h index 49996264168d43b9e2a1c5d2ea35b5a85454f95a..dc5dfb83d0ecb39e872e831125ddc17ee7557ca6 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -31,8 +31,8 @@ namespace operators { using namespace framework; class OpParam : PaddleMobileObject { -public: -protected: + public: + protected: template static T *InputFrom(const VariableNameMap &inputs, const Scope &scope) { return GetVarValue("Input", inputs, scope); @@ -132,7 +132,7 @@ protected: }; class ConvParam : OpParam { -public: + public: ConvParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, const framework::Scope &scope) { @@ -159,7 +159,7 @@ public: const int &Groups() const { return groups; } -private: + private: Tensor *input_; Tensor *output_; LoDTensor *filter_; @@ -172,7 +172,7 @@ private: Print &operator<<(Print &printer, const ConvParam &conv_param); class ElementwiseAddParam : OpParam { -public: + public: ElementwiseAddParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, @@ -191,7 +191,7 @@ public: const int &Axis() const { return axis_; } -private: + private: Tensor *input_x_; Tensor *input_y_; Tensor *out_; @@ -199,7 +199,7 @@ private: }; class MulParam : OpParam { -public: + public: MulParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, const framework::Scope &scope) { @@ -220,7 +220,7 @@ public: const int &YNumColDims() const { return y_num_col_dims_; } -private: + private: Tensor *input_x_; Tensor *input_y_; Tensor *out_; @@ -229,7 +229,7 @@ private: }; class ConcatParam : public OpParam { -public: + public: ConcatParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, const framework::Scope &scope) { @@ -244,14 +244,14 @@ public: const int &Axis() const { return axis_; } -private: + private: std::vector inputs_; Tensor *out_; int axis_; }; class LrnParam : public OpParam { -public: + public: LrnParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, const framework::Scope &scope) { @@ -281,7 +281,7 @@ public: const std::string &DataFormat() const { return data_format_; } -private: + private: Tensor *input_x_; Tensor *out_; Tensor *mid_out_; @@ -292,7 +292,7 @@ private: std::string data_format_; }; class BatchNormParam : OpParam { -public: + public: BatchNormParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, const framework::Scope &scope) { @@ -327,7 +327,7 @@ public: const std::string &DataFormat() const { return data_format_; } -private: + private: Tensor *input_x_; Tensor *output_y_; Tensor *input_bias_; @@ -340,7 +340,7 @@ private: std::string data_format_; }; class PoolParam : public OpParam { -public: + public: PoolParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, const framework::Scope &scope) { @@ -371,7 +371,7 @@ public: bool isGlobalPooling() const { return gloabal_pooling_; } -private: + private: Tensor *input_; Tensor *output_; std::string pooling_type_; @@ -382,5 +382,5 @@ private: bool gloabal_pooling_ = false; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/pool_op.cpp b/src/operators/pool_op.cpp index d93c66f9bad333bcae7613f733f0e41d85c17880..df635b089c1df78c0dd467421549045371b42019 100644 --- a/src/operators/pool_op.cpp +++ b/src/operators/pool_op.cpp @@ -56,5 +56,5 @@ void PoolOp::InferShape() const { DLOG << "infer shape out size =" << param_.Output()->numel(); } template class PoolOp; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/operators/pool_op.h b/src/operators/pool_op.h index 09f7ec5d8d78b5358feca2de4386e2355f6ca2e9..d49f1c34e0badceda943eddd447bb25f939bd724 100644 --- a/src/operators/pool_op.h +++ b/src/operators/pool_op.h @@ -28,7 +28,7 @@ using namespace framework; template class PoolOp : public framework::OperatorWithKernel { -public: + public: PoolOp(const std::string &type, const VariableNameMap &inputs, const VariableNameMap &outputs, const framework::AttributeMap &attrs, std::shared_ptr scope) @@ -45,8 +45,8 @@ public: this->ClearVariables({"X"}); } -private: + private: PoolParam param_; }; -} // namespace operators -} // namespace paddle_mobile +} // namespace operators +} // namespace paddle_mobile diff --git a/src/platform/data_type.h b/src/platform/data_type.h index e8e5fd317b304bfd29f90da0a31db4ada336d06a..401c7eb119e273ab04dd64b864618696865360e6 100644 --- a/src/platform/data_type.h +++ b/src/platform/data_type.h @@ -14,9 +14,9 @@ limitations under the License. */ #pragma once -#include "framework/framework.pb.h" #include #include +#include "framework/framework.pb.h" namespace paddle_mobile { namespace framework { @@ -48,70 +48,70 @@ inline proto::VarType::Type ToDataType(std::type_index type) { inline std::type_index ToTypeIndex(proto::VarType::Type type) { switch (type) { - // case proto::VarType::FP16: - // return typeid(platform::float16); - case proto::VarType::FP32: - return typeid(float); - case proto::VarType::FP64: - return typeid(double); - case proto::VarType::INT32: - return typeid(int); - case proto::VarType::INT64: - return typeid(int64_t); - case proto::VarType::BOOL: - return typeid(bool); - default: - // PADDLE_THROW("Not support type %d", type); - printf("Not support type %d", type); + // case proto::VarType::FP16: + // return typeid(platform::float16); + case proto::VarType::FP32: + return typeid(float); + case proto::VarType::FP64: + return typeid(double); + case proto::VarType::INT32: + return typeid(int); + case proto::VarType::INT64: + return typeid(int64_t); + case proto::VarType::BOOL: + return typeid(bool); + default: + // PADDLE_THROW("Not support type %d", type); + printf("Not support type %d", type); } } template inline void VisitDataType(proto::VarType::Type type, Visitor visitor) { switch (type) { - // case proto::VarType::FP16: - // visitor.template operator()(); - // break; - case proto::VarType::FP32: - visitor.template operator()(); - break; - case proto::VarType::FP64: - visitor.template operator()(); - break; - case proto::VarType::INT32: - visitor.template operator()(); - break; - case proto::VarType::INT64: - visitor.template operator()(); - break; - case proto::VarType::BOOL: - visitor.template operator()(); - break; - default: - // PADDLE_THROW("Not supported"); - printf("Not supported"); + // case proto::VarType::FP16: + // visitor.template operator()(); + // break; + case proto::VarType::FP32: + visitor.template operator()(); + break; + case proto::VarType::FP64: + visitor.template operator()(); + break; + case proto::VarType::INT32: + visitor.template operator()(); + break; + case proto::VarType::INT64: + visitor.template operator()(); + break; + case proto::VarType::BOOL: + visitor.template operator()(); + break; + default: + // PADDLE_THROW("Not supported"); + printf("Not supported"); } } inline std::string DataTypeToString(const proto::VarType::Type type) { switch (type) { - case proto::VarType::FP16: - return "float16"; - case proto::VarType::FP32: - return "float32"; - case proto::VarType::FP64: - return "float64"; - case proto::VarType::INT16: - return "int16"; - case proto::VarType::INT32: - return "int32"; - case proto::VarType::INT64: - return "int64"; - case proto::VarType::BOOL: - return "bool"; - default: - // PADDLE_THROW("Not support type %d", type); - printf("Not support type %d", type); + case proto::VarType::FP16: + return "float16"; + case proto::VarType::FP32: + return "float32"; + case proto::VarType::FP64: + return "float64"; + case proto::VarType::INT16: + return "int16"; + case proto::VarType::INT32: + return "int32"; + case proto::VarType::INT64: + return "int64"; + case proto::VarType::BOOL: + return "bool"; + default: + // PADDLE_THROW("Not support type %d", type); + printf("Not support type %d", type); } } @@ -121,5 +121,5 @@ inline std::ostream &operator<<(std::ostream &out, return out; } -} // namespace framework -} // namespace paddle_mobile +} // namespace framework +} // namespace paddle_mobile diff --git a/src/platform/macros.h b/src/platform/macros.h index 2f81e9409625dfb11b9d438f1ee531fa710f4f6b..4081fc7e80c5ddae7cb9fce2e593bfa87b57ee8d 100644 --- a/src/platform/macros.h +++ b/src/platform/macros.h @@ -16,10 +16,10 @@ limitations under the License. */ // Disable the copy and assignment operator for a class. #ifndef DISABLE_COPY_AND_ASSIGN -#define DISABLE_COPY_AND_ASSIGN(classname) \ -private: \ - classname(const classname &) = delete; \ - classname(classname &&) = delete; \ - classname &operator=(const classname &) = delete; \ +#define DISABLE_COPY_AND_ASSIGN(classname) \ + private: \ + classname(const classname &) = delete; \ + classname(classname &&) = delete; \ + classname &operator=(const classname &) = delete; \ classname &operator=(classname &&) = delete #endif diff --git a/test/operators/test_cov_op.cpp b/test/operators/test_cov_op.cpp index 57c07a4807b944e5560c4c8472fab7eebb21cc96..7acc2eef4bdefdf9f5e446e83eb925c4c883b61c 100644 --- a/test/operators/test_cov_op.cpp +++ b/test/operators/test_cov_op.cpp @@ -18,7 +18,7 @@ SOFTWARE. #include "../framework/executor_for_test.h" #include "../test_helper.h" -#include "io.h" +#include "./io.h" int main() { paddle_mobile::Loader loader; @@ -38,7 +38,7 @@ int main() { auto output = executor.predict(input, "data", "conv2d_0.tmp_0", {1, 64, 56, 56}); - float *output_ptr = output->data(); + auto output_ptr = output->data(); for (int j = 0; j < output->numel(); ++j) { DLOG << " value of output: " << output_ptr[j]; }