diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt new file mode 100644 index 0000000000..e283e4803b --- /dev/null +++ b/modules/dnn/CMakeLists.txt @@ -0,0 +1,84 @@ +if(WINRT) + ocv_module_disable(dnn) +endif() + +include(${OpenCV_SOURCE_DIR}/cmake/OpenCVFindLibProtobuf.cmake) +if(NOT Protobuf_FOUND) + ocv_module_disable(opencv_dnn) +endif() + +set(the_description "Deep neural network module. It allows to load models from different frameworks and to make forward pass") + +ocv_add_module(dnn opencv_core opencv_imgproc WRAP python matlab) +ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninitialized -Wsign-promo + -Wmissing-declarations -Wmissing-prototypes +) +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4701 /wd4100) + +if(MSVC) + add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 ) + ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 + /wd4305 /wd4127 /wd4100 /wd4512 /wd4125 /wd4389 /wd4510 /wd4610 + /wd4702 /wd4456 /wd4457 /wd4065 /wd4310 /wd4661 /wd4506 + ) +else() + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated -Wmissing-prototypes -Wmissing-declarations -Wshadow + -Wunused-parameter -Wunused-local-typedefs -Wsign-compare -Wsign-promo + -Wundef -Wtautological-undefined-compare -Wignored-qualifiers -Wextra + -Wunused-function -Wunused-const-variable -Wdeprecated-declarations + ) +endif() + +if(APPLE_FRAMEWORK) + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshorten-64-to-32) +endif() + +if(ANDROID) + add_definitions(-DDISABLE_POSIX_MEMALIGN -DTH_DISABLE_HEAP_TRACKING) +endif() + +#supress warnings in autogenerated caffe.pb.* files +add_definitions(-DHAVE_PROTOBUF=1) +ocv_warnings_disable(CMAKE_CXX_FLAGS + -Wunused-parameter -Wundef -Wignored-qualifiers -Wno-enum-compare + -Wdeprecated-declarations + /wd4125 /wd4267 /wd4127 /wd4244 /wd4512 /wd4702 + /wd4456 /wd4510 /wd4610 /wd4800 + -wd858 -wd2196 +) + +if(PROTOBUF_UPDATE_FILES) + file(GLOB proto_files src/tensorflow/*.proto) + list(APPEND proto_files src/caffe/caffe.proto) + PROTOBUF_GENERATE_CPP(Protobuf_HDRS Protobuf_SRCS ${proto_files}) +else() + file(GLOB fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow/*.cc) + file(GLOB fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow/*.h) + list(APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/caffe.pb.cc) + list(APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/caffe.pb.h) + list(APPEND Protobuf_SRCS ${fw_srcs}) + list(APPEND Protobuf_HDRS ${fw_hdrs}) + list(APPEND Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe) + list(APPEND Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow) +endif() + +ocv_source_group("Src\\protobuf" FILES ${Protobuf_SRCS} ${Protobuf_HDRS}) +ocv_module_include_directories(include ${Protobuf_INCLUDE_DIRS}) + +ocv_glob_module_sources(${Protobuf_SRCS} ${Protobuf_HDRS} ${CBLAS_H_PROXY_PATH}) +ocv_create_module(${Protobuf_LIBRARIES} ${LAPACK_LIBRARIES}) +ocv_add_samples() +ocv_add_accuracy_tests() +ocv_add_perf_tests() + +# ---------------------------------------------------------------------------- +# Torch7 importer of blobs and models, produced by Torch.nn module +# ---------------------------------------------------------------------------- +OCV_OPTION(${the_module}_BUILD_TORCH_IMPORTER "Build Torch model importer" ON) +if(${the_module}_BUILD_TORCH_IMPORTER) + message(STATUS "Torch importer has been enabled. To run the tests you have to install Torch " + "('th' executable should be available) " + "and generate testdata using opencv_extra/testdata/dnn/generate_torch_models.py script.") + add_definitions(-DENABLE_TORCH_IMPORTER=1) + ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702 /wd4127 /wd4267) #supress warnings in original torch files +endif() diff --git a/modules/dnn/README.md b/modules/dnn/README.md new file mode 100644 index 0000000000..6e7e9c408a --- /dev/null +++ b/modules/dnn/README.md @@ -0,0 +1,2 @@ +Deep Neural Network module +========================== \ No newline at end of file diff --git a/modules/dnn/include/opencv2/dnn.hpp b/modules/dnn/include/opencv2/dnn.hpp new file mode 100644 index 0000000000..37be989263 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn.hpp @@ -0,0 +1,64 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_HPP__ +#define __OPENCV_DNN_HPP__ + +// This is an umbrealla header to include into you project. +// We are free to change headers layout in dnn subfolder, so please include +// this header for future compartibility + + +/** @defgroup dnn Deep Neural Network module + @{ + This module contains: + - API for new layers creation, layers are building bricks of neural networks; + - set of built-in most-useful Layers; + - API to constuct and modify comprehensive neural networks from layers; + - functionality for loading serialized networks models from differnet frameworks. + + Functionality of this module is designed only for forward pass computations (i. e. network testing). + A network training is in principle not supported. + @} +*/ +#include + +#endif /* __OPENCV_DNN_HPP__ */ diff --git a/modules/dnn/include/opencv2/dnn/all_layers.hpp b/modules/dnn/include/opencv2/dnn/all_layers.hpp new file mode 100644 index 0000000000..a953e813c2 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn/all_layers.hpp @@ -0,0 +1,471 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_DNN_ALL_LAYERS_HPP__ +#define __OPENCV_DNN_DNN_ALL_LAYERS_HPP__ +#include + +namespace cv +{ +namespace dnn +{ +//! @addtogroup dnn +//! @{ + +/** @defgroup dnnLayerList Partial List of Implemented Layers + @{ + This subsection of dnn module contains information about bult-in layers and their descriptions. + + Classes listed here, in fact, provides C++ API for creating intances of bult-in layers. + In addition to this way of layers instantiation, there is a more common factory API (see @ref dnnLayerFactory), it allows to create layers dynamically (by name) and register new ones. + You can use both API, but factory API is less convinient for native C++ programming and basically designed for use inside importers (see @ref Importer, @ref createCaffeImporter(), @ref createTorchImporter()). + + Bult-in layers partially reproduce functionality of corresponding Caffe and Torch7 layers. + In partuclar, the following layers and Caffe @ref Importer were tested to reproduce Caffe functionality: + - Convolution + - Deconvolution + - Pooling + - InnerProduct + - TanH, ReLU, Sigmoid, BNLL, Power, AbsVal + - Softmax + - Reshape, Flatten, Slice, Split + - LRN + - MVN + - Dropout (since it does nothing on forward pass -)) +*/ + + class CV_EXPORTS BlankLayer : public Layer + { + public: + static Ptr create(const LayerParams ¶ms); + }; + + //! LSTM recurrent layer + class CV_EXPORTS LSTMLayer : public Layer + { + public: + /** Creates instance of LSTM layer */ + static Ptr create(const LayerParams& params); + + /** Set trained weights for LSTM layer. + LSTM behavior on each step is defined by current input, previous output, previous cell state and learned weights. + + Let @f$x_t@f$ be current input, @f$h_t@f$ be current output, @f$c_t@f$ be current state. + Than current output and current cell state is computed as follows: + @f{eqnarray*}{ + h_t &= o_t \odot tanh(c_t), \\ + c_t &= f_t \odot c_{t-1} + i_t \odot g_t, \\ + @f} + where @f$\odot@f$ is per-element multiply operation and @f$i_t, f_t, o_t, g_t@f$ is internal gates that are computed using learned wights. + + Gates are computed as follows: + @f{eqnarray*}{ + i_t &= sigmoid&(W_{xi} x_t + W_{hi} h_{t-1} + b_i), \\ + f_t &= sigmoid&(W_{xf} x_t + W_{hf} h_{t-1} + b_f), \\ + o_t &= sigmoid&(W_{xo} x_t + W_{ho} h_{t-1} + b_o), \\ + g_t &= tanh &(W_{xg} x_t + W_{hg} h_{t-1} + b_g), \\ + @f} + where @f$W_{x?}@f$, @f$W_{h?}@f$ and @f$b_{?}@f$ are learned weights represented as matrices: + @f$W_{x?} \in R^{N_h \times N_x}@f$, @f$W_{h?} \in R^{N_h \times N_h}@f$, @f$b_? \in R^{N_h}@f$. + + For simplicity and performance purposes we use @f$ W_x = [W_{xi}; W_{xf}; W_{xo}, W_{xg}] @f$ + (i.e. @f$W_x@f$ is vertical contacentaion of @f$ W_{x?} @f$), @f$ W_x \in R^{4N_h \times N_x} @f$. + The same for @f$ W_h = [W_{hi}; W_{hf}; W_{ho}, W_{hg}], W_h \in R^{4N_h \times N_h} @f$ + and for @f$ b = [b_i; b_f, b_o, b_g]@f$, @f$b \in R^{4N_h} @f$. + + @param Wh is matrix defining how previous output is transformed to internal gates (i.e. according to abovemtioned notation is @f$ W_h @f$) + @param Wx is matrix defining how current input is transformed to internal gates (i.e. according to abovemtioned notation is @f$ W_x @f$) + @param b is bias vector (i.e. according to abovemtioned notation is @f$ b @f$) + */ + virtual void setWeights(const Mat &Wh, const Mat &Wx, const Mat &b) = 0; + + /** @brief Specifies shape of output blob which will be [[`T`], `N`] + @p outTailShape. + * @details If this parameter is empty or unset then @p outTailShape = [`Wh`.size(0)] will be used, + * where `Wh` is parameter from setWeights(). + */ + virtual void setOutShape(const MatShape &outTailShape = MatShape()) = 0; + + /** @brief Specifies either interpet first dimension of input blob as timestamp dimenion either as sample. + * + * If flag is set to true then shape of input blob will be interpeted as [`T`, `N`, `[data dims]`] where `T` specifies number of timpestamps, `N` is number of independent streams. + * In this case each forward() call will iterate through `T` timestamps and update layer's state `T` times. + * + * If flag is set to false then shape of input blob will be interpeted as [`N`, `[data dims]`]. + * In this case each forward() call will make one iteration and produce one timestamp with shape [`N`, `[out dims]`]. + */ + virtual void setUseTimstampsDim(bool use = true) = 0; + + /** @brief If this flag is set to true then layer will produce @f$ c_t @f$ as second output. + * @details Shape of the second output is the same as first output. + */ + virtual void setProduceCellOutput(bool produce = false) = 0; + + /* In common case it use single input with @f$x_t@f$ values to compute output(s) @f$h_t@f$ (and @f$c_t@f$). + * @param input should contain packed values @f$x_t@f$ + * @param output contains computed outputs: @f$h_t@f$ (and @f$c_t@f$ if setProduceCellOutput() flag was set to true). + * + * If setUseTimstampsDim() is set to true then @p input[0] should has at least two dimensions with the following shape: [`T`, `N`, `[data dims]`], + * where `T` specifies number of timpestamps, `N` is number of independent streams (i.e. @f$ x_{t_0 + t}^{stream} @f$ is stored inside @p input[0][t, stream, ...]). + * + * If setUseTimstampsDim() is set to fase then @p input[0] should contain single timestamp, its shape should has form [`N`, `[data dims]`] with at least one dimension. + * (i.e. @f$ x_{t}^{stream} @f$ is stored inside @p input[0][stream, ...]). + */ + + int inputNameToIndex(String inputName); + int outputNameToIndex(String outputName); + }; + + //! Classical recurrent layer + class CV_EXPORTS RNNLayer : public Layer + { + public: + /** Creates instance of RNNLayer */ + static Ptr create(const LayerParams& params); + + /** Setups learned weights. + + Recurrent-layer behavior on each step is defined by current input @f$ x_t @f$, previous state @f$ h_t @f$ and learned weights as follows: + @f{eqnarray*}{ + h_t &= tanh&(W_{hh} h_{t-1} + W_{xh} x_t + b_h), \\ + o_t &= tanh&(W_{ho} h_t + b_o), + @f} + + @param Wxh is @f$ W_{xh} @f$ matrix + @param bh is @f$ b_{h} @f$ vector + @param Whh is @f$ W_{hh} @f$ matrix + @param Who is @f$ W_{xo} @f$ matrix + @param bo is @f$ b_{o} @f$ vector + */ + virtual void setWeights(const Mat &Wxh, const Mat &bh, const Mat &Whh, const Mat &Who, const Mat &bo) = 0; + + /** @brief If this flag is set to true then layer will produce @f$ h_t @f$ as second output. + * @details Shape of the second output is the same as first output. + */ + virtual void setProduceHiddenOutput(bool produce = false) = 0; + + /** Accepts two inputs @f$x_t@f$ and @f$h_{t-1}@f$ and compute two outputs @f$o_t@f$ and @f$h_t@f$. + + @param input should contain packed input @f$x_t@f$. + @param output should contain output @f$o_t@f$ (and @f$h_t@f$ if setProduceHiddenOutput() is set to true). + + @p input[0] should have shape [`T`, `N`, `data_dims`] where `T` and `N` is number of timestamps and number of independent samples of @f$x_t@f$ respectively. + + @p output[0] will have shape [`T`, `N`, @f$N_o@f$], where @f$N_o@f$ is number of rows in @f$ W_{xo} @f$ matrix. + + If setProduceHiddenOutput() is set to true then @p output[1] will contain a Mat with shape [`T`, `N`, @f$N_h@f$], where @f$N_h@f$ is number of rows in @f$ W_{hh} @f$ matrix. + */ + }; + + class CV_EXPORTS BaseConvolutionLayer : public Layer + { + public: + Size kernel, stride, pad, dilation, adjustPad; + String padMode; + }; + + class CV_EXPORTS ActivationLayer; + class CV_EXPORTS BatchNormLayer; + + class CV_EXPORTS ConvolutionLayer : public BaseConvolutionLayer + { + public: + virtual bool setActivation(const Ptr& layer) = 0; + virtual bool setBatchNorm(const Ptr& layer) = 0; + + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS DeconvolutionLayer : public BaseConvolutionLayer + { + public: + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS LRNLayer : public Layer + { + public: + enum Type + { + CHANNEL_NRM, + SPATIAL_NRM + }; + int type; + + int size; + float alpha, beta, bias; + bool normBySize; + + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS PoolingLayer : public Layer + { + public: + enum Type + { + MAX, + AVE, + STOCHASTIC + }; + + int type; + Size kernel, stride, pad; + bool globalPooling; + bool computeMaxIdx; + String padMode; + + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS SoftmaxLayer : public Layer + { + public: + bool logSoftMax; + + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS InnerProductLayer : public Layer + { + public: + int axis; + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS MVNLayer : public Layer + { + public: + float eps; + bool normVariance, acrossChannels; + + static Ptr create(const LayerParams& params); + }; + + /* Reshaping */ + + class CV_EXPORTS ReshapeLayer : public Layer + { + public: + MatShape newShapeDesc; + Range newShapeRange; + + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS FlattenLayer : public Layer + { + public: + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS ConcatLayer : public Layer + { + public: + int axis; + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS SplitLayer : public Layer + { + public: + int outputsCount; //!< Number of copies that will be produced (is ignored when negative). + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS SliceLayer : public Layer + { + public: + int axis; + std::vector sliceIndices; + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS PermuteLayer : public Layer + { + public: + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS PaddingLayer : public Layer + { + public: + static Ptr create(const LayerParams& params); + }; + + /* Activations */ + class CV_EXPORTS ActivationLayer : public Layer + { + public: + virtual void forwardSlice(const float* src, float* dst, int len, + size_t outPlaneSize, int cn0, int cn1) const = 0; + }; + + class CV_EXPORTS ReLULayer : public ActivationLayer + { + public: + float negativeSlope; + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS ChannelsPReLULayer : public ActivationLayer + { + public: + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS TanHLayer : public ActivationLayer + { + public: + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS SigmoidLayer : public ActivationLayer + { + public: + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS BNLLLayer : public ActivationLayer + { + public: + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS AbsLayer : public ActivationLayer + { + public: + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS PowerLayer : public ActivationLayer + { + public: + float power, scale, shift; + + static Ptr create(const LayerParams ¶ms); + }; + + /* Layers used in semantic segmentation */ + + class CV_EXPORTS CropLayer : public Layer + { + public: + int startAxis; + std::vector offset; + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS EltwiseLayer : public Layer + { + public: + enum EltwiseOp + { + PROD = 0, + SUM = 1, + MAX = 2, + }; + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS BatchNormLayer : public Layer + { + public: + bool hasWeights, hasBias; + float epsilon; + + virtual void getScaleShift(Mat& scale, Mat& shift) const = 0; + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS MaxUnpoolLayer : public Layer + { + public: + Size poolKernel; + Size poolPad; + Size poolStride; + + static Ptr create(const LayerParams ¶ms); + }; + + class CV_EXPORTS ScaleLayer : public Layer + { + public: + bool hasBias; + + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS ShiftLayer : public Layer + { + public: + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS PriorBoxLayer : public Layer + { + public: + static Ptr create(const LayerParams& params); + }; + + class CV_EXPORTS DetectionOutputLayer : public Layer + { + public: + static Ptr create(const LayerParams& params); + }; + + class NormalizeBBoxLayer : public Layer + { + public: + static Ptr create(const LayerParams& params); + }; + +//! @} +//! @} + +} +} +#endif diff --git a/modules/dnn/include/opencv2/dnn/dict.hpp b/modules/dnn/include/opencv2/dnn/dict.hpp new file mode 100644 index 0000000000..1096cc0ff2 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn/dict.hpp @@ -0,0 +1,146 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_DNN_DICT_HPP__ +#define __OPENCV_DNN_DNN_DICT_HPP__ + +#include +#include +#include + +namespace cv +{ +namespace dnn +{ +//! @addtogroup dnn +//! @{ + +/** @brief This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64. + * @todo Maybe int64 is useless because double type exactly stores at least 2^52 integers. + */ +struct DictValue +{ + DictValue(const DictValue &r); + DictValue(int64 i = 0) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = i; } //!< Constructs integer scalar + DictValue(int i) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = i; } //!< Constructs integer scalar + DictValue(unsigned p) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = p; } //!< Constructs integer scalar + DictValue(double p) : type(Param::REAL), pd(new AutoBuffer) { (*pd)[0] = p; } //!< Constructs floating point scalar + DictValue(const String &s) : type(Param::STRING), ps(new AutoBuffer) { (*ps)[0] = s; } //!< Constructs string scalar + DictValue(const char *s) : type(Param::STRING), ps(new AutoBuffer) { (*ps)[0] = s; } //!< @overload + + template + static DictValue arrayInt(TypeIter begin, int size); //!< Constructs integer array + template + static DictValue arrayReal(TypeIter begin, int size); //!< Constructs floating point array + template + static DictValue arrayString(TypeIter begin, int size); //!< Constructs array of strings + + template + T get(int idx = -1) const; //!< Tries to convert array element with specified index to requested type and returns its. + + int size() const; + + bool isInt() const; + bool isString() const; + bool isReal() const; + + DictValue &operator=(const DictValue &r); + + friend std::ostream &operator<<(std::ostream &stream, const DictValue &dictv); + + ~DictValue(); + +private: + + int type; + + union + { + AutoBuffer *pi; + AutoBuffer *pd; + AutoBuffer *ps; + void *pv; + }; + + DictValue(int _type, void *_p) : type(_type), pv(_p) {} + void release(); +}; + +/** @brief This class implements name-value dictionary, values are instances of DictValue. */ +class CV_EXPORTS Dict +{ + typedef std::map _Dict; + _Dict dict; + +public: + + //! Checks a presence of the @p key in the dictionary. + bool has(const String &key) const; + + //! If the @p key in the dictionary then returns pointer to its value, else returns NULL. + DictValue *ptr(const String &key); + + /** @overload */ + const DictValue *ptr(const String &key) const; + + //! If the @p key in the dictionary then returns its value, else an error will be generated. + const DictValue &get(const String &key) const; + + /** @overload */ + template + T get(const String &key) const; + + //! If the @p key in the dictionary then returns its value, else returns @p defaultValue. + template + T get(const String &key, const T &defaultValue) const; + + //! Sets new @p value for the @p key, or adds new key-value pair into the dictionary. + template + const T &set(const String &key, const T &value); + + friend std::ostream &operator<<(std::ostream &stream, const Dict &dict); +}; + +//! @} +} +} + +#endif diff --git a/modules/dnn/include/opencv2/dnn/dnn.hpp b/modules/dnn/include/opencv2/dnn/dnn.hpp new file mode 100644 index 0000000000..7a85da78c2 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn/dnn.hpp @@ -0,0 +1,655 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_DNN_HPP__ +#define __OPENCV_DNN_DNN_HPP__ + +#include +#include +#include + +namespace cv +{ +namespace dnn //! This namespace is used for dnn module functionlaity. +{ +//! @addtogroup dnn +//! @{ + + typedef std::vector MatShape; + + /** + * @brief Enum of computation backends supported by layers. + */ + enum Backend + { + DNN_BACKEND_DEFAULT, + DNN_BACKEND_HALIDE + }; + + /** + * @brief Enum of target devices for computations. + */ + enum Target + { + DNN_TARGET_CPU, + DNN_TARGET_OPENCL + }; + + /** @brief Initialize dnn module and built-in layers. + * + * This function automatically called on most of OpenCV builds, + * but you need to call it manually on some specific configurations (iOS for example). + */ + CV_EXPORTS_W void initModule(); + + /** @brief This class provides all data needed to initialize layer. + * + * It includes dictionary with scalar params (which can be readed by using Dict interface), + * blob params #blobs and optional meta information: #name and #type of layer instance. + */ + class CV_EXPORTS LayerParams : public Dict + { + public: + //TODO: Add ability to name blob params + std::vector blobs; //!< List of learned parameters stored as blobs. + + String name; //!< Name of the layer instance (optional, can be used internal purposes). + String type; //!< Type name which was used for creating layer by layer factory (optional). + }; + + /** + * @brief Derivatives of this class encapsulates functions of certain backends. + */ + class BackendNode + { + public: + BackendNode(int backendId); + + virtual ~BackendNode(); //!< Virtual destructor to make polymorphism. + + int backendId; //!< Backend identifier. + }; + + /** + * @brief Derivatives of this class wraps cv::Mat for different backends and targets. + */ + class BackendWrapper + { + public: + BackendWrapper(int backendId, int targetId); + + /** + * @brief Wrap cv::Mat for specific backend and target. + * @param[in] targetId Target identifier. + * @param[in] m cv::Mat for wrapping. + * + * Make CPU->GPU data transfer if it's require for the target. + */ + BackendWrapper(int targetId, const cv::Mat& m); + + /** + * @brief Make wrapper for reused cv::Mat. + * @param[in] base Wrapper of cv::Mat that will be reused. + * @param[in] shape Specific shape. + * + * Initialize wrapper from another one. It'll wrap the same host CPU + * memory and mustn't allocate memory on device(i.e. GPU). It might + * has different shape. Use in case of CPU memory reusing for reuse + * associented memory on device too. + */ + BackendWrapper(const Ptr& base, const MatShape& shape); + + virtual ~BackendWrapper(); //!< Virtual destructor to make polymorphism. + + /** + * @brief Transfer data to CPU host memory. + */ + virtual void copyToHost() = 0; + + int backendId; //!< Backend identifier. + int targetId; //!< Target identifier. + }; + + /** @brief This interface class allows to build new Layers - are building blocks of networks. + * + * Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs. + * Also before using the new layer into networks you must register your layer by using one of @ref dnnLayerFactory "LayerFactory" macros. + */ + class CV_EXPORTS_W Layer + { + public: + + //! List of learned parameters must be stored here to allow read them by using Net::getParam(). + CV_PROP_RW std::vector blobs; + + /** @brief Computes and sets internal parameters according to inputs, outputs and blobs. + * @param[in] input vector of already allocated input blobs + * @param[out] output vector of already allocated output blobs + * + * If this method is called after network has allocated all memory for input and output blobs + * and before inferencing. + */ + virtual void finalize(const std::vector &input, std::vector &output); + + /** @brief Given the @p input blobs, computes the output @p blobs. + * @param[in] input the input blobs. + * @param[out] output allocated output blobs, which will store results of the computation. + * @param[out] internals allocated internal blobs + */ + virtual void forward(std::vector &input, std::vector &output, std::vector &internals) = 0; + + /** @brief @overload */ + CV_WRAP void finalize(const std::vector &inputs, CV_OUT std::vector &outputs); + + /** @brief @overload */ + CV_WRAP std::vector finalize(const std::vector &inputs); + + /** @brief @overload */ + CV_WRAP void forward(const std::vector &inputs, CV_IN_OUT std::vector &outputs, + CV_IN_OUT std::vector &internals); + + /** @brief Allocates layer and computes output. */ + CV_WRAP void run(const std::vector &inputs, CV_OUT std::vector &outputs, + CV_IN_OUT std::vector &internals); + + /** @brief Returns index of input blob into the input array. + * @param inputName label of input blob + * + * Each layer input and output can be labeled to easily identify them using "%[.output_name]" notation. + * This method maps label of input blob to its index into input vector. + */ + virtual int inputNameToIndex(String inputName); + /** @brief Returns index of output blob in output array. + * @see inputNameToIndex() + */ + virtual int outputNameToIndex(String outputName); + + /** + * @brief Ask layer if it support specific backend for doing computations. + * @param[in] backendId computation backend identifier. + * @see Backend + */ + virtual bool supportBackend(int backendId); + + /** + * @brief Returns Halide backend node. + * @param[in] inputs Input Halide buffers. + * @see BackendNode, BackendWrapper + * + * Input buffers should be exactly the same that will be used in forward invocations. + * Despite we can use Halide::ImageParam based on input shape only, + * it helps prevent some memory management issues (if something wrong, + * Halide tests will be failed). + */ + virtual Ptr initHalide(const std::vector > &inputs); + + /** + * @brief Automatic Halide scheduling based on layer hyper-parameters. + * @param[in] node Backend node with Halide functions. + * @param[in] inputs Blobs that will be used in forward invocations. + * @param[in] outputs Blobs that will be used in forward invocations. + * @param[in] targetId Target identifier + * @see BackendNode, Target + * + * Layer don't use own Halide::Func members because we can have applied + * layers fusing. In this way the fused function should be scheduled. + */ + virtual void applyHalideScheduler(Ptr& node, + const std::vector &inputs, + const std::vector &outputs, + int targetId) const; + + /** + * @brief Implement layers fusing. + * @param[in] node Backend node of bottom layer. + * @see BackendNode + * + * Actual for graph-based backends. If layer attached successfully, + * returns non-empty cv::Ptr to node of the same backend. + * Fuse only over the last function. + */ + virtual Ptr tryAttach(const Ptr& node); + + virtual bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const; + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const {(void)inputs; (void)outputs; return 0;} + + CV_PROP String name; //!< Name of the layer instance, can be used for logging or other internal purposes. + CV_PROP String type; //!< Type name which was used for creating layer by layer factory. + + Layer(); + explicit Layer(const LayerParams ¶ms); //!< Initializes only #name, #type and #blobs fields. + void setParamsFrom(const LayerParams ¶ms); //!< Initializes only #name, #type and #blobs fields. + virtual ~Layer(); + }; + + /** @brief This class allows to create and manipulate comprehensive artificial neural networks. + * + * Neural network is presented as directed acyclic graph (DAG), where vertices are Layer instances, + * and edges specify relationships between layers inputs and outputs. + * + * Each network layer has unique integer id and unique string name inside its network. + * LayerId can store either layer name or layer id. + * + * This class supports reference counting of its instances, i. e. copies point to the same instance. + */ + class CV_EXPORTS_W_SIMPLE Net + { + public: + + CV_WRAP Net(); //!< Default constructor. + CV_WRAP ~Net(); //!< Destructor frees the net only if there aren't references to the net anymore. + + /** Returns true if there are no layers in the network. */ + CV_WRAP bool empty() const; + + /** @brief Adds new layer to the net. + * @param name unique name of the adding layer. + * @param type typename of the adding layer (type must be registered in LayerRegister). + * @param params parameters which will be used to initialize the creating layer. + * @returns unique identifier of created layer, or -1 if a failure will happen. + */ + int addLayer(const String &name, const String &type, LayerParams ¶ms); + /** @brief Adds new layer and connects its first input to the first output of previously added layer. + * @see addLayer() + */ + int addLayerToPrev(const String &name, const String &type, LayerParams ¶ms); + + /** @brief Converts string name of the layer to the integer identifier. + * @returns id of the layer, or -1 if the layer wasn't found. + */ + CV_WRAP int getLayerId(const String &layer); + + CV_WRAP std::vector getLayerNames() const; + + /** @brief Container for strings and integers. */ + typedef DictValue LayerId; + + /** @brief Returns pointer to layer with specified name which the network use. */ + CV_WRAP Ptr getLayer(LayerId layerId); + + /** @brief Returns pointers to input layers of specific layer. */ + CV_WRAP std::vector > getLayerInputs(LayerId layerId); + + /** @brief Delete layer for the network (not implemented yet) */ + CV_WRAP void deleteLayer(LayerId layer); + + /** @brief Connects output of the first layer to input of the second layer. + * @param outPin descriptor of the first layer output. + * @param inpPin descriptor of the second layer input. + * + * Descriptors have the following template <layer_name>[.input_number]: + * - the first part of the template layer_name is sting name of the added layer. + * If this part is empty then the network input pseudo layer will be used; + * - the second optional part of the template input_number + * is either number of the layer input, either label one. + * If this part is omitted then the first layer input will be used. + * + * @see setNetInputs(), Layer::inputNameToIndex(), Layer::outputNameToIndex() + */ + CV_WRAP void connect(String outPin, String inpPin); + + /** @brief Connects #@p outNum output of the first layer to #@p inNum input of the second layer. + * @param outLayerId identifier of the first layer + * @param inpLayerId identifier of the second layer + * @param outNum number of the first layer output + * @param inpNum number of the second layer input + */ + void connect(int outLayerId, int outNum, int inpLayerId, int inpNum); + + /** @brief Sets outputs names of the network input pseudo layer. + * + * Each net always has special own the network input pseudo layer with id=0. + * This layer stores the user blobs only and don't make any computations. + * In fact, this layer provides the only way to pass user data into the network. + * As any other layer, this layer can label its outputs and this function provides an easy way to do this. + */ + CV_WRAP void setInputsNames(const std::vector &inputBlobNames); + + /** @brief Runs forward pass to compute output of layer with name @p outputName. + * @param outputName name for layer which output is needed to get + * @return blob for first output of specified layer. + * @details By default runs forward pass for the whole network. + */ + CV_WRAP Mat forward(const String& outputName = String()); + + /** @brief Runs forward pass to compute output of layer with name @p outputName. + * @param outputBlobs contains all output blobs for specified layer. + * @param outputName name for layer which output is needed to get + * @details If @p outputName is empty, runs forward pass for the whole network. + */ + CV_WRAP void forward(std::vector& outputBlobs, const String& outputName = String()); + + /** @brief Runs forward pass to compute outputs of layers listed in @p outBlobNames. + * @param outputBlobs contains blobs for first outputs of specified layers. + * @param outBlobNames names for layers which outputs are needed to get + */ + CV_WRAP void forward(std::vector& outputBlobs, + const std::vector& outBlobNames); + + /** @brief Runs forward pass to compute outputs of layers listed in @p outBlobNames. + * @param outputBlobs contains all output blobs for each layer specified in @p outBlobNames. + * @param outBlobNames names for layers which outputs are needed to get + */ + CV_WRAP void forward(std::vector >& outputBlobs, + const std::vector& outBlobNames); + + //TODO: + /** @brief Optimized forward. + * @warning Not implemented yet. + * @details Makes forward only those layers which weren't changed after previous forward(). + */ + void forwardOpt(LayerId toLayer); + /** @overload */ + void forwardOpt(const std::vector &toLayers); + + /** + * @brief Compile Halide layers. + * @param[in] scheduler Path to YAML file with scheduling directives. + * @see setPreferableBackend + * + * Schedule layers that support Halide backend. Then compile them for + * specific target. For layers that not represented in scheduling file + * or if no manual scheduling used at all, automatic scheduling will be applied. + */ + void setHalideScheduler(const String& scheduler); + + /** + * @brief Ask network to use specific computation backend where it supported. + * @param[in] backendId backend identifier. + * @see Backend + */ + void setPreferableBackend(int backendId); + + /** + * @brief Ask network to make computations on specific target device. + * @param[in] targetId target identifier. + * @see Target + */ + void setPreferableTarget(int targetId); + + /** @brief Sets the new value for the layer output blob + * @param name descriptor of the updating layer output blob. + * @param blob new blob. + * @see connect(String, String) to know format of the descriptor. + * @note If updating blob is not empty then @p blob must have the same shape, + * because network reshaping is not implemented yet. + */ + CV_WRAP void setInput(const Mat &blob, const String& name = ""); + + /** @brief Sets the new value for the learned param of the layer. + * @param layer name or id of the layer. + * @param numParam index of the layer parameter in the Layer::blobs array. + * @param blob the new value. + * @see Layer::blobs + * @note If shape of the new blob differs from the previous shape, + * then the following forward pass may fail. + */ + CV_WRAP void setParam(LayerId layer, int numParam, const Mat &blob); + + /** @brief Returns parameter blob of the layer. + * @param layer name or id of the layer. + * @param numParam index of the layer parameter in the Layer::blobs array. + * @see Layer::blobs + */ + CV_WRAP Mat getParam(LayerId layer, int numParam = 0); + + /** @brief Returns indexes of layers with unconnected outputs. + */ + CV_WRAP std::vector getUnconnectedOutLayers() const; + /** @brief Returns input and output shapes for all layers in loaded model; + * preliminary inferencing isn't necessary. + * @param netInputShapes shapes for all input blobs in net input layer. + * @param layersIds output parameter for layer IDs. + * @param inLayersShapes output parameter for input layers shapes; + * order is the same as in layersIds + * @param outLayersShapes output parameter for output layers shapes; + * order is the same as in layersIds + */ + CV_WRAP void getLayersShapes(const std::vector& netInputShapes, + std::vector* layersIds, + std::vector >* inLayersShapes, + std::vector >* outLayersShapes) const; + + /** @overload */ + CV_WRAP void getLayersShapes(const MatShape& netInputShape, + std::vector* layersIds, + std::vector >* inLayersShapes, + std::vector >* outLayersShapes) const; + + /** @brief Returns input and output shapes for layer with specified + * id in loaded model; preliminary inferencing isn't necessary. + * @param netInputShape shape input blob in net input layer. + * @param layerId id for layer. + * @param inLayerShapes output parameter for input layers shapes; + * order is the same as in layersIds + * @param outLayerShapes output parameter for output layers shapes; + * order is the same as in layersIds + */ + CV_WRAP void getLayerShapes(const MatShape& netInputShape, + const int layerId, + std::vector* inLayerShapes, + std::vector* outLayerShapes) const; + + /** @overload */ + CV_WRAP void getLayerShapes(const std::vector& netInputShapes, + const int layerId, + std::vector* inLayerShapes, + std::vector* outLayerShapes) const; + /** @brief Computes FLOP for whole loaded model with specified input shapes. + * @param netInputShapes vector of shapes for all net inputs. + * @returns computed FLOP. + */ + CV_WRAP int64 getFLOPS(const std::vector& netInputShapes) const; + /** @overload */ + CV_WRAP int64 getFLOPS(const MatShape& netInputShape) const; + /** @overload */ + CV_WRAP int64 getFLOPS(const int layerId, + const std::vector& netInputShapes) const; + /** @overload */ + CV_WRAP int64 getFLOPS(const int layerId, + const MatShape& netInputShape) const; + + /** @brief Returns list of types for layer used in model. + * @param layersTypes output parameter for returning types. + */ + CV_WRAP void getLayerTypes(std::vector& layersTypes) const; + + /** @brief Returns count of layers of specified type. + * @param layerType type. + * @returns count of layers + */ + CV_WRAP int getLayersCount(const String& layerType) const; + + /** @brief Computes bytes number which are requered to store + * all weights and intermediate blobs for model. + * @param netInputShapes vector of shapes for all net inputs. + * @param weights output parameter to store resulting bytes for weights. + * @param blobs output parameter to store resulting bytes for intermediate blobs. + */ + CV_WRAP void getMemoryConsumption(const std::vector& netInputShapes, + size_t& weights, size_t& blobs) const; + /** @overload */ + CV_WRAP void getMemoryConsumption(const MatShape& netInputShape, + size_t& weights, size_t& blobs) const; + /** @overload */ + CV_WRAP void getMemoryConsumption(const int layerId, + const std::vector& netInputShapes, + size_t& weights, size_t& blobs) const; + /** @overload */ + CV_WRAP void getMemoryConsumption(const int layerId, + const MatShape& netInputShape, + size_t& weights, size_t& blobs) const; + + /** @brief Computes bytes number which are requered to store + * all weights and intermediate blobs for each layer. + * @param netInputShapes vector of shapes for all net inputs. + * @param layerIds output vector to save layer IDs. + * @param weights output parameter to store resulting bytes for weights. + * @param blobs output parameter to store resulting bytes for intermediate blobs. + */ + CV_WRAP void getMemoryConsumption(const std::vector& netInputShapes, + std::vector& layerIds, std::vector& weights, + std::vector& blobs) const; + /** @overload */ + CV_WRAP void getMemoryConsumption(const MatShape& netInputShape, + std::vector& layerIds, std::vector& weights, + std::vector& blobs) const; + private: + + struct Impl; + Ptr impl; + }; + + /** @brief Small interface class for loading trained serialized models of different dnn-frameworks. */ + class CV_EXPORTS_W Importer + { + public: + + /** @brief Adds loaded layers into the @p net and sets connections between them. */ + CV_WRAP virtual void populateNet(Net net) = 0; + + virtual ~Importer(); + }; + + /** @brief Creates the importer of Caffe framework network. + * @param prototxt path to the .prototxt file with text description of the network architecture. + * @param caffeModel path to the .caffemodel file with learned network. + * @returns Pointer to the created importer, NULL in failure cases. + */ + CV_EXPORTS_W Ptr createCaffeImporter(const String &prototxt, const String &caffeModel = String()); + + /** @brief Reads a network model stored in Caffe model files. + * @details This is shortcut consisting from createCaffeImporter and Net::populateNet calls. + */ + CV_EXPORTS_W Net readNetFromCaffe(const String &prototxt, const String &caffeModel = String()); + + /** @brief Reads a network model stored in Tensorflow model file. + * @details This is shortcut consisting from createTensorflowImporter and Net::populateNet calls. + */ + CV_EXPORTS_W Net readNetFromTensorflow(const String &model); + + /** @brief Reads a network model stored in Torch model file. + * @details This is shortcut consisting from createTorchImporter and Net::populateNet calls. + */ + CV_EXPORTS_W Net readNetFromTorch(const String &model, bool isBinary = true); + + /** @brief Creates the importer of TensorFlow framework network. + * @param model path to the .pb file with binary protobuf description of the network architecture. + * @returns Pointer to the created importer, NULL in failure cases. + */ + CV_EXPORTS Ptr createTensorflowImporter(const String &model); + + /** @brief Creates the importer of Torch7 framework network. + * @param filename path to the file, dumped from Torch by using torch.save() function. + * @param isBinary specifies whether the network was serialized in ascii mode or binary. + * @returns Pointer to the created importer, NULL in failure cases. + * + * @warning Torch7 importer is experimental now, you need explicitly set CMake `opencv_dnn_BUILD_TORCH_IMPORTER` flag to compile its. + * + * @note Ascii mode of Torch serializer is more preferable, because binary mode extensively use `long` type of C language, + * which has various bit-length on different systems. + * + * The loading file must contain serialized nn.Module object + * with importing network. Try to eliminate a custom objects from serialazing data to avoid importing errors. + * + * List of supported layers (i.e. object instances derived from Torch nn.Module class): + * - nn.Sequential + * - nn.Parallel + * - nn.Concat + * - nn.Linear + * - nn.SpatialConvolution + * - nn.SpatialMaxPooling, nn.SpatialAveragePooling + * - nn.ReLU, nn.TanH, nn.Sigmoid + * - nn.Reshape + * - nn.SoftMax, nn.LogSoftMax + * + * Also some equivalents of these classes from cunn, cudnn, and fbcunn may be successfully imported. + */ + CV_EXPORTS_W Ptr createTorchImporter(const String &filename, bool isBinary = true); + + /** @brief Loads blob which was serialized as torch.Tensor object of Torch7 framework. + * @warning This function has the same limitations as createTorchImporter(). + */ + CV_EXPORTS_W Mat readTorchBlob(const String &filename, bool isBinary = true); + /** @brief Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center, + * subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels. + * @param image input image (with 1- or 3-channels). + * @param size spatial size for output image + * @param mean scalar with mean values which are subtracted from channels. Values are intended + * to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true. + * @param scalefactor multiplier for @p image values. + * @param swapRB flag which indicates that swap first and last channels + * in 3-channel image is necessary. + * @details input image is resized so one side after resize is equal to corresponing + * dimension in @p size and another one is equal or larger. Then, crop from the center is performed. + * @returns 4-dimansional Mat with NCHW dimensions order. + */ + CV_EXPORTS_W Mat blobFromImage(const Mat& image, double scalefactor=1.0, const Size& size = Size(), + const Scalar& mean = Scalar(), bool swapRB=true); + /** @brief Creates 4-dimensional blob from series of images. Optionally resizes and + * crops @p images from center, subtract @p mean values, scales values by @p scalefactor, + * swap Blue and Red channels. + * @param images input images (all with 1- or 3-channels). + * @param size spatial size for output image + * @param mean scalar with mean values which are subtracted from channels. Values are intended + * to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true. + * @param scalefactor multiplier for @p images values. + * @param swapRB flag which indicates that swap first and last channels + * in 3-channel image is necessary. + * @details input image is resized so one side after resize is equal to corresponing + * dimension in @p size and another one is equal or larger. Then, crop from the center is performed. + * @returns 4-dimansional Mat with NCHW dimensions order. + */ + CV_EXPORTS_W Mat blobFromImages(const std::vector& images, double scalefactor=1.0, + Size size = Size(), const Scalar& mean = Scalar(), bool swapRB=true); + +//! @} +} +} + +#include +#include + +#endif /* __OPENCV_DNN_DNN_HPP__ */ diff --git a/modules/dnn/include/opencv2/dnn/dnn.inl.hpp b/modules/dnn/include/opencv2/dnn/dnn.inl.hpp new file mode 100644 index 0000000000..8a3c72ee98 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn/dnn.inl.hpp @@ -0,0 +1,357 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_DNN_INL_HPP__ +#define __OPENCV_DNN_DNN_INL_HPP__ + +#include + +namespace cv +{ +namespace dnn +{ + +template +DictValue DictValue::arrayInt(TypeIter begin, int size) +{ + DictValue res(Param::INT, new AutoBuffer(size)); + for (int j = 0; j < size; begin++, j++) + (*res.pi)[j] = *begin; + return res; +} + +template +DictValue DictValue::arrayReal(TypeIter begin, int size) +{ + DictValue res(Param::REAL, new AutoBuffer(size)); + for (int j = 0; j < size; begin++, j++) + (*res.pd)[j] = *begin; + return res; +} + +template +DictValue DictValue::arrayString(TypeIter begin, int size) +{ + DictValue res(Param::STRING, new AutoBuffer(size)); + for (int j = 0; j < size; begin++, j++) + (*res.ps)[j] = *begin; + return res; +} + +template<> +inline DictValue DictValue::get(int idx) const +{ + CV_Assert(idx == -1); + return *this; +} + +template<> +inline int64 DictValue::get(int idx) const +{ + CV_Assert((idx == -1 && size() == 1) || (idx >= 0 && idx < size())); + idx = (idx == -1) ? 0 : idx; + + if (type == Param::INT) + { + return (*pi)[idx]; + } + else if (type == Param::REAL) + { + double doubleValue = (*pd)[idx]; + + double fracpart, intpart; + fracpart = std::modf(doubleValue, &intpart); + CV_Assert(fracpart == 0.0); + + return (int64)doubleValue; + } + else + { + CV_Assert(isInt() || isReal()); + return 0; + } +} + +template<> +inline int DictValue::get(int idx) const +{ + return (int)get(idx); +} + +template<> +inline unsigned DictValue::get(int idx) const +{ + return (unsigned)get(idx); +} + +template<> +inline bool DictValue::get(int idx) const +{ + return (get(idx) != 0); +} + +template<> +inline double DictValue::get(int idx) const +{ + CV_Assert((idx == -1 && size() == 1) || (idx >= 0 && idx < size())); + idx = (idx == -1) ? 0 : idx; + + if (type == Param::REAL) + { + return (*pd)[idx]; + } + else if (type == Param::INT) + { + return (double)(*pi)[idx]; + } + else + { + CV_Assert(isReal() || isInt()); + return 0; + } +} + +template<> +inline float DictValue::get(int idx) const +{ + return (float)get(idx); +} + +template<> +inline String DictValue::get(int idx) const +{ + CV_Assert(isString()); + CV_Assert((idx == -1 && ps->size() == 1) || (idx >= 0 && idx < (int)ps->size())); + return (*ps)[(idx == -1) ? 0 : idx]; +} + +inline void DictValue::release() +{ + switch (type) + { + case Param::INT: + delete pi; + break; + case Param::STRING: + delete ps; + break; + case Param::REAL: + delete pd; + break; + } +} + +inline DictValue::~DictValue() +{ + release(); +} + +inline DictValue & DictValue::operator=(const DictValue &r) +{ + if (&r == this) + return *this; + + if (r.type == Param::INT) + { + AutoBuffer *tmp = new AutoBuffer(*r.pi); + release(); + pi = tmp; + } + else if (r.type == Param::STRING) + { + AutoBuffer *tmp = new AutoBuffer(*r.ps); + release(); + ps = tmp; + } + else if (r.type == Param::REAL) + { + AutoBuffer *tmp = new AutoBuffer(*r.pd); + release(); + pd = tmp; + } + + type = r.type; + + return *this; +} + +inline DictValue::DictValue(const DictValue &r) +{ + type = r.type; + + if (r.type == Param::INT) + pi = new AutoBuffer(*r.pi); + else if (r.type == Param::STRING) + ps = new AutoBuffer(*r.ps); + else if (r.type == Param::REAL) + pd = new AutoBuffer(*r.pd); +} + +inline bool DictValue::isString() const +{ + return (type == Param::STRING); +} + +inline bool DictValue::isInt() const +{ + return (type == Param::INT); +} + +inline bool DictValue::isReal() const +{ + return (type == Param::REAL || type == Param::INT); +} + +inline int DictValue::size() const +{ + switch (type) + { + case Param::INT: + return (int)pi->size(); + break; + case Param::STRING: + return (int)ps->size(); + break; + case Param::REAL: + return (int)pd->size(); + break; + default: + CV_Error(Error::StsInternal, ""); + return -1; + } +} + +inline std::ostream &operator<<(std::ostream &stream, const DictValue &dictv) +{ + int i; + + if (dictv.isInt()) + { + for (i = 0; i < dictv.size() - 1; i++) + stream << dictv.get(i) << ", "; + stream << dictv.get(i); + } + else if (dictv.isReal()) + { + for (i = 0; i < dictv.size() - 1; i++) + stream << dictv.get(i) << ", "; + stream << dictv.get(i); + } + else if (dictv.isString()) + { + for (i = 0; i < dictv.size() - 1; i++) + stream << "\"" << dictv.get(i) << "\", "; + stream << dictv.get(i); + } + + return stream; +} + +///////////////////////////////////////////////////////////////// + +inline bool Dict::has(const String &key) const +{ + return dict.count(key) != 0; +} + +inline DictValue *Dict::ptr(const String &key) +{ + _Dict::iterator i = dict.find(key); + return (i == dict.end()) ? NULL : &i->second; +} + +inline const DictValue *Dict::ptr(const String &key) const +{ + _Dict::const_iterator i = dict.find(key); + return (i == dict.end()) ? NULL : &i->second; +} + +inline const DictValue &Dict::get(const String &key) const +{ + _Dict::const_iterator i = dict.find(key); + if (i == dict.end()) + CV_Error(Error::StsObjectNotFound, "Required argument \"" + key + "\" not found into dictionary"); + return i->second; +} + +template +inline T Dict::get(const String &key) const +{ + return this->get(key).get(); +} + +template +inline T Dict::get(const String &key, const T &defaultValue) const +{ + _Dict::const_iterator i = dict.find(key); + + if (i != dict.end()) + return i->second.get(); + else + return defaultValue; +} + +template +inline const T &Dict::set(const String &key, const T &value) +{ + _Dict::iterator i = dict.find(key); + + if (i != dict.end()) + i->second = DictValue(value); + else + dict.insert(std::make_pair(key, DictValue(value))); + + return value; +} + +inline std::ostream &operator<<(std::ostream &stream, const Dict &dict) +{ + Dict::_Dict::const_iterator it; + for (it = dict.dict.begin(); it != dict.dict.end(); it++) + stream << it->first << " : " << it->second << "\n"; + + return stream; +} + +} +} + +#endif diff --git a/modules/dnn/include/opencv2/dnn/layer.hpp b/modules/dnn/include/opencv2/dnn/layer.hpp new file mode 100644 index 0000000000..af663dd3e1 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn/layer.hpp @@ -0,0 +1,148 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_LAYER_HPP__ +#define __OPENCV_DNN_LAYER_HPP__ +#include + +namespace cv +{ +namespace dnn +{ +//! @addtogroup dnn +//! @{ +//! +//! @defgroup dnnLayerFactory Utilities for New Layers Registration +//! @{ + +/** @brief %Layer factory allows to create instances of registered layers. */ +class CV_EXPORTS LayerFactory +{ +public: + + //! Each Layer class must provide this function to the factory + typedef Ptr(*Constuctor)(LayerParams ¶ms); + + //! Registers the layer class with typename @p type and specified @p constructor. + static void registerLayer(const String &type, Constuctor constructor); + + //! Unregisters registered layer with specified type name. + static void unregisterLayer(const String &type); + + /** @brief Creates instance of registered layer. + * @param type type name of creating layer. + * @param params parameters which will be used for layer initialization. + */ + static Ptr createLayerInstance(const String &type, LayerParams& params); + +private: + LayerFactory(); + + struct Impl; + static Ptr impl(); +}; + +/** @brief Registers layer constructor in runtime. +* @param type string, containing type name of the layer. +* @param constuctorFunc pointer to the function of type LayerRegister::Constuctor, which creates the layer. +* @details This macros must be placed inside the function code. +*/ +#define REG_RUNTIME_LAYER_FUNC(type, constuctorFunc) \ + cv::dnn::LayerFactory::registerLayer(#type, constuctorFunc); + +/** @brief Registers layer class in runtime. + * @param type string, containing type name of the layer. + * @param class C++ class, derived from Layer. + * @details This macros must be placed inside the function code. + */ +#define REG_RUNTIME_LAYER_CLASS(type, class) \ + cv::dnn::LayerFactory::registerLayer(#type, _layerDynamicRegisterer); + +/** @brief Registers layer constructor on module load time. +* @param type string, containing type name of the layer. +* @param constuctorFunc pointer to the function of type LayerRegister::Constuctor, which creates the layer. +* @details This macros must be placed outside the function code. +*/ +#define REG_STATIC_LAYER_FUNC(type, constuctorFunc) \ +static cv::dnn::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, constuctorFunc); + +/** @brief Registers layer class on module load time. + * @param type string, containing type name of the layer. + * @param class C++ class, derived from Layer. + * @details This macros must be placed outside the function code. + */ +#define REG_STATIC_LAYER_CLASS(type, class) \ +Ptr __LayerStaticRegisterer_func_##type(LayerParams ¶ms) \ + { return Ptr(new class(params)); } \ +static _LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, __LayerStaticRegisterer_func_##type); + + +//! @} +//! @} + + +template +Ptr _layerDynamicRegisterer(LayerParams ¶ms) +{ + return Ptr(LayerClass::create(params)); +} + +//allows automatically register created layer on module load time +class _LayerStaticRegisterer +{ + String type; +public: + + _LayerStaticRegisterer(const String &layerType, LayerFactory::Constuctor layerConstuctor) + { + this->type = layerType; + LayerFactory::registerLayer(layerType, layerConstuctor); + } + + ~_LayerStaticRegisterer() + { + LayerFactory::unregisterLayer(type); + } +}; + +} +} +#endif diff --git a/modules/dnn/include/opencv2/dnn/shape_utils.hpp b/modules/dnn/include/opencv2/dnn/shape_utils.hpp new file mode 100644 index 0000000000..7ecc8dd067 --- /dev/null +++ b/modules/dnn/include/opencv2/dnn/shape_utils.hpp @@ -0,0 +1,195 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_DNN_SHAPE_UTILS_HPP__ +#define __OPENCV_DNN_DNN_SHAPE_UTILS_HPP__ + +#include +#include +#include + +namespace cv { +namespace dnn { + +//Useful shortcut +inline std::ostream &operator<< (std::ostream &s, cv::Range &r) +{ + return s << "[" << r.start << ", " << r.end << ")"; +} + +//Slicing + +struct _Range : public cv::Range +{ + _Range(const Range &r) : cv::Range(r) {} + _Range(int start, int size = 1) : cv::Range(start, start + size) {} +}; + +static inline Mat slice(const Mat &m, const _Range &r0) +{ + Range ranges[CV_MAX_DIM]; + for (int i = 1; i < m.dims; i++) + ranges[i] = Range::all(); + ranges[0] = r0; + return m(&ranges[0]); +} + +static inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1) +{ + CV_Assert(m.dims >= 2); + Range ranges[CV_MAX_DIM]; + for (int i = 2; i < m.dims; i++) + ranges[i] = Range::all(); + ranges[0] = r0; + ranges[1] = r1; + return m(&ranges[0]); +} + +static inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2) +{ + CV_Assert(m.dims >= 3); + Range ranges[CV_MAX_DIM]; + for (int i = 3; i < m.dims; i++) + ranges[i] = Range::all(); + ranges[0] = r0; + ranges[1] = r1; + ranges[2] = r2; + return m(&ranges[0]); +} + +static inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2, const _Range &r3) +{ + CV_Assert(m.dims >= 4); + Range ranges[CV_MAX_DIM]; + for (int i = 4; i < m.dims; i++) + ranges[i] = Range::all(); + ranges[0] = r0; + ranges[1] = r1; + ranges[2] = r2; + ranges[3] = r3; + return m(&ranges[0]); +} + +static inline Mat getPlane(const Mat &m, int n, int cn) +{ + CV_Assert(m.dims > 2); + Range range[CV_MAX_DIM]; + int sz[CV_MAX_DIM]; + for(int i = 2; i < m.dims; i++) + { + sz[i-2] = m.size.p[i]; + range[i] = Range::all(); + } + range[0] = Range(n, n+1); + range[1] = Range(cn, cn+1); + return m(range).reshape(1, m.dims-2, sz); +} + +static inline MatShape shape(const int* dims, const int n = 4) +{ + MatShape shape; + shape.assign(dims, dims + n); + return shape; +} + +static inline MatShape shape(const Mat& mat) +{ + return shape(mat.size.p, mat.dims); +} + +namespace {inline bool is_neg(int i) { return i < 0; }} + +static inline MatShape shape(int a0, int a1=-1, int a2=-1, int a3=-1) +{ + int dims[] = {a0, a1, a2, a3}; + MatShape s = shape(dims); + s.erase(std::remove_if(s.begin(), s.end(), is_neg), s.end()); + return s; +} + +static inline int total(const MatShape& shape, int start = -1, int end = -1) +{ + if (start == -1) start = 0; + if (end == -1) end = shape.size(); + + if (shape.empty()) + return 0; + + int elems = 1; + CV_Assert(start < shape.size() && end <= shape.size() && + start <= end); + for(int i = start; i < end; i++) + { + elems *= shape[i]; + } + return elems; +} + +static inline MatShape concat(const MatShape& a, const MatShape& b) +{ + MatShape c = a; + c.insert(c.end(), b.begin(), b.end()); + + return c; +} + +inline void print(const MatShape& shape, const String& name = "") +{ + printf("%s: [", name.c_str()); + size_t i, n = shape.size(); + for( i = 0; i < n; i++ ) + printf(" %d", shape[i]); + printf(" ]\n"); +} + +inline int clamp(int ax, int dims) +{ + return ax < 0 ? ax + dims : ax; +} + +inline int clamp(int ax, const MatShape& shape) +{ + return clamp(ax, shape.size()); +} + +} +} +#endif diff --git a/modules/dnn/misc/caffe/caffe.pb.cc b/modules/dnn/misc/caffe/caffe.pb.cc new file mode 100644 index 0000000000..f866183110 --- /dev/null +++ b/modules/dnn/misc/caffe/caffe.pb.cc @@ -0,0 +1,53676 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: caffe.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "caffe.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace caffe { + +namespace { + +const ::google::protobuf::Descriptor* BlobShape_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BlobShape_reflection_ = NULL; +const ::google::protobuf::Descriptor* BlobProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BlobProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* BlobProtoVector_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BlobProtoVector_reflection_ = NULL; +const ::google::protobuf::Descriptor* PermuteParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PermuteParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* NormalizeBBoxParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NormalizeBBoxParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* PriorBoxParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PriorBoxParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* PriorBoxParameter_CodeType_descriptor_ = NULL; +const ::google::protobuf::Descriptor* DetectionOutputParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DetectionOutputParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* Datum_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Datum_reflection_ = NULL; +const ::google::protobuf::Descriptor* FillerParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FillerParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* FillerParameter_VarianceNorm_descriptor_ = NULL; +const ::google::protobuf::Descriptor* NetParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NetParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* SolverParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SolverParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* SolverParameter_SolverMode_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* SolverParameter_SolverType_descriptor_ = NULL; +const ::google::protobuf::Descriptor* SolverState_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SolverState_reflection_ = NULL; +const ::google::protobuf::Descriptor* NetState_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NetState_reflection_ = NULL; +const ::google::protobuf::Descriptor* NetStateRule_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NetStateRule_reflection_ = NULL; +const ::google::protobuf::Descriptor* ParamSpec_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ParamSpec_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* ParamSpec_DimCheckMode_descriptor_ = NULL; +const ::google::protobuf::Descriptor* LayerParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LayerParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* TransformationParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TransformationParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* LossParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LossParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* LossParameter_NormalizationMode_descriptor_ = NULL; +const ::google::protobuf::Descriptor* AccuracyParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + AccuracyParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ArgMaxParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ArgMaxParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ConcatParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ConcatParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* BatchNormParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BatchNormParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* BiasParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BiasParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ContrastiveLossParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ContrastiveLossParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ConvolutionParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ConvolutionParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* ConvolutionParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* CropParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + CropParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* DataParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DataParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* DataParameter_DB_descriptor_ = NULL; +const ::google::protobuf::Descriptor* NonMaximumSuppressionParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NonMaximumSuppressionParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* SaveOutputParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SaveOutputParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* DropoutParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DropoutParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* DummyDataParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DummyDataParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* EltwiseParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EltwiseParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor_ = NULL; +const ::google::protobuf::Descriptor* ELUParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ELUParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* EmbedParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EmbedParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ExpParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ExpParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* FlattenParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FlattenParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* HDF5DataParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + HDF5DataParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* HDF5OutputParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + HDF5OutputParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* HingeLossParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + HingeLossParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* HingeLossParameter_Norm_descriptor_ = NULL; +const ::google::protobuf::Descriptor* ImageDataParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ImageDataParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* InfogainLossParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + InfogainLossParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* InnerProductParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + InnerProductParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* InputParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + InputParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* LogParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LogParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* LRNParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LRNParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* LRNParameter_NormRegion_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* LRNParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* MemoryDataParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MemoryDataParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* MVNParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MVNParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ParameterParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ParameterParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* PoolingParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PoolingParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* PoolingParameter_PoolMethod_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* PoolingParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* PowerParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PowerParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* PythonParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PythonParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* RecurrentParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + RecurrentParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ReductionParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ReductionParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* ReductionParameter_ReductionOp_descriptor_ = NULL; +const ::google::protobuf::Descriptor* ReLUParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ReLUParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* ReLUParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* ReshapeParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ReshapeParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ScaleParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ScaleParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* SigmoidParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SigmoidParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* SigmoidParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* SliceParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SliceParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* SoftmaxParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SoftmaxParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* SoftmaxParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* TanHParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TanHParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* TanHParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* TileParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TileParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* ThresholdParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ThresholdParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* WindowDataParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + WindowDataParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* SPPParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SPPParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* SPPParameter_PoolMethod_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* SPPParameter_Engine_descriptor_ = NULL; +const ::google::protobuf::Descriptor* V1LayerParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + V1LayerParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* V1LayerParameter_LayerType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor_ = NULL; +const ::google::protobuf::Descriptor* V0LayerParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + V0LayerParameter_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor_ = NULL; +const ::google::protobuf::Descriptor* PReLUParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PReLUParameter_reflection_ = NULL; +const ::google::protobuf::Descriptor* NormalizedBBox_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NormalizedBBox_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* Phase_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_caffe_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_caffe_2eproto() { + protobuf_AddDesc_caffe_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "caffe.proto"); + GOOGLE_CHECK(file != NULL); + BlobShape_descriptor_ = file->message_type(0); + static const int BlobShape_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, dim_), + }; + BlobShape_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + BlobShape_descriptor_, + BlobShape::internal_default_instance(), + BlobShape_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, _has_bits_), + -1, + -1, + sizeof(BlobShape), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, _internal_metadata_)); + BlobProto_descriptor_ = file->message_type(1); + static const int BlobProto_offsets_[9] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, diff_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, double_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, double_diff_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, width_), + }; + BlobProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + BlobProto_descriptor_, + BlobProto::internal_default_instance(), + BlobProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _has_bits_), + -1, + -1, + sizeof(BlobProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _internal_metadata_)); + BlobProtoVector_descriptor_ = file->message_type(2); + static const int BlobProtoVector_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, blobs_), + }; + BlobProtoVector_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + BlobProtoVector_descriptor_, + BlobProtoVector::internal_default_instance(), + BlobProtoVector_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, _has_bits_), + -1, + -1, + sizeof(BlobProtoVector), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, _internal_metadata_)); + PermuteParameter_descriptor_ = file->message_type(3); + static const int PermuteParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PermuteParameter, order_), + }; + PermuteParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PermuteParameter_descriptor_, + PermuteParameter::internal_default_instance(), + PermuteParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PermuteParameter, _has_bits_), + -1, + -1, + sizeof(PermuteParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PermuteParameter, _internal_metadata_)); + NormalizeBBoxParameter_descriptor_ = file->message_type(4); + static const int NormalizeBBoxParameter_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizeBBoxParameter, across_spatial_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizeBBoxParameter, scale_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizeBBoxParameter, channel_shared_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizeBBoxParameter, eps_), + }; + NormalizeBBoxParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NormalizeBBoxParameter_descriptor_, + NormalizeBBoxParameter::internal_default_instance(), + NormalizeBBoxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizeBBoxParameter, _has_bits_), + -1, + -1, + sizeof(NormalizeBBoxParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizeBBoxParameter, _internal_metadata_)); + PriorBoxParameter_descriptor_ = file->message_type(5); + static const int PriorBoxParameter_offsets_[13] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, min_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, max_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, aspect_ratio_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, flip_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, clip_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, variance_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, img_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, img_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, img_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, step_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, step_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, step_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, offset_), + }; + PriorBoxParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PriorBoxParameter_descriptor_, + PriorBoxParameter::internal_default_instance(), + PriorBoxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, _has_bits_), + -1, + -1, + sizeof(PriorBoxParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PriorBoxParameter, _internal_metadata_)); + PriorBoxParameter_CodeType_descriptor_ = PriorBoxParameter_descriptor_->enum_type(0); + DetectionOutputParameter_descriptor_ = file->message_type(6); + static const int DetectionOutputParameter_offsets_[9] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, num_classes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, share_location_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, background_label_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, nms_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, save_output_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, code_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, variance_encoded_in_target_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, keep_top_k_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, confidence_threshold_), + }; + DetectionOutputParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DetectionOutputParameter_descriptor_, + DetectionOutputParameter::internal_default_instance(), + DetectionOutputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, _has_bits_), + -1, + -1, + sizeof(DetectionOutputParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DetectionOutputParameter, _internal_metadata_)); + Datum_descriptor_ = file->message_type(7); + static const int Datum_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, width_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, float_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, encoded_), + }; + Datum_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + Datum_descriptor_, + Datum::internal_default_instance(), + Datum_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, _has_bits_), + -1, + -1, + sizeof(Datum), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, _internal_metadata_)); + FillerParameter_descriptor_ = file->message_type(8); + static const int FillerParameter_offsets_[8] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, min_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, max_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, mean_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, std_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, sparse_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, variance_norm_), + }; + FillerParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FillerParameter_descriptor_, + FillerParameter::internal_default_instance(), + FillerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, _has_bits_), + -1, + -1, + sizeof(FillerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, _internal_metadata_)); + FillerParameter_VarianceNorm_descriptor_ = FillerParameter_descriptor_->enum_type(0); + NetParameter_descriptor_ = file->message_type(9); + static const int NetParameter_offsets_[9] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, input_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, input_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, input_dim_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, force_backward_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, debug_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, layer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, layers_), + }; + NetParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NetParameter_descriptor_, + NetParameter::internal_default_instance(), + NetParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, _has_bits_), + -1, + -1, + sizeof(NetParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, _internal_metadata_)); + SolverParameter_descriptor_ = file->message_type(10); + static const int SolverParameter_offsets_[40] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, net_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, net_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, train_net_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_net_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, train_net_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_net_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, train_state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_iter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_interval_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_compute_loss_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, test_initialization_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, base_lr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, display_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, average_loss_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, max_iter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, iter_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, lr_policy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, gamma_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, power_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, momentum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, weight_decay_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, regularization_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, stepsize_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, stepvalue_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, clip_gradients_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, snapshot_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, snapshot_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, snapshot_diff_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, snapshot_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, solver_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, device_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, random_seed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, delta_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, momentum2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, rms_decay_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, debug_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, snapshot_after_train_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, solver_type_), + }; + SolverParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SolverParameter_descriptor_, + SolverParameter::internal_default_instance(), + SolverParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, _has_bits_), + -1, + -1, + sizeof(SolverParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, _internal_metadata_)); + SolverParameter_SnapshotFormat_descriptor_ = SolverParameter_descriptor_->enum_type(0); + SolverParameter_SolverMode_descriptor_ = SolverParameter_descriptor_->enum_type(1); + SolverParameter_SolverType_descriptor_ = SolverParameter_descriptor_->enum_type(2); + SolverState_descriptor_ = file->message_type(11); + static const int SolverState_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, iter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, learned_net_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, history_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, current_step_), + }; + SolverState_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SolverState_descriptor_, + SolverState::internal_default_instance(), + SolverState_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, _has_bits_), + -1, + -1, + sizeof(SolverState), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, _internal_metadata_)); + NetState_descriptor_ = file->message_type(12); + static const int NetState_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, phase_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, stage_), + }; + NetState_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NetState_descriptor_, + NetState::internal_default_instance(), + NetState_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, _has_bits_), + -1, + -1, + sizeof(NetState), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, _internal_metadata_)); + NetStateRule_descriptor_ = file->message_type(13); + static const int NetStateRule_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, phase_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, min_level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, max_level_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, stage_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, not_stage_), + }; + NetStateRule_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NetStateRule_descriptor_, + NetStateRule::internal_default_instance(), + NetStateRule_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, _has_bits_), + -1, + -1, + sizeof(NetStateRule), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, _internal_metadata_)); + ParamSpec_descriptor_ = file->message_type(14); + static const int ParamSpec_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, share_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, lr_mult_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, decay_mult_), + }; + ParamSpec_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ParamSpec_descriptor_, + ParamSpec::internal_default_instance(), + ParamSpec_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, _has_bits_), + -1, + -1, + sizeof(ParamSpec), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, _internal_metadata_)); + ParamSpec_DimCheckMode_descriptor_ = ParamSpec_descriptor_->enum_type(0); + LayerParameter_descriptor_ = file->message_type(15); + static const int LayerParameter_offsets_[62] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, bottom_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, top_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, phase_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, loss_weight_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, blobs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, propagate_down_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, include_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, exclude_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, transform_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, accuracy_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, argmax_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, batch_norm_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, bias_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, concat_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, contrastive_loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, convolution_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, crop_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, detection_output_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, dropout_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, dummy_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, eltwise_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, elu_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, embed_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, exp_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, flatten_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, hdf5_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, hdf5_output_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, hinge_loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, image_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, infogain_loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, inner_product_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, input_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, log_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, lrn_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, memory_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, mvn_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, norm_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, permute_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, parameter_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, pooling_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, power_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, prelu_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, prior_box_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, python_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, recurrent_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, reduction_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, relu_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, reshape_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, scale_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, sigmoid_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, softmax_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, spp_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, slice_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, tanh_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, threshold_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, tile_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, window_data_param_), + }; + LayerParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + LayerParameter_descriptor_, + LayerParameter::internal_default_instance(), + LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, _has_bits_), + -1, + -1, + sizeof(LayerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, _internal_metadata_)); + TransformationParameter_descriptor_ = file->message_type(16); + static const int TransformationParameter_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, mirror_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, crop_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, mean_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, mean_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, force_color_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, force_gray_), + }; + TransformationParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TransformationParameter_descriptor_, + TransformationParameter::internal_default_instance(), + TransformationParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, _has_bits_), + -1, + -1, + sizeof(TransformationParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, _internal_metadata_)); + LossParameter_descriptor_ = file->message_type(17); + static const int LossParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, ignore_label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, normalization_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, normalize_), + }; + LossParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + LossParameter_descriptor_, + LossParameter::internal_default_instance(), + LossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, _has_bits_), + -1, + -1, + sizeof(LossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, _internal_metadata_)); + LossParameter_NormalizationMode_descriptor_ = LossParameter_descriptor_->enum_type(0); + AccuracyParameter_descriptor_ = file->message_type(18); + static const int AccuracyParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, top_k_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, ignore_label_), + }; + AccuracyParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + AccuracyParameter_descriptor_, + AccuracyParameter::internal_default_instance(), + AccuracyParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, _has_bits_), + -1, + -1, + sizeof(AccuracyParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, _internal_metadata_)); + ArgMaxParameter_descriptor_ = file->message_type(19); + static const int ArgMaxParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, out_max_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, top_k_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, axis_), + }; + ArgMaxParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ArgMaxParameter_descriptor_, + ArgMaxParameter::internal_default_instance(), + ArgMaxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, _has_bits_), + -1, + -1, + sizeof(ArgMaxParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, _internal_metadata_)); + ConcatParameter_descriptor_ = file->message_type(20); + static const int ConcatParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, concat_dim_), + }; + ConcatParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ConcatParameter_descriptor_, + ConcatParameter::internal_default_instance(), + ConcatParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, _has_bits_), + -1, + -1, + sizeof(ConcatParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, _internal_metadata_)); + BatchNormParameter_descriptor_ = file->message_type(21); + static const int BatchNormParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, use_global_stats_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, moving_average_fraction_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, eps_), + }; + BatchNormParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + BatchNormParameter_descriptor_, + BatchNormParameter::internal_default_instance(), + BatchNormParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, _has_bits_), + -1, + -1, + sizeof(BatchNormParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, _internal_metadata_)); + BiasParameter_descriptor_ = file->message_type(22); + static const int BiasParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, num_axes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, filler_), + }; + BiasParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + BiasParameter_descriptor_, + BiasParameter::internal_default_instance(), + BiasParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, _has_bits_), + -1, + -1, + sizeof(BiasParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, _internal_metadata_)); + ContrastiveLossParameter_descriptor_ = file->message_type(23); + static const int ContrastiveLossParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, margin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, legacy_version_), + }; + ContrastiveLossParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ContrastiveLossParameter_descriptor_, + ContrastiveLossParameter::internal_default_instance(), + ContrastiveLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, _has_bits_), + -1, + -1, + sizeof(ContrastiveLossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, _internal_metadata_)); + ConvolutionParameter_descriptor_ = file->message_type(24); + static const int ConvolutionParameter_offsets_[18] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, num_output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, bias_term_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, pad_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, kernel_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, dilation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, pad_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, pad_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, kernel_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, kernel_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, stride_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, stride_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, group_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, weight_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, bias_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, engine_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, force_nd_im2col_), + }; + ConvolutionParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ConvolutionParameter_descriptor_, + ConvolutionParameter::internal_default_instance(), + ConvolutionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, _has_bits_), + -1, + -1, + sizeof(ConvolutionParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, _internal_metadata_)); + ConvolutionParameter_Engine_descriptor_ = ConvolutionParameter_descriptor_->enum_type(0); + CropParameter_descriptor_ = file->message_type(25); + static const int CropParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, offset_), + }; + CropParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + CropParameter_descriptor_, + CropParameter::internal_default_instance(), + CropParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, _has_bits_), + -1, + -1, + sizeof(CropParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, _internal_metadata_)); + DataParameter_descriptor_ = file->message_type(26); + static const int DataParameter_offsets_[10] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, batch_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, rand_skip_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, backend_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, mean_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, crop_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, mirror_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, force_encoded_color_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, prefetch_), + }; + DataParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DataParameter_descriptor_, + DataParameter::internal_default_instance(), + DataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, _has_bits_), + -1, + -1, + sizeof(DataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, _internal_metadata_)); + DataParameter_DB_descriptor_ = DataParameter_descriptor_->enum_type(0); + NonMaximumSuppressionParameter_descriptor_ = file->message_type(27); + static const int NonMaximumSuppressionParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NonMaximumSuppressionParameter, nms_threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NonMaximumSuppressionParameter, top_k_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NonMaximumSuppressionParameter, eta_), + }; + NonMaximumSuppressionParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NonMaximumSuppressionParameter_descriptor_, + NonMaximumSuppressionParameter::internal_default_instance(), + NonMaximumSuppressionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NonMaximumSuppressionParameter, _has_bits_), + -1, + -1, + sizeof(NonMaximumSuppressionParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NonMaximumSuppressionParameter, _internal_metadata_)); + SaveOutputParameter_descriptor_ = file->message_type(28); + static const int SaveOutputParameter_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, output_directory_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, output_name_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, output_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, label_map_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, name_size_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, num_test_image_), + }; + SaveOutputParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SaveOutputParameter_descriptor_, + SaveOutputParameter::internal_default_instance(), + SaveOutputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, _has_bits_), + -1, + -1, + sizeof(SaveOutputParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SaveOutputParameter, _internal_metadata_)); + DropoutParameter_descriptor_ = file->message_type(29); + static const int DropoutParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, dropout_ratio_), + }; + DropoutParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DropoutParameter_descriptor_, + DropoutParameter::internal_default_instance(), + DropoutParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, _has_bits_), + -1, + -1, + sizeof(DropoutParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, _internal_metadata_)); + DummyDataParameter_descriptor_ = file->message_type(30); + static const int DummyDataParameter_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, data_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, width_), + }; + DummyDataParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DummyDataParameter_descriptor_, + DummyDataParameter::internal_default_instance(), + DummyDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, _has_bits_), + -1, + -1, + sizeof(DummyDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, _internal_metadata_)); + EltwiseParameter_descriptor_ = file->message_type(31); + static const int EltwiseParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, operation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, coeff_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, stable_prod_grad_), + }; + EltwiseParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + EltwiseParameter_descriptor_, + EltwiseParameter::internal_default_instance(), + EltwiseParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, _has_bits_), + -1, + -1, + sizeof(EltwiseParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, _internal_metadata_)); + EltwiseParameter_EltwiseOp_descriptor_ = EltwiseParameter_descriptor_->enum_type(0); + ELUParameter_descriptor_ = file->message_type(32); + static const int ELUParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, alpha_), + }; + ELUParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ELUParameter_descriptor_, + ELUParameter::internal_default_instance(), + ELUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, _has_bits_), + -1, + -1, + sizeof(ELUParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, _internal_metadata_)); + EmbedParameter_descriptor_ = file->message_type(33); + static const int EmbedParameter_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, num_output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, input_dim_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, bias_term_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, weight_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, bias_filler_), + }; + EmbedParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + EmbedParameter_descriptor_, + EmbedParameter::internal_default_instance(), + EmbedParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, _has_bits_), + -1, + -1, + sizeof(EmbedParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, _internal_metadata_)); + ExpParameter_descriptor_ = file->message_type(34); + static const int ExpParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, base_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, shift_), + }; + ExpParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ExpParameter_descriptor_, + ExpParameter::internal_default_instance(), + ExpParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, _has_bits_), + -1, + -1, + sizeof(ExpParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, _internal_metadata_)); + FlattenParameter_descriptor_ = file->message_type(35); + static const int FlattenParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, end_axis_), + }; + FlattenParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FlattenParameter_descriptor_, + FlattenParameter::internal_default_instance(), + FlattenParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, _has_bits_), + -1, + -1, + sizeof(FlattenParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, _internal_metadata_)); + HDF5DataParameter_descriptor_ = file->message_type(36); + static const int HDF5DataParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, batch_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, shuffle_), + }; + HDF5DataParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + HDF5DataParameter_descriptor_, + HDF5DataParameter::internal_default_instance(), + HDF5DataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, _has_bits_), + -1, + -1, + sizeof(HDF5DataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, _internal_metadata_)); + HDF5OutputParameter_descriptor_ = file->message_type(37); + static const int HDF5OutputParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, file_name_), + }; + HDF5OutputParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + HDF5OutputParameter_descriptor_, + HDF5OutputParameter::internal_default_instance(), + HDF5OutputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, _has_bits_), + -1, + -1, + sizeof(HDF5OutputParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, _internal_metadata_)); + HingeLossParameter_descriptor_ = file->message_type(38); + static const int HingeLossParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, norm_), + }; + HingeLossParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + HingeLossParameter_descriptor_, + HingeLossParameter::internal_default_instance(), + HingeLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, _has_bits_), + -1, + -1, + sizeof(HingeLossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, _internal_metadata_)); + HingeLossParameter_Norm_descriptor_ = HingeLossParameter_descriptor_->enum_type(0); + ImageDataParameter_descriptor_ = file->message_type(39); + static const int ImageDataParameter_offsets_[12] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, batch_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, rand_skip_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, shuffle_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, new_height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, new_width_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, is_color_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, mean_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, crop_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, mirror_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, root_folder_), + }; + ImageDataParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ImageDataParameter_descriptor_, + ImageDataParameter::internal_default_instance(), + ImageDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, _has_bits_), + -1, + -1, + sizeof(ImageDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, _internal_metadata_)); + InfogainLossParameter_descriptor_ = file->message_type(40); + static const int InfogainLossParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, source_), + }; + InfogainLossParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + InfogainLossParameter_descriptor_, + InfogainLossParameter::internal_default_instance(), + InfogainLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, _has_bits_), + -1, + -1, + sizeof(InfogainLossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, _internal_metadata_)); + InnerProductParameter_descriptor_ = file->message_type(41); + static const int InnerProductParameter_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, num_output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, bias_term_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, weight_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, bias_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, transpose_), + }; + InnerProductParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + InnerProductParameter_descriptor_, + InnerProductParameter::internal_default_instance(), + InnerProductParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, _has_bits_), + -1, + -1, + sizeof(InnerProductParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, _internal_metadata_)); + InputParameter_descriptor_ = file->message_type(42); + static const int InputParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, shape_), + }; + InputParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + InputParameter_descriptor_, + InputParameter::internal_default_instance(), + InputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, _has_bits_), + -1, + -1, + sizeof(InputParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, _internal_metadata_)); + LogParameter_descriptor_ = file->message_type(43); + static const int LogParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, base_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, shift_), + }; + LogParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + LogParameter_descriptor_, + LogParameter::internal_default_instance(), + LogParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, _has_bits_), + -1, + -1, + sizeof(LogParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, _internal_metadata_)); + LRNParameter_descriptor_ = file->message_type(44); + static const int LRNParameter_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, local_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, alpha_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, beta_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, norm_region_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, k_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, engine_), + }; + LRNParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + LRNParameter_descriptor_, + LRNParameter::internal_default_instance(), + LRNParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, _has_bits_), + -1, + -1, + sizeof(LRNParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, _internal_metadata_)); + LRNParameter_NormRegion_descriptor_ = LRNParameter_descriptor_->enum_type(0); + LRNParameter_Engine_descriptor_ = LRNParameter_descriptor_->enum_type(1); + MemoryDataParameter_descriptor_ = file->message_type(45); + static const int MemoryDataParameter_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, batch_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, width_), + }; + MemoryDataParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + MemoryDataParameter_descriptor_, + MemoryDataParameter::internal_default_instance(), + MemoryDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, _has_bits_), + -1, + -1, + sizeof(MemoryDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, _internal_metadata_)); + MVNParameter_descriptor_ = file->message_type(46); + static const int MVNParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, normalize_variance_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, across_channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, eps_), + }; + MVNParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + MVNParameter_descriptor_, + MVNParameter::internal_default_instance(), + MVNParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, _has_bits_), + -1, + -1, + sizeof(MVNParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, _internal_metadata_)); + ParameterParameter_descriptor_ = file->message_type(47); + static const int ParameterParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, shape_), + }; + ParameterParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ParameterParameter_descriptor_, + ParameterParameter::internal_default_instance(), + ParameterParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, _has_bits_), + -1, + -1, + sizeof(ParameterParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, _internal_metadata_)); + PoolingParameter_descriptor_ = file->message_type(48); + static const int PoolingParameter_offsets_[12] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, pool_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, pad_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, pad_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, pad_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, kernel_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, kernel_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, kernel_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, stride_h_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, stride_w_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, engine_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, global_pooling_), + }; + PoolingParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PoolingParameter_descriptor_, + PoolingParameter::internal_default_instance(), + PoolingParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, _has_bits_), + -1, + -1, + sizeof(PoolingParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, _internal_metadata_)); + PoolingParameter_PoolMethod_descriptor_ = PoolingParameter_descriptor_->enum_type(0); + PoolingParameter_Engine_descriptor_ = PoolingParameter_descriptor_->enum_type(1); + PowerParameter_descriptor_ = file->message_type(49); + static const int PowerParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, power_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, shift_), + }; + PowerParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PowerParameter_descriptor_, + PowerParameter::internal_default_instance(), + PowerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, _has_bits_), + -1, + -1, + sizeof(PowerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, _internal_metadata_)); + PythonParameter_descriptor_ = file->message_type(50); + static const int PythonParameter_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, module_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, layer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, param_str_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, share_in_parallel_), + }; + PythonParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PythonParameter_descriptor_, + PythonParameter::internal_default_instance(), + PythonParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, _has_bits_), + -1, + -1, + sizeof(PythonParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, _internal_metadata_)); + RecurrentParameter_descriptor_ = file->message_type(51); + static const int RecurrentParameter_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, num_output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, weight_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, bias_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, debug_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, expose_hidden_), + }; + RecurrentParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + RecurrentParameter_descriptor_, + RecurrentParameter::internal_default_instance(), + RecurrentParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, _has_bits_), + -1, + -1, + sizeof(RecurrentParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecurrentParameter, _internal_metadata_)); + ReductionParameter_descriptor_ = file->message_type(52); + static const int ReductionParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, operation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, coeff_), + }; + ReductionParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ReductionParameter_descriptor_, + ReductionParameter::internal_default_instance(), + ReductionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, _has_bits_), + -1, + -1, + sizeof(ReductionParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, _internal_metadata_)); + ReductionParameter_ReductionOp_descriptor_ = ReductionParameter_descriptor_->enum_type(0); + ReLUParameter_descriptor_ = file->message_type(53); + static const int ReLUParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, negative_slope_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, engine_), + }; + ReLUParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ReLUParameter_descriptor_, + ReLUParameter::internal_default_instance(), + ReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, _has_bits_), + -1, + -1, + sizeof(ReLUParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, _internal_metadata_)); + ReLUParameter_Engine_descriptor_ = ReLUParameter_descriptor_->enum_type(0); + ReshapeParameter_descriptor_ = file->message_type(54); + static const int ReshapeParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, num_axes_), + }; + ReshapeParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ReshapeParameter_descriptor_, + ReshapeParameter::internal_default_instance(), + ReshapeParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, _has_bits_), + -1, + -1, + sizeof(ReshapeParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, _internal_metadata_)); + ScaleParameter_descriptor_ = file->message_type(55); + static const int ScaleParameter_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, num_axes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, bias_term_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, bias_filler_), + }; + ScaleParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ScaleParameter_descriptor_, + ScaleParameter::internal_default_instance(), + ScaleParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, _has_bits_), + -1, + -1, + sizeof(ScaleParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, _internal_metadata_)); + SigmoidParameter_descriptor_ = file->message_type(56); + static const int SigmoidParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, engine_), + }; + SigmoidParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SigmoidParameter_descriptor_, + SigmoidParameter::internal_default_instance(), + SigmoidParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, _has_bits_), + -1, + -1, + sizeof(SigmoidParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, _internal_metadata_)); + SigmoidParameter_Engine_descriptor_ = SigmoidParameter_descriptor_->enum_type(0); + SliceParameter_descriptor_ = file->message_type(57); + static const int SliceParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, slice_point_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, slice_dim_), + }; + SliceParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SliceParameter_descriptor_, + SliceParameter::internal_default_instance(), + SliceParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, _has_bits_), + -1, + -1, + sizeof(SliceParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, _internal_metadata_)); + SoftmaxParameter_descriptor_ = file->message_type(58); + static const int SoftmaxParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, engine_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, axis_), + }; + SoftmaxParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SoftmaxParameter_descriptor_, + SoftmaxParameter::internal_default_instance(), + SoftmaxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, _has_bits_), + -1, + -1, + sizeof(SoftmaxParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, _internal_metadata_)); + SoftmaxParameter_Engine_descriptor_ = SoftmaxParameter_descriptor_->enum_type(0); + TanHParameter_descriptor_ = file->message_type(59); + static const int TanHParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, engine_), + }; + TanHParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TanHParameter_descriptor_, + TanHParameter::internal_default_instance(), + TanHParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, _has_bits_), + -1, + -1, + sizeof(TanHParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, _internal_metadata_)); + TanHParameter_Engine_descriptor_ = TanHParameter_descriptor_->enum_type(0); + TileParameter_descriptor_ = file->message_type(60); + static const int TileParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, tiles_), + }; + TileParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TileParameter_descriptor_, + TileParameter::internal_default_instance(), + TileParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, _has_bits_), + -1, + -1, + sizeof(TileParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, _internal_metadata_)); + ThresholdParameter_descriptor_ = file->message_type(61); + static const int ThresholdParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, threshold_), + }; + ThresholdParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ThresholdParameter_descriptor_, + ThresholdParameter::internal_default_instance(), + ThresholdParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, _has_bits_), + -1, + -1, + sizeof(ThresholdParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, _internal_metadata_)); + WindowDataParameter_descriptor_ = file->message_type(62); + static const int WindowDataParameter_offsets_[13] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, mean_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, batch_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, crop_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, mirror_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, fg_threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, bg_threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, fg_fraction_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, context_pad_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, crop_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, cache_images_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, root_folder_), + }; + WindowDataParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + WindowDataParameter_descriptor_, + WindowDataParameter::internal_default_instance(), + WindowDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, _has_bits_), + -1, + -1, + sizeof(WindowDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, _internal_metadata_)); + SPPParameter_descriptor_ = file->message_type(63); + static const int SPPParameter_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, pyramid_height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, pool_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, engine_), + }; + SPPParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SPPParameter_descriptor_, + SPPParameter::internal_default_instance(), + SPPParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, _has_bits_), + -1, + -1, + sizeof(SPPParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, _internal_metadata_)); + SPPParameter_PoolMethod_descriptor_ = SPPParameter_descriptor_->enum_type(0); + SPPParameter_Engine_descriptor_ = SPPParameter_descriptor_->enum_type(1); + V1LayerParameter_descriptor_ = file->message_type(64); + static const int V1LayerParameter_offsets_[43] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, bottom_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, top_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, include_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, exclude_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, blobs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, blob_share_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, blobs_lr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, weight_decay_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, loss_weight_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, accuracy_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, argmax_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, concat_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, contrastive_loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, convolution_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, dropout_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, dummy_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, eltwise_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, exp_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, hdf5_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, hdf5_output_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, hinge_loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, image_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, infogain_loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, inner_product_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, lrn_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, memory_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, mvn_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, pooling_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, power_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, relu_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, sigmoid_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, softmax_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, slice_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, tanh_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, threshold_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, window_data_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, transform_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, loss_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, layer_), + }; + V1LayerParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + V1LayerParameter_descriptor_, + V1LayerParameter::internal_default_instance(), + V1LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, _has_bits_), + -1, + -1, + sizeof(V1LayerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, _internal_metadata_)); + V1LayerParameter_LayerType_descriptor_ = V1LayerParameter_descriptor_->enum_type(0); + V1LayerParameter_DimCheckMode_descriptor_ = V1LayerParameter_descriptor_->enum_type(1); + V0LayerParameter_descriptor_ = file->message_type(65); + static const int V0LayerParameter_offsets_[38] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, num_output_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, biasterm_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, weight_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, bias_filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, pad_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, kernelsize_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, group_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, pool_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, dropout_ratio_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, local_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, alpha_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, beta_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, k_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, meanfile_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, batchsize_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, cropsize_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, mirror_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, blobs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, blobs_lr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, weight_decay_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, rand_skip_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, det_fg_threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, det_bg_threshold_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, det_fg_fraction_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, det_context_pad_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, det_crop_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, new_num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, new_channels_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, new_height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, new_width_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, shuffle_images_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, concat_dim_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, hdf5_output_param_), + }; + V0LayerParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + V0LayerParameter_descriptor_, + V0LayerParameter::internal_default_instance(), + V0LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, _has_bits_), + -1, + -1, + sizeof(V0LayerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, _internal_metadata_)); + V0LayerParameter_PoolMethod_descriptor_ = V0LayerParameter_descriptor_->enum_type(0); + PReLUParameter_descriptor_ = file->message_type(66); + static const int PReLUParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, channel_shared_), + }; + PReLUParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PReLUParameter_descriptor_, + PReLUParameter::internal_default_instance(), + PReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _has_bits_), + -1, + -1, + sizeof(PReLUParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _internal_metadata_)); + NormalizedBBox_descriptor_ = file->message_type(67); + static const int NormalizedBBox_offsets_[8] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, xmin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, ymin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, xmax_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, ymax_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, difficult_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, score_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, size_), + }; + NormalizedBBox_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NormalizedBBox_descriptor_, + NormalizedBBox::internal_default_instance(), + NormalizedBBox_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, _has_bits_), + -1, + -1, + sizeof(NormalizedBBox), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NormalizedBBox, _internal_metadata_)); + Phase_descriptor_ = file->enum_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_caffe_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobShape_descriptor_, BlobShape::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobProto_descriptor_, BlobProto::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobProtoVector_descriptor_, BlobProtoVector::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PermuteParameter_descriptor_, PermuteParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NormalizeBBoxParameter_descriptor_, NormalizeBBoxParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PriorBoxParameter_descriptor_, PriorBoxParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DetectionOutputParameter_descriptor_, DetectionOutputParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Datum_descriptor_, Datum::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FillerParameter_descriptor_, FillerParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetParameter_descriptor_, NetParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SolverParameter_descriptor_, SolverParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SolverState_descriptor_, SolverState::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetState_descriptor_, NetState::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetStateRule_descriptor_, NetStateRule::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ParamSpec_descriptor_, ParamSpec::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LayerParameter_descriptor_, LayerParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TransformationParameter_descriptor_, TransformationParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LossParameter_descriptor_, LossParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + AccuracyParameter_descriptor_, AccuracyParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ArgMaxParameter_descriptor_, ArgMaxParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ConcatParameter_descriptor_, ConcatParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BatchNormParameter_descriptor_, BatchNormParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BiasParameter_descriptor_, BiasParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ContrastiveLossParameter_descriptor_, ContrastiveLossParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ConvolutionParameter_descriptor_, ConvolutionParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CropParameter_descriptor_, CropParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DataParameter_descriptor_, DataParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NonMaximumSuppressionParameter_descriptor_, NonMaximumSuppressionParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SaveOutputParameter_descriptor_, SaveOutputParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DropoutParameter_descriptor_, DropoutParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DummyDataParameter_descriptor_, DummyDataParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EltwiseParameter_descriptor_, EltwiseParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ELUParameter_descriptor_, ELUParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EmbedParameter_descriptor_, EmbedParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ExpParameter_descriptor_, ExpParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FlattenParameter_descriptor_, FlattenParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HDF5DataParameter_descriptor_, HDF5DataParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HDF5OutputParameter_descriptor_, HDF5OutputParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HingeLossParameter_descriptor_, HingeLossParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ImageDataParameter_descriptor_, ImageDataParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InfogainLossParameter_descriptor_, InfogainLossParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InnerProductParameter_descriptor_, InnerProductParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InputParameter_descriptor_, InputParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LogParameter_descriptor_, LogParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LRNParameter_descriptor_, LRNParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MemoryDataParameter_descriptor_, MemoryDataParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MVNParameter_descriptor_, MVNParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ParameterParameter_descriptor_, ParameterParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PoolingParameter_descriptor_, PoolingParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PowerParameter_descriptor_, PowerParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PythonParameter_descriptor_, PythonParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + RecurrentParameter_descriptor_, RecurrentParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReductionParameter_descriptor_, ReductionParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReLUParameter_descriptor_, ReLUParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReshapeParameter_descriptor_, ReshapeParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ScaleParameter_descriptor_, ScaleParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SigmoidParameter_descriptor_, SigmoidParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SliceParameter_descriptor_, SliceParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SoftmaxParameter_descriptor_, SoftmaxParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TanHParameter_descriptor_, TanHParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TileParameter_descriptor_, TileParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ThresholdParameter_descriptor_, ThresholdParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + WindowDataParameter_descriptor_, WindowDataParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SPPParameter_descriptor_, SPPParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + V1LayerParameter_descriptor_, V1LayerParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + V0LayerParameter_descriptor_, V0LayerParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PReLUParameter_descriptor_, PReLUParameter::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NormalizedBBox_descriptor_, NormalizedBBox::internal_default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_caffe_2eproto() { + BlobShape_default_instance_.Shutdown(); + delete BlobShape_reflection_; + BlobProto_default_instance_.Shutdown(); + delete BlobProto_reflection_; + BlobProtoVector_default_instance_.Shutdown(); + delete BlobProtoVector_reflection_; + PermuteParameter_default_instance_.Shutdown(); + delete PermuteParameter_reflection_; + NormalizeBBoxParameter_default_instance_.Shutdown(); + delete NormalizeBBoxParameter_reflection_; + PriorBoxParameter_default_instance_.Shutdown(); + delete PriorBoxParameter_reflection_; + DetectionOutputParameter_default_instance_.Shutdown(); + delete DetectionOutputParameter_reflection_; + Datum_default_instance_.Shutdown(); + delete Datum_reflection_; + FillerParameter_default_instance_.Shutdown(); + delete FillerParameter_reflection_; + delete FillerParameter::_default_type_; + NetParameter_default_instance_.Shutdown(); + delete NetParameter_reflection_; + SolverParameter_default_instance_.Shutdown(); + delete SolverParameter_reflection_; + delete SolverParameter::_default_regularization_type_; + delete SolverParameter::_default_type_; + SolverState_default_instance_.Shutdown(); + delete SolverState_reflection_; + NetState_default_instance_.Shutdown(); + delete NetState_reflection_; + NetStateRule_default_instance_.Shutdown(); + delete NetStateRule_reflection_; + ParamSpec_default_instance_.Shutdown(); + delete ParamSpec_reflection_; + LayerParameter_default_instance_.Shutdown(); + delete LayerParameter_reflection_; + TransformationParameter_default_instance_.Shutdown(); + delete TransformationParameter_reflection_; + LossParameter_default_instance_.Shutdown(); + delete LossParameter_reflection_; + AccuracyParameter_default_instance_.Shutdown(); + delete AccuracyParameter_reflection_; + ArgMaxParameter_default_instance_.Shutdown(); + delete ArgMaxParameter_reflection_; + ConcatParameter_default_instance_.Shutdown(); + delete ConcatParameter_reflection_; + BatchNormParameter_default_instance_.Shutdown(); + delete BatchNormParameter_reflection_; + BiasParameter_default_instance_.Shutdown(); + delete BiasParameter_reflection_; + ContrastiveLossParameter_default_instance_.Shutdown(); + delete ContrastiveLossParameter_reflection_; + ConvolutionParameter_default_instance_.Shutdown(); + delete ConvolutionParameter_reflection_; + CropParameter_default_instance_.Shutdown(); + delete CropParameter_reflection_; + DataParameter_default_instance_.Shutdown(); + delete DataParameter_reflection_; + NonMaximumSuppressionParameter_default_instance_.Shutdown(); + delete NonMaximumSuppressionParameter_reflection_; + SaveOutputParameter_default_instance_.Shutdown(); + delete SaveOutputParameter_reflection_; + DropoutParameter_default_instance_.Shutdown(); + delete DropoutParameter_reflection_; + DummyDataParameter_default_instance_.Shutdown(); + delete DummyDataParameter_reflection_; + EltwiseParameter_default_instance_.Shutdown(); + delete EltwiseParameter_reflection_; + ELUParameter_default_instance_.Shutdown(); + delete ELUParameter_reflection_; + EmbedParameter_default_instance_.Shutdown(); + delete EmbedParameter_reflection_; + ExpParameter_default_instance_.Shutdown(); + delete ExpParameter_reflection_; + FlattenParameter_default_instance_.Shutdown(); + delete FlattenParameter_reflection_; + HDF5DataParameter_default_instance_.Shutdown(); + delete HDF5DataParameter_reflection_; + HDF5OutputParameter_default_instance_.Shutdown(); + delete HDF5OutputParameter_reflection_; + HingeLossParameter_default_instance_.Shutdown(); + delete HingeLossParameter_reflection_; + ImageDataParameter_default_instance_.Shutdown(); + delete ImageDataParameter_reflection_; + InfogainLossParameter_default_instance_.Shutdown(); + delete InfogainLossParameter_reflection_; + InnerProductParameter_default_instance_.Shutdown(); + delete InnerProductParameter_reflection_; + InputParameter_default_instance_.Shutdown(); + delete InputParameter_reflection_; + LogParameter_default_instance_.Shutdown(); + delete LogParameter_reflection_; + LRNParameter_default_instance_.Shutdown(); + delete LRNParameter_reflection_; + MemoryDataParameter_default_instance_.Shutdown(); + delete MemoryDataParameter_reflection_; + MVNParameter_default_instance_.Shutdown(); + delete MVNParameter_reflection_; + ParameterParameter_default_instance_.Shutdown(); + delete ParameterParameter_reflection_; + PoolingParameter_default_instance_.Shutdown(); + delete PoolingParameter_reflection_; + PowerParameter_default_instance_.Shutdown(); + delete PowerParameter_reflection_; + PythonParameter_default_instance_.Shutdown(); + delete PythonParameter_reflection_; + RecurrentParameter_default_instance_.Shutdown(); + delete RecurrentParameter_reflection_; + ReductionParameter_default_instance_.Shutdown(); + delete ReductionParameter_reflection_; + ReLUParameter_default_instance_.Shutdown(); + delete ReLUParameter_reflection_; + ReshapeParameter_default_instance_.Shutdown(); + delete ReshapeParameter_reflection_; + ScaleParameter_default_instance_.Shutdown(); + delete ScaleParameter_reflection_; + SigmoidParameter_default_instance_.Shutdown(); + delete SigmoidParameter_reflection_; + SliceParameter_default_instance_.Shutdown(); + delete SliceParameter_reflection_; + SoftmaxParameter_default_instance_.Shutdown(); + delete SoftmaxParameter_reflection_; + TanHParameter_default_instance_.Shutdown(); + delete TanHParameter_reflection_; + TileParameter_default_instance_.Shutdown(); + delete TileParameter_reflection_; + ThresholdParameter_default_instance_.Shutdown(); + delete ThresholdParameter_reflection_; + WindowDataParameter_default_instance_.Shutdown(); + delete WindowDataParameter_reflection_; + delete WindowDataParameter::_default_crop_mode_; + SPPParameter_default_instance_.Shutdown(); + delete SPPParameter_reflection_; + V1LayerParameter_default_instance_.Shutdown(); + delete V1LayerParameter_reflection_; + V0LayerParameter_default_instance_.Shutdown(); + delete V0LayerParameter_reflection_; + delete V0LayerParameter::_default_det_crop_mode_; + PReLUParameter_default_instance_.Shutdown(); + delete PReLUParameter_reflection_; + NormalizedBBox_default_instance_.Shutdown(); + delete NormalizedBBox_reflection_; +} + +void protobuf_InitDefaults_caffe_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + BlobShape_default_instance_.DefaultConstruct(); + BlobProto_default_instance_.DefaultConstruct(); + BlobProtoVector_default_instance_.DefaultConstruct(); + PermuteParameter_default_instance_.DefaultConstruct(); + NormalizeBBoxParameter_default_instance_.DefaultConstruct(); + PriorBoxParameter_default_instance_.DefaultConstruct(); + DetectionOutputParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + Datum_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + FillerParameter::_default_type_ = + new ::std::string("constant", 8); + FillerParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + NetParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + SolverParameter::_default_regularization_type_ = + new ::std::string("L2", 2); + SolverParameter::_default_type_ = + new ::std::string("SGD", 3); + SolverParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + SolverState_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + NetState_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + NetStateRule_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + ParamSpec_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + LayerParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + TransformationParameter_default_instance_.DefaultConstruct(); + LossParameter_default_instance_.DefaultConstruct(); + AccuracyParameter_default_instance_.DefaultConstruct(); + ArgMaxParameter_default_instance_.DefaultConstruct(); + ConcatParameter_default_instance_.DefaultConstruct(); + BatchNormParameter_default_instance_.DefaultConstruct(); + BiasParameter_default_instance_.DefaultConstruct(); + ContrastiveLossParameter_default_instance_.DefaultConstruct(); + ConvolutionParameter_default_instance_.DefaultConstruct(); + CropParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + DataParameter_default_instance_.DefaultConstruct(); + NonMaximumSuppressionParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + SaveOutputParameter_default_instance_.DefaultConstruct(); + DropoutParameter_default_instance_.DefaultConstruct(); + DummyDataParameter_default_instance_.DefaultConstruct(); + EltwiseParameter_default_instance_.DefaultConstruct(); + ELUParameter_default_instance_.DefaultConstruct(); + EmbedParameter_default_instance_.DefaultConstruct(); + ExpParameter_default_instance_.DefaultConstruct(); + FlattenParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + HDF5DataParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + HDF5OutputParameter_default_instance_.DefaultConstruct(); + HingeLossParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + ImageDataParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + InfogainLossParameter_default_instance_.DefaultConstruct(); + InnerProductParameter_default_instance_.DefaultConstruct(); + InputParameter_default_instance_.DefaultConstruct(); + LogParameter_default_instance_.DefaultConstruct(); + LRNParameter_default_instance_.DefaultConstruct(); + MemoryDataParameter_default_instance_.DefaultConstruct(); + MVNParameter_default_instance_.DefaultConstruct(); + ParameterParameter_default_instance_.DefaultConstruct(); + PoolingParameter_default_instance_.DefaultConstruct(); + PowerParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + PythonParameter_default_instance_.DefaultConstruct(); + RecurrentParameter_default_instance_.DefaultConstruct(); + ReductionParameter_default_instance_.DefaultConstruct(); + ReLUParameter_default_instance_.DefaultConstruct(); + ReshapeParameter_default_instance_.DefaultConstruct(); + ScaleParameter_default_instance_.DefaultConstruct(); + SigmoidParameter_default_instance_.DefaultConstruct(); + SliceParameter_default_instance_.DefaultConstruct(); + SoftmaxParameter_default_instance_.DefaultConstruct(); + TanHParameter_default_instance_.DefaultConstruct(); + TileParameter_default_instance_.DefaultConstruct(); + ThresholdParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + WindowDataParameter::_default_crop_mode_ = + new ::std::string("warp", 4); + WindowDataParameter_default_instance_.DefaultConstruct(); + SPPParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + V1LayerParameter_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + V0LayerParameter::_default_det_crop_mode_ = + new ::std::string("warp", 4); + V0LayerParameter_default_instance_.DefaultConstruct(); + PReLUParameter_default_instance_.DefaultConstruct(); + NormalizedBBox_default_instance_.DefaultConstruct(); + BlobShape_default_instance_.get_mutable()->InitAsDefaultInstance(); + BlobProto_default_instance_.get_mutable()->InitAsDefaultInstance(); + BlobProtoVector_default_instance_.get_mutable()->InitAsDefaultInstance(); + PermuteParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + NormalizeBBoxParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + PriorBoxParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + DetectionOutputParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + Datum_default_instance_.get_mutable()->InitAsDefaultInstance(); + FillerParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + NetParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SolverParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SolverState_default_instance_.get_mutable()->InitAsDefaultInstance(); + NetState_default_instance_.get_mutable()->InitAsDefaultInstance(); + NetStateRule_default_instance_.get_mutable()->InitAsDefaultInstance(); + ParamSpec_default_instance_.get_mutable()->InitAsDefaultInstance(); + LayerParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + TransformationParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + LossParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + AccuracyParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ArgMaxParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ConcatParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + BatchNormParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + BiasParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ContrastiveLossParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ConvolutionParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + CropParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + DataParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + NonMaximumSuppressionParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SaveOutputParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + DropoutParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + DummyDataParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + EltwiseParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ELUParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + EmbedParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ExpParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + FlattenParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + HDF5DataParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + HDF5OutputParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + HingeLossParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ImageDataParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + InfogainLossParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + InnerProductParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + InputParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + LogParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + LRNParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + MemoryDataParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + MVNParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ParameterParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + PoolingParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + PowerParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + PythonParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + RecurrentParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ReductionParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ReLUParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ReshapeParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ScaleParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SigmoidParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SliceParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SoftmaxParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + TanHParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + TileParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + ThresholdParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + WindowDataParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + SPPParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + V1LayerParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + V0LayerParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + PReLUParameter_default_instance_.get_mutable()->InitAsDefaultInstance(); + NormalizedBBox_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_caffe_2eproto_once_); +void protobuf_InitDefaults_caffe_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_caffe_2eproto_once_, + &protobuf_InitDefaults_caffe_2eproto_impl); +} +void protobuf_AddDesc_caffe_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_caffe_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\013caffe.proto\022\005caffe\"\034\n\tBlobShape\022\017\n\003dim" + "\030\001 \003(\003B\002\020\001\"\314\001\n\tBlobProto\022\037\n\005shape\030\007 \001(\0132" + "\020.caffe.BlobShape\022\020\n\004data\030\005 \003(\002B\002\020\001\022\020\n\004d" + "iff\030\006 \003(\002B\002\020\001\022\027\n\013double_data\030\010 \003(\001B\002\020\001\022\027" + "\n\013double_diff\030\t \003(\001B\002\020\001\022\016\n\003num\030\001 \001(\005:\0010\022" + "\023\n\010channels\030\002 \001(\005:\0010\022\021\n\006height\030\003 \001(\005:\0010\022" + "\020\n\005width\030\004 \001(\005:\0010\"2\n\017BlobProtoVector\022\037\n\005" + "blobs\030\001 \003(\0132\020.caffe.BlobProto\"!\n\020Permute" + "Parameter\022\r\n\005order\030\001 \003(\r\"\226\001\n\026NormalizeBB" + "oxParameter\022\034\n\016across_spatial\030\001 \001(\010:\004tru" + "e\022,\n\014scale_filler\030\002 \001(\0132\026.caffe.FillerPa" + "rameter\022\034\n\016channel_shared\030\003 \001(\010:\004true\022\022\n" + "\003eps\030\004 \001(\002:\0051e-10\"\243\002\n\021PriorBoxParameter\022" + "\020\n\010min_size\030\001 \001(\002\022\020\n\010max_size\030\002 \001(\002\022\024\n\014a" + "spect_ratio\030\003 \003(\002\022\022\n\004flip\030\004 \001(\010:\004true\022\022\n" + "\004clip\030\005 \001(\010:\004true\022\020\n\010variance\030\006 \003(\002\022\020\n\010i" + "mg_size\030\007 \001(\r\022\r\n\005img_h\030\010 \001(\r\022\r\n\005img_w\030\t " + "\001(\r\022\014\n\004step\030\n \001(\002\022\016\n\006step_h\030\013 \001(\002\022\016\n\006ste" + "p_w\030\014 \001(\002\022\023\n\006offset\030\r \001(\002:\0030.5\"\'\n\010CodeTy" + "pe\022\n\n\006CORNER\020\001\022\017\n\013CENTER_SIZE\020\002\"\375\002\n\030Dete" + "ctionOutputParameter\022\023\n\013num_classes\030\001 \001(" + "\r\022\034\n\016share_location\030\002 \001(\010:\004true\022\036\n\023backg" + "round_label_id\030\003 \001(\005:\0010\0228\n\tnms_param\030\004 \001" + "(\0132%.caffe.NonMaximumSuppressionParamete" + "r\0225\n\021save_output_param\030\005 \001(\0132\032.caffe.Sav" + "eOutputParameter\022<\n\tcode_type\030\006 \001(\0162!.ca" + "ffe.PriorBoxParameter.CodeType:\006CORNER\022)" + "\n\032variance_encoded_in_target\030\010 \001(\010:\005fals" + "e\022\026\n\nkeep_top_k\030\007 \001(\005:\002-1\022\034\n\024confidence_" + "threshold\030\t \001(\002\"\201\001\n\005Datum\022\020\n\010channels\030\001 " + "\001(\005\022\016\n\006height\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\022\014\n\004da" + "ta\030\004 \001(\014\022\r\n\005label\030\005 \001(\005\022\022\n\nfloat_data\030\006 " + "\003(\002\022\026\n\007encoded\030\007 \001(\010:\005false\"\212\002\n\017FillerPa" + "rameter\022\026\n\004type\030\001 \001(\t:\010constant\022\020\n\005value" + "\030\002 \001(\002:\0010\022\016\n\003min\030\003 \001(\002:\0010\022\016\n\003max\030\004 \001(\002:\001" + "1\022\017\n\004mean\030\005 \001(\002:\0010\022\016\n\003std\030\006 \001(\002:\0011\022\022\n\006sp" + "arse\030\007 \001(\005:\002-1\022B\n\rvariance_norm\030\010 \001(\0162#." + "caffe.FillerParameter.VarianceNorm:\006FAN_" + "IN\"4\n\014VarianceNorm\022\n\n\006FAN_IN\020\000\022\013\n\007FAN_OU" + "T\020\001\022\013\n\007AVERAGE\020\002\"\216\002\n\014NetParameter\022\014\n\004nam" + "e\030\001 \001(\t\022\r\n\005input\030\003 \003(\t\022%\n\013input_shape\030\010 " + "\003(\0132\020.caffe.BlobShape\022\021\n\tinput_dim\030\004 \003(\005" + "\022\035\n\016force_backward\030\005 \001(\010:\005false\022\036\n\005state" + "\030\006 \001(\0132\017.caffe.NetState\022\031\n\ndebug_info\030\007 " + "\001(\010:\005false\022$\n\005layer\030d \003(\0132\025.caffe.LayerP" + "arameter\022\'\n\006layers\030\002 \003(\0132\027.caffe.V1Layer" + "Parameter\"\242\n\n\017SolverParameter\022\013\n\003net\030\030 \001" + "(\t\022&\n\tnet_param\030\031 \001(\0132\023.caffe.NetParamet" + "er\022\021\n\ttrain_net\030\001 \001(\t\022\020\n\010test_net\030\002 \003(\t\022" + ",\n\017train_net_param\030\025 \001(\0132\023.caffe.NetPara" + "meter\022+\n\016test_net_param\030\026 \003(\0132\023.caffe.Ne" + "tParameter\022$\n\013train_state\030\032 \001(\0132\017.caffe." + "NetState\022#\n\ntest_state\030\033 \003(\0132\017.caffe.Net" + "State\022\021\n\ttest_iter\030\003 \003(\005\022\030\n\rtest_interva" + "l\030\004 \001(\005:\0010\022 \n\021test_compute_loss\030\023 \001(\010:\005f" + "alse\022!\n\023test_initialization\030 \001(\010:\004true\022" + "\017\n\007base_lr\030\005 \001(\002\022\017\n\007display\030\006 \001(\005\022\027\n\014ave" + "rage_loss\030! \001(\005:\0011\022\020\n\010max_iter\030\007 \001(\005\022\024\n\t" + "iter_size\030$ \001(\005:\0011\022\021\n\tlr_policy\030\010 \001(\t\022\r\n" + "\005gamma\030\t \001(\002\022\r\n\005power\030\n \001(\002\022\020\n\010momentum\030" + "\013 \001(\002\022\024\n\014weight_decay\030\014 \001(\002\022\037\n\023regulariz" + "ation_type\030\035 \001(\t:\002L2\022\020\n\010stepsize\030\r \001(\005\022\021" + "\n\tstepvalue\030\" \003(\005\022\032\n\016clip_gradients\030# \001(" + "\002:\002-1\022\023\n\010snapshot\030\016 \001(\005:\0010\022\027\n\017snapshot_p" + "refix\030\017 \001(\t\022\034\n\rsnapshot_diff\030\020 \001(\010:\005fals" + "e\022K\n\017snapshot_format\030% \001(\0162%.caffe.Solve" + "rParameter.SnapshotFormat:\013BINARYPROTO\022;" + "\n\013solver_mode\030\021 \001(\0162!.caffe.SolverParame" + "ter.SolverMode:\003GPU\022\024\n\tdevice_id\030\022 \001(\005:\001" + "0\022\027\n\013random_seed\030\024 \001(\003:\002-1\022\021\n\004type\030( \001(\t" + ":\003SGD\022\024\n\005delta\030\037 \001(\002:\0051e-08\022\030\n\tmomentum2" + "\030\' \001(\002:\0050.999\022\027\n\trms_decay\030& \001(\002:\0040.99\022\031" + "\n\ndebug_info\030\027 \001(\010:\005false\022\"\n\024snapshot_af" + "ter_train\030\034 \001(\010:\004true\022;\n\013solver_type\030\036 \001" + "(\0162!.caffe.SolverParameter.SolverType:\003S" + "GD\"+\n\016SnapshotFormat\022\010\n\004HDF5\020\000\022\017\n\013BINARY" + "PROTO\020\001\"\036\n\nSolverMode\022\007\n\003CPU\020\000\022\007\n\003GPU\020\001\"" + "U\n\nSolverType\022\007\n\003SGD\020\000\022\014\n\010NESTEROV\020\001\022\013\n\007" + "ADAGRAD\020\002\022\013\n\007RMSPROP\020\003\022\014\n\010ADADELTA\020\004\022\010\n\004" + "ADAM\020\005\"l\n\013SolverState\022\014\n\004iter\030\001 \001(\005\022\023\n\013l" + "earned_net\030\002 \001(\t\022!\n\007history\030\003 \003(\0132\020.caff" + "e.BlobProto\022\027\n\014current_step\030\004 \001(\005:\0010\"N\n\010" + "NetState\022!\n\005phase\030\001 \001(\0162\014.caffe.Phase:\004T" + "EST\022\020\n\005level\030\002 \001(\005:\0010\022\r\n\005stage\030\003 \003(\t\"s\n\014" + "NetStateRule\022\033\n\005phase\030\001 \001(\0162\014.caffe.Phas" + "e\022\021\n\tmin_level\030\002 \001(\005\022\021\n\tmax_level\030\003 \001(\005\022" + "\r\n\005stage\030\004 \003(\t\022\021\n\tnot_stage\030\005 \003(\t\"\243\001\n\tPa" + "ramSpec\022\014\n\004name\030\001 \001(\t\0221\n\nshare_mode\030\002 \001(" + "\0162\035.caffe.ParamSpec.DimCheckMode\022\022\n\007lr_m" + "ult\030\003 \001(\002:\0011\022\025\n\ndecay_mult\030\004 \001(\002:\0011\"*\n\014D" + "imCheckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"" + "\335\025\n\016LayerParameter\022\014\n\004name\030\001 \001(\t\022\014\n\004type" + "\030\002 \001(\t\022\016\n\006bottom\030\003 \003(\t\022\013\n\003top\030\004 \003(\t\022\033\n\005p" + "hase\030\n \001(\0162\014.caffe.Phase\022\023\n\013loss_weight\030" + "\005 \003(\002\022\037\n\005param\030\006 \003(\0132\020.caffe.ParamSpec\022\037" + "\n\005blobs\030\007 \003(\0132\020.caffe.BlobProto\022\026\n\016propa" + "gate_down\030\013 \003(\010\022$\n\007include\030\010 \003(\0132\023.caffe" + ".NetStateRule\022$\n\007exclude\030\t \003(\0132\023.caffe.N" + "etStateRule\0227\n\017transform_param\030d \001(\0132\036.c" + "affe.TransformationParameter\022(\n\nloss_par" + "am\030e \001(\0132\024.caffe.LossParameter\0220\n\016accura" + "cy_param\030f \001(\0132\030.caffe.AccuracyParameter" + "\022,\n\014argmax_param\030g \001(\0132\026.caffe.ArgMaxPar" + "ameter\0224\n\020batch_norm_param\030\213\001 \001(\0132\031.caff" + "e.BatchNormParameter\022)\n\nbias_param\030\215\001 \001(" + "\0132\024.caffe.BiasParameter\022,\n\014concat_param\030" + "h \001(\0132\026.caffe.ConcatParameter\022\?\n\026contras" + "tive_loss_param\030i \001(\0132\037.caffe.Contrastiv" + "eLossParameter\0226\n\021convolution_param\030j \001(" + "\0132\033.caffe.ConvolutionParameter\022)\n\ncrop_p" + "aram\030\220\001 \001(\0132\024.caffe.CropParameter\022(\n\ndat" + "a_param\030k \001(\0132\024.caffe.DataParameter\022@\n\026d" + "etection_output_param\030\223\001 \001(\0132\037.caffe.Det" + "ectionOutputParameter\022.\n\rdropout_param\030l" + " \001(\0132\027.caffe.DropoutParameter\0223\n\020dummy_d" + "ata_param\030m \001(\0132\031.caffe.DummyDataParamet" + "er\022.\n\reltwise_param\030n \001(\0132\027.caffe.Eltwis" + "eParameter\022\'\n\telu_param\030\214\001 \001(\0132\023.caffe.E" + "LUParameter\022+\n\013embed_param\030\211\001 \001(\0132\025.caff" + "e.EmbedParameter\022&\n\texp_param\030o \001(\0132\023.ca" + "ffe.ExpParameter\022/\n\rflatten_param\030\207\001 \001(\013" + "2\027.caffe.FlattenParameter\0221\n\017hdf5_data_p" + "aram\030p \001(\0132\030.caffe.HDF5DataParameter\0225\n\021" + "hdf5_output_param\030q \001(\0132\032.caffe.HDF5Outp" + "utParameter\0223\n\020hinge_loss_param\030r \001(\0132\031." + "caffe.HingeLossParameter\0223\n\020image_data_p" + "aram\030s \001(\0132\031.caffe.ImageDataParameter\0229\n" + "\023infogain_loss_param\030t \001(\0132\034.caffe.Infog" + "ainLossParameter\0229\n\023inner_product_param\030" + "u \001(\0132\034.caffe.InnerProductParameter\022+\n\013i" + "nput_param\030\217\001 \001(\0132\025.caffe.InputParameter" + "\022\'\n\tlog_param\030\206\001 \001(\0132\023.caffe.LogParamete" + "r\022&\n\tlrn_param\030v \001(\0132\023.caffe.LRNParamete" + "r\0225\n\021memory_data_param\030w \001(\0132\032.caffe.Mem" + "oryDataParameter\022&\n\tmvn_param\030x \001(\0132\023.ca" + "ffe.MVNParameter\0222\n\nnorm_param\030\225\001 \001(\0132\035." + "caffe.NormalizeBBoxParameter\022/\n\rpermute_" + "param\030\224\001 \001(\0132\027.caffe.PermuteParameter\0223\n" + "\017parameter_param\030\221\001 \001(\0132\031.caffe.Paramete" + "rParameter\022.\n\rpooling_param\030y \001(\0132\027.caff" + "e.PoolingParameter\022*\n\013power_param\030z \001(\0132" + "\025.caffe.PowerParameter\022+\n\013prelu_param\030\203\001" + " \001(\0132\025.caffe.PReLUParameter\0222\n\017prior_box" + "_param\030\226\001 \001(\0132\030.caffe.PriorBoxParameter\022" + "-\n\014python_param\030\202\001 \001(\0132\026.caffe.PythonPar" + "ameter\0223\n\017recurrent_param\030\222\001 \001(\0132\031.caffe" + ".RecurrentParameter\0223\n\017reduction_param\030\210" + "\001 \001(\0132\031.caffe.ReductionParameter\022(\n\nrelu" + "_param\030{ \001(\0132\024.caffe.ReLUParameter\022/\n\rre" + "shape_param\030\205\001 \001(\0132\027.caffe.ReshapeParame" + "ter\022+\n\013scale_param\030\216\001 \001(\0132\025.caffe.ScaleP" + "arameter\022.\n\rsigmoid_param\030| \001(\0132\027.caffe." + "SigmoidParameter\022.\n\rsoftmax_param\030} \001(\0132" + "\027.caffe.SoftmaxParameter\022\'\n\tspp_param\030\204\001" + " \001(\0132\023.caffe.SPPParameter\022*\n\013slice_param" + "\030~ \001(\0132\025.caffe.SliceParameter\022(\n\ntanh_pa" + "ram\030\177 \001(\0132\024.caffe.TanHParameter\0223\n\017thres" + "hold_param\030\200\001 \001(\0132\031.caffe.ThresholdParam" + "eter\022)\n\ntile_param\030\212\001 \001(\0132\024.caffe.TilePa" + "rameter\0226\n\021window_data_param\030\201\001 \001(\0132\032.ca" + "ffe.WindowDataParameter\"\266\001\n\027Transformati" + "onParameter\022\020\n\005scale\030\001 \001(\002:\0011\022\025\n\006mirror\030" + "\002 \001(\010:\005false\022\024\n\tcrop_size\030\003 \001(\r:\0010\022\021\n\tme" + "an_file\030\004 \001(\t\022\022\n\nmean_value\030\005 \003(\002\022\032\n\013for" + "ce_color\030\006 \001(\010:\005false\022\031\n\nforce_gray\030\007 \001(" + "\010:\005false\"\302\001\n\rLossParameter\022\024\n\014ignore_lab" + "el\030\001 \001(\005\022D\n\rnormalization\030\003 \001(\0162&.caffe." + "LossParameter.NormalizationMode:\005VALID\022\021" + "\n\tnormalize\030\002 \001(\010\"B\n\021NormalizationMode\022\010" + "\n\004FULL\020\000\022\t\n\005VALID\020\001\022\016\n\nBATCH_SIZE\020\002\022\010\n\004N" + "ONE\020\003\"L\n\021AccuracyParameter\022\020\n\005top_k\030\001 \001(" + "\r:\0011\022\017\n\004axis\030\002 \001(\005:\0011\022\024\n\014ignore_label\030\003 " + "\001(\005\"M\n\017ArgMaxParameter\022\032\n\013out_max_val\030\001 " + "\001(\010:\005false\022\020\n\005top_k\030\002 \001(\r:\0011\022\014\n\004axis\030\003 \001" + "(\005\"9\n\017ConcatParameter\022\017\n\004axis\030\002 \001(\005:\0011\022\025" + "\n\nconcat_dim\030\001 \001(\r:\0011\"j\n\022BatchNormParame" + "ter\022\030\n\020use_global_stats\030\001 \001(\010\022&\n\027moving_" + "average_fraction\030\002 \001(\002:\0050.999\022\022\n\003eps\030\003 \001" + "(\002:\0051e-05\"]\n\rBiasParameter\022\017\n\004axis\030\001 \001(\005" + ":\0011\022\023\n\010num_axes\030\002 \001(\005:\0011\022&\n\006filler\030\003 \001(\013" + "2\026.caffe.FillerParameter\"L\n\030ContrastiveL" + "ossParameter\022\021\n\006margin\030\001 \001(\002:\0011\022\035\n\016legac" + "y_version\030\002 \001(\010:\005false\"\374\003\n\024ConvolutionPa" + "rameter\022\022\n\nnum_output\030\001 \001(\r\022\027\n\tbias_term" + "\030\002 \001(\010:\004true\022\013\n\003pad\030\003 \003(\r\022\023\n\013kernel_size" + "\030\004 \003(\r\022\016\n\006stride\030\006 \003(\r\022\020\n\010dilation\030\022 \003(\r" + "\022\020\n\005pad_h\030\t \001(\r:\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\020\n\010" + "kernel_h\030\013 \001(\r\022\020\n\010kernel_w\030\014 \001(\r\022\020\n\010stri" + "de_h\030\r \001(\r\022\020\n\010stride_w\030\016 \001(\r\022\020\n\005group\030\005 " + "\001(\r:\0011\022-\n\rweight_filler\030\007 \001(\0132\026.caffe.Fi" + "llerParameter\022+\n\013bias_filler\030\010 \001(\0132\026.caf" + "fe.FillerParameter\022;\n\006engine\030\017 \001(\0162\".caf" + "fe.ConvolutionParameter.Engine:\007DEFAULT\022" + "\017\n\004axis\030\020 \001(\005:\0011\022\036\n\017force_nd_im2col\030\021 \001(" + "\010:\005false\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE" + "\020\001\022\t\n\005CUDNN\020\002\"0\n\rCropParameter\022\017\n\004axis\030\001" + " \001(\005:\0012\022\016\n\006offset\030\002 \003(\r\"\244\002\n\rDataParamete" + "r\022\016\n\006source\030\001 \001(\t\022\022\n\nbatch_size\030\004 \001(\r\022\024\n" + "\trand_skip\030\007 \001(\r:\0010\0221\n\007backend\030\010 \001(\0162\027.c" + "affe.DataParameter.DB:\007LEVELDB\022\020\n\005scale\030" + "\002 \001(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\024\n\tcrop_size" + "\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010:\005false\022\"\n\023forc" + "e_encoded_color\030\t \001(\010:\005false\022\023\n\010prefetch" + "\030\n \001(\r:\0014\"\033\n\002DB\022\013\n\007LEVELDB\020\000\022\010\n\004LMDB\020\001\"[" + "\n\036NonMaximumSuppressionParameter\022\032\n\rnms_" + "threshold\030\001 \001(\002:\0030.3\022\r\n\005top_k\030\002 \001(\005\022\016\n\003e" + "ta\030\003 \001(\002:\0011\"\252\001\n\023SaveOutputParameter\022\030\n\020o" + "utput_directory\030\001 \001(\t\022\032\n\022output_name_pre" + "fix\030\002 \001(\t\022\025\n\routput_format\030\003 \001(\t\022\026\n\016labe" + "l_map_file\030\004 \001(\t\022\026\n\016name_size_file\030\005 \001(\t" + "\022\026\n\016num_test_image\030\006 \001(\r\".\n\020DropoutParam" + "eter\022\032\n\rdropout_ratio\030\001 \001(\002:\0030.5\"\240\001\n\022Dum" + "myDataParameter\022+\n\013data_filler\030\001 \003(\0132\026.c" + "affe.FillerParameter\022\037\n\005shape\030\006 \003(\0132\020.ca" + "ffe.BlobShape\022\013\n\003num\030\002 \003(\r\022\020\n\010channels\030\003" + " \003(\r\022\016\n\006height\030\004 \003(\r\022\r\n\005width\030\005 \003(\r\"\245\001\n\020" + "EltwiseParameter\0229\n\toperation\030\001 \001(\0162!.ca" + "ffe.EltwiseParameter.EltwiseOp:\003SUM\022\r\n\005c" + "oeff\030\002 \003(\002\022\036\n\020stable_prod_grad\030\003 \001(\010:\004tr" + "ue\"\'\n\tEltwiseOp\022\010\n\004PROD\020\000\022\007\n\003SUM\020\001\022\007\n\003MA" + "X\020\002\" \n\014ELUParameter\022\020\n\005alpha\030\001 \001(\002:\0011\"\254\001" + "\n\016EmbedParameter\022\022\n\nnum_output\030\001 \001(\r\022\021\n\t" + "input_dim\030\002 \001(\r\022\027\n\tbias_term\030\003 \001(\010:\004true" + "\022-\n\rweight_filler\030\004 \001(\0132\026.caffe.FillerPa" + "rameter\022+\n\013bias_filler\030\005 \001(\0132\026.caffe.Fil" + "lerParameter\"D\n\014ExpParameter\022\020\n\004base\030\001 \001" + "(\002:\002-1\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shift\030\003 \001(\002:" + "\0010\"9\n\020FlattenParameter\022\017\n\004axis\030\001 \001(\005:\0011\022" + "\024\n\010end_axis\030\002 \001(\005:\002-1\"O\n\021HDF5DataParamet" + "er\022\016\n\006source\030\001 \001(\t\022\022\n\nbatch_size\030\002 \001(\r\022\026" + "\n\007shuffle\030\003 \001(\010:\005false\"(\n\023HDF5OutputPara" + "meter\022\021\n\tfile_name\030\001 \001(\t\"^\n\022HingeLossPar" + "ameter\0220\n\004norm\030\001 \001(\0162\036.caffe.HingeLossPa" + "rameter.Norm:\002L1\"\026\n\004Norm\022\006\n\002L1\020\001\022\006\n\002L2\020\002" + "\"\227\002\n\022ImageDataParameter\022\016\n\006source\030\001 \001(\t\022" + "\025\n\nbatch_size\030\004 \001(\r:\0011\022\024\n\trand_skip\030\007 \001(" + "\r:\0010\022\026\n\007shuffle\030\010 \001(\010:\005false\022\025\n\nnew_heig" + "ht\030\t \001(\r:\0010\022\024\n\tnew_width\030\n \001(\r:\0010\022\026\n\010is_" + "color\030\013 \001(\010:\004true\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tm" + "ean_file\030\003 \001(\t\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006" + "mirror\030\006 \001(\010:\005false\022\025\n\013root_folder\030\014 \001(\t" + ":\000\"\'\n\025InfogainLossParameter\022\016\n\006source\030\001 " + "\001(\t\"\313\001\n\025InnerProductParameter\022\022\n\nnum_out" + "put\030\001 \001(\r\022\027\n\tbias_term\030\002 \001(\010:\004true\022-\n\rwe" + "ight_filler\030\003 \001(\0132\026.caffe.FillerParamete" + "r\022+\n\013bias_filler\030\004 \001(\0132\026.caffe.FillerPar" + "ameter\022\017\n\004axis\030\005 \001(\005:\0011\022\030\n\ttranspose\030\006 \001" + "(\010:\005false\"1\n\016InputParameter\022\037\n\005shape\030\001 \003" + "(\0132\020.caffe.BlobShape\"D\n\014LogParameter\022\020\n\004" + "base\030\001 \001(\002:\002-1\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shif" + "t\030\003 \001(\002:\0010\"\270\002\n\014LRNParameter\022\025\n\nlocal_siz" + "e\030\001 \001(\r:\0015\022\020\n\005alpha\030\002 \001(\002:\0011\022\022\n\004beta\030\003 \001" + "(\002:\0040.75\022D\n\013norm_region\030\004 \001(\0162\036.caffe.LR" + "NParameter.NormRegion:\017ACROSS_CHANNELS\022\014" + "\n\001k\030\005 \001(\002:\0011\0223\n\006engine\030\006 \001(\0162\032.caffe.LRN" + "Parameter.Engine:\007DEFAULT\"5\n\nNormRegion\022" + "\023\n\017ACROSS_CHANNELS\020\000\022\022\n\016WITHIN_CHANNEL\020\001" + "\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CU" + "DNN\020\002\"Z\n\023MemoryDataParameter\022\022\n\nbatch_si" + "ze\030\001 \001(\r\022\020\n\010channels\030\002 \001(\r\022\016\n\006height\030\003 \001" + "(\r\022\r\n\005width\030\004 \001(\r\"d\n\014MVNParameter\022 \n\022nor" + "malize_variance\030\001 \001(\010:\004true\022\036\n\017across_ch" + "annels\030\002 \001(\010:\005false\022\022\n\003eps\030\003 \001(\002:\0051e-09\"" + "5\n\022ParameterParameter\022\037\n\005shape\030\001 \001(\0132\020.c" + "affe.BlobShape\"\242\003\n\020PoolingParameter\0225\n\004p" + "ool\030\001 \001(\0162\".caffe.PoolingParameter.PoolM" + "ethod:\003MAX\022\016\n\003pad\030\004 \001(\r:\0010\022\020\n\005pad_h\030\t \001(" + "\r:\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\023\n\013kernel_size\030\002 " + "\001(\r\022\020\n\010kernel_h\030\005 \001(\r\022\020\n\010kernel_w\030\006 \001(\r\022" + "\021\n\006stride\030\003 \001(\r:\0011\022\020\n\010stride_h\030\007 \001(\r\022\020\n\010" + "stride_w\030\010 \001(\r\0227\n\006engine\030\013 \001(\0162\036.caffe.P" + "oolingParameter.Engine:\007DEFAULT\022\035\n\016globa" + "l_pooling\030\014 \001(\010:\005false\".\n\nPoolMethod\022\007\n\003" + "MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"+\n\006Engine" + "\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"F\n\016P" + "owerParameter\022\020\n\005power\030\001 \001(\002:\0011\022\020\n\005scale" + "\030\002 \001(\002:\0011\022\020\n\005shift\030\003 \001(\002:\0010\"g\n\017PythonPar" + "ameter\022\016\n\006module\030\001 \001(\t\022\r\n\005layer\030\002 \001(\t\022\023\n" + "\tparam_str\030\003 \001(\t:\000\022 \n\021share_in_parallel\030" + "\004 \001(\010:\005false\"\300\001\n\022RecurrentParameter\022\025\n\nn" + "um_output\030\001 \001(\r:\0010\022-\n\rweight_filler\030\002 \001(" + "\0132\026.caffe.FillerParameter\022+\n\013bias_filler" + "\030\003 \001(\0132\026.caffe.FillerParameter\022\031\n\ndebug_" + "info\030\004 \001(\010:\005false\022\034\n\rexpose_hidden\030\005 \001(\010" + ":\005false\"\255\001\n\022ReductionParameter\022=\n\toperat" + "ion\030\001 \001(\0162%.caffe.ReductionParameter.Red" + "uctionOp:\003SUM\022\017\n\004axis\030\002 \001(\005:\0010\022\020\n\005coeff\030" + "\003 \001(\002:\0011\"5\n\013ReductionOp\022\007\n\003SUM\020\001\022\010\n\004ASUM" + "\020\002\022\t\n\005SUMSQ\020\003\022\010\n\004MEAN\020\004\"\215\001\n\rReLUParamete" + "r\022\031\n\016negative_slope\030\001 \001(\002:\0010\0224\n\006engine\030\002" + " \001(\0162\033.caffe.ReLUParameter.Engine:\007DEFAU" + "LT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005" + "CUDNN\020\002\"Z\n\020ReshapeParameter\022\037\n\005shape\030\001 \001" + "(\0132\020.caffe.BlobShape\022\017\n\004axis\030\002 \001(\005:\0010\022\024\n" + "\010num_axes\030\003 \001(\005:\002-1\"\245\001\n\016ScaleParameter\022\017" + "\n\004axis\030\001 \001(\005:\0011\022\023\n\010num_axes\030\002 \001(\005:\0011\022&\n\006" + "filler\030\003 \001(\0132\026.caffe.FillerParameter\022\030\n\t" + "bias_term\030\004 \001(\010:\005false\022+\n\013bias_filler\030\005 " + "\001(\0132\026.caffe.FillerParameter\"x\n\020SigmoidPa" + "rameter\0227\n\006engine\030\001 \001(\0162\036.caffe.SigmoidP" + "arameter.Engine:\007DEFAULT\"+\n\006Engine\022\013\n\007DE" + "FAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"L\n\016SlicePa" + "rameter\022\017\n\004axis\030\003 \001(\005:\0011\022\023\n\013slice_point\030" + "\002 \003(\r\022\024\n\tslice_dim\030\001 \001(\r:\0011\"\211\001\n\020SoftmaxP" + "arameter\0227\n\006engine\030\001 \001(\0162\036.caffe.Softmax" + "Parameter.Engine:\007DEFAULT\022\017\n\004axis\030\002 \001(\005:" + "\0011\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005" + "CUDNN\020\002\"r\n\rTanHParameter\0224\n\006engine\030\001 \001(\016" + "2\033.caffe.TanHParameter.Engine:\007DEFAULT\"+" + "\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDN" + "N\020\002\"/\n\rTileParameter\022\017\n\004axis\030\001 \001(\005:\0011\022\r\n" + "\005tiles\030\002 \001(\005\"*\n\022ThresholdParameter\022\024\n\tth" + "reshold\030\001 \001(\002:\0010\"\301\002\n\023WindowDataParameter" + "\022\016\n\006source\030\001 \001(\t\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tme" + "an_file\030\003 \001(\t\022\022\n\nbatch_size\030\004 \001(\r\022\024\n\tcro" + "p_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010:\005false\022\031" + "\n\014fg_threshold\030\007 \001(\002:\0030.5\022\031\n\014bg_threshol" + "d\030\010 \001(\002:\0030.5\022\031\n\013fg_fraction\030\t \001(\002:\0040.25\022" + "\026\n\013context_pad\030\n \001(\r:\0010\022\027\n\tcrop_mode\030\013 \001" + "(\t:\004warp\022\033\n\014cache_images\030\014 \001(\010:\005false\022\025\n" + "\013root_folder\030\r \001(\t:\000\"\353\001\n\014SPPParameter\022\026\n" + "\016pyramid_height\030\001 \001(\r\0221\n\004pool\030\002 \001(\0162\036.ca" + "ffe.SPPParameter.PoolMethod:\003MAX\0223\n\006engi" + "ne\030\006 \001(\0162\032.caffe.SPPParameter.Engine:\007DE" + "FAULT\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n" + "\nSTOCHASTIC\020\002\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005" + "CAFFE\020\001\022\t\n\005CUDNN\020\002\"\340\023\n\020V1LayerParameter\022" + "\016\n\006bottom\030\002 \003(\t\022\013\n\003top\030\003 \003(\t\022\014\n\004name\030\004 \001" + "(\t\022$\n\007include\030 \003(\0132\023.caffe.NetStateRule" + "\022$\n\007exclude\030! \003(\0132\023.caffe.NetStateRule\022/" + "\n\004type\030\005 \001(\0162!.caffe.V1LayerParameter.La" + "yerType\022\037\n\005blobs\030\006 \003(\0132\020.caffe.BlobProto" + "\022\016\n\005param\030\351\007 \003(\t\022>\n\017blob_share_mode\030\352\007 \003" + "(\0162$.caffe.V1LayerParameter.DimCheckMode" + "\022\020\n\010blobs_lr\030\007 \003(\002\022\024\n\014weight_decay\030\010 \003(\002" + "\022\023\n\013loss_weight\030# \003(\002\0220\n\016accuracy_param\030" + "\033 \001(\0132\030.caffe.AccuracyParameter\022,\n\014argma" + "x_param\030\027 \001(\0132\026.caffe.ArgMaxParameter\022,\n" + "\014concat_param\030\t \001(\0132\026.caffe.ConcatParame" + "ter\022\?\n\026contrastive_loss_param\030( \001(\0132\037.ca" + "ffe.ContrastiveLossParameter\0226\n\021convolut" + "ion_param\030\n \001(\0132\033.caffe.ConvolutionParam" + "eter\022(\n\ndata_param\030\013 \001(\0132\024.caffe.DataPar" + "ameter\022.\n\rdropout_param\030\014 \001(\0132\027.caffe.Dr" + "opoutParameter\0223\n\020dummy_data_param\030\032 \001(\013" + "2\031.caffe.DummyDataParameter\022.\n\reltwise_p" + "aram\030\030 \001(\0132\027.caffe.EltwiseParameter\022&\n\te" + "xp_param\030) \001(\0132\023.caffe.ExpParameter\0221\n\017h" + "df5_data_param\030\r \001(\0132\030.caffe.HDF5DataPar" + "ameter\0225\n\021hdf5_output_param\030\016 \001(\0132\032.caff" + "e.HDF5OutputParameter\0223\n\020hinge_loss_para" + "m\030\035 \001(\0132\031.caffe.HingeLossParameter\0223\n\020im" + "age_data_param\030\017 \001(\0132\031.caffe.ImageDataPa" + "rameter\0229\n\023infogain_loss_param\030\020 \001(\0132\034.c" + "affe.InfogainLossParameter\0229\n\023inner_prod" + "uct_param\030\021 \001(\0132\034.caffe.InnerProductPara" + "meter\022&\n\tlrn_param\030\022 \001(\0132\023.caffe.LRNPara" + "meter\0225\n\021memory_data_param\030\026 \001(\0132\032.caffe" + ".MemoryDataParameter\022&\n\tmvn_param\030\" \001(\0132" + "\023.caffe.MVNParameter\022.\n\rpooling_param\030\023 " + "\001(\0132\027.caffe.PoolingParameter\022*\n\013power_pa" + "ram\030\025 \001(\0132\025.caffe.PowerParameter\022(\n\nrelu" + "_param\030\036 \001(\0132\024.caffe.ReLUParameter\022.\n\rsi" + "gmoid_param\030& \001(\0132\027.caffe.SigmoidParamet" + "er\022.\n\rsoftmax_param\030\' \001(\0132\027.caffe.Softma" + "xParameter\022*\n\013slice_param\030\037 \001(\0132\025.caffe." + "SliceParameter\022(\n\ntanh_param\030% \001(\0132\024.caf" + "fe.TanHParameter\0222\n\017threshold_param\030\031 \001(" + "\0132\031.caffe.ThresholdParameter\0225\n\021window_d" + "ata_param\030\024 \001(\0132\032.caffe.WindowDataParame" + "ter\0227\n\017transform_param\030$ \001(\0132\036.caffe.Tra" + "nsformationParameter\022(\n\nloss_param\030* \001(\013" + "2\024.caffe.LossParameter\022&\n\005layer\030\001 \001(\0132\027." + "caffe.V0LayerParameter\"\330\004\n\tLayerType\022\010\n\004" + "NONE\020\000\022\n\n\006ABSVAL\020#\022\014\n\010ACCURACY\020\001\022\n\n\006ARGM" + "AX\020\036\022\010\n\004BNLL\020\002\022\n\n\006CONCAT\020\003\022\024\n\020CONTRASTIV" + "E_LOSS\020%\022\017\n\013CONVOLUTION\020\004\022\010\n\004DATA\020\005\022\021\n\rD" + "ECONVOLUTION\020\'\022\013\n\007DROPOUT\020\006\022\016\n\nDUMMY_DAT" + "A\020 \022\022\n\016EUCLIDEAN_LOSS\020\007\022\013\n\007ELTWISE\020\031\022\007\n\003" + "EXP\020&\022\013\n\007FLATTEN\020\010\022\r\n\tHDF5_DATA\020\t\022\017\n\013HDF" + "5_OUTPUT\020\n\022\016\n\nHINGE_LOSS\020\034\022\n\n\006IM2COL\020\013\022\016" + "\n\nIMAGE_DATA\020\014\022\021\n\rINFOGAIN_LOSS\020\r\022\021\n\rINN" + "ER_PRODUCT\020\016\022\007\n\003LRN\020\017\022\017\n\013MEMORY_DATA\020\035\022\035" + "\n\031MULTINOMIAL_LOGISTIC_LOSS\020\020\022\007\n\003MVN\020\"\022\013" + "\n\007POOLING\020\021\022\t\n\005POWER\020\032\022\010\n\004RELU\020\022\022\013\n\007SIGM" + "OID\020\023\022\036\n\032SIGMOID_CROSS_ENTROPY_LOSS\020\033\022\013\n" + "\007SILENCE\020$\022\013\n\007SOFTMAX\020\024\022\020\n\014SOFTMAX_LOSS\020" + "\025\022\t\n\005SPLIT\020\026\022\t\n\005SLICE\020!\022\010\n\004TANH\020\027\022\017\n\013WIN" + "DOW_DATA\020\030\022\r\n\tTHRESHOLD\020\037\"*\n\014DimCheckMod" + "e\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\375\007\n\020V0Laye" + "rParameter\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\022" + "\n\nnum_output\030\003 \001(\r\022\026\n\010biasterm\030\004 \001(\010:\004tr" + "ue\022-\n\rweight_filler\030\005 \001(\0132\026.caffe.Filler" + "Parameter\022+\n\013bias_filler\030\006 \001(\0132\026.caffe.F" + "illerParameter\022\016\n\003pad\030\007 \001(\r:\0010\022\022\n\nkernel" + "size\030\010 \001(\r\022\020\n\005group\030\t \001(\r:\0011\022\021\n\006stride\030\n" + " \001(\r:\0011\0225\n\004pool\030\013 \001(\0162\".caffe.V0LayerPar" + "ameter.PoolMethod:\003MAX\022\032\n\rdropout_ratio\030" + "\014 \001(\002:\0030.5\022\025\n\nlocal_size\030\r \001(\r:\0015\022\020\n\005alp" + "ha\030\016 \001(\002:\0011\022\022\n\004beta\030\017 \001(\002:\0040.75\022\014\n\001k\030\026 \001" + "(\002:\0011\022\016\n\006source\030\020 \001(\t\022\020\n\005scale\030\021 \001(\002:\0011\022" + "\020\n\010meanfile\030\022 \001(\t\022\021\n\tbatchsize\030\023 \001(\r\022\023\n\010" + "cropsize\030\024 \001(\r:\0010\022\025\n\006mirror\030\025 \001(\010:\005false" + "\022\037\n\005blobs\0302 \003(\0132\020.caffe.BlobProto\022\020\n\010blo" + "bs_lr\0303 \003(\002\022\024\n\014weight_decay\0304 \003(\002\022\024\n\tran" + "d_skip\0305 \001(\r:\0010\022\035\n\020det_fg_threshold\0306 \001(" + "\002:\0030.5\022\035\n\020det_bg_threshold\0307 \001(\002:\0030.5\022\035\n" + "\017det_fg_fraction\0308 \001(\002:\0040.25\022\032\n\017det_cont" + "ext_pad\030: \001(\r:\0010\022\033\n\rdet_crop_mode\030; \001(\t:" + "\004warp\022\022\n\007new_num\030< \001(\005:\0010\022\027\n\014new_channel" + "s\030= \001(\005:\0010\022\025\n\nnew_height\030> \001(\005:\0010\022\024\n\tnew" + "_width\030\? \001(\005:\0010\022\035\n\016shuffle_images\030@ \001(\010:" + "\005false\022\025\n\nconcat_dim\030A \001(\r:\0011\0226\n\021hdf5_ou" + "tput_param\030\351\007 \001(\0132\032.caffe.HDF5OutputPara" + "meter\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n" + "\nSTOCHASTIC\020\002\"W\n\016PReLUParameter\022&\n\006fille" + "r\030\001 \001(\0132\026.caffe.FillerParameter\022\035\n\016chann" + "el_shared\030\002 \001(\010:\005false\"\207\001\n\016NormalizedBBo" + "x\022\014\n\004xmin\030\001 \001(\002\022\014\n\004ymin\030\002 \001(\002\022\014\n\004xmax\030\003 " + "\001(\002\022\014\n\004ymax\030\004 \001(\002\022\r\n\005label\030\005 \001(\005\022\021\n\tdiff" + "icult\030\006 \001(\010\022\r\n\005score\030\007 \001(\002\022\014\n\004size\030\010 \001(\002" + "*\034\n\005Phase\022\t\n\005TRAIN\020\000\022\010\n\004TEST\020\001", 16870); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "caffe.proto", &protobuf_RegisterTypes); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_caffe_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_caffe_2eproto_once_); +void protobuf_AddDesc_caffe_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_caffe_2eproto_once_, + &protobuf_AddDesc_caffe_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_caffe_2eproto { + StaticDescriptorInitializer_caffe_2eproto() { + protobuf_AddDesc_caffe_2eproto(); + } +} static_descriptor_initializer_caffe_2eproto_; +const ::google::protobuf::EnumDescriptor* Phase_descriptor() { + protobuf_AssignDescriptorsOnce(); + return Phase_descriptor_; +} +bool Phase_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BlobShape::kDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BlobShape::BlobShape() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.BlobShape) +} + +void BlobShape::InitAsDefaultInstance() { +} + +BlobShape::BlobShape(const BlobShape& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.BlobShape) +} + +void BlobShape::SharedCtor() { + _cached_size_ = 0; +} + +BlobShape::~BlobShape() { + // @@protoc_insertion_point(destructor:caffe.BlobShape) + SharedDtor(); +} + +void BlobShape::SharedDtor() { +} + +void BlobShape::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BlobShape::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BlobShape_descriptor_; +} + +const BlobShape& BlobShape::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed BlobShape_default_instance_; + +BlobShape* BlobShape::New(::google::protobuf::Arena* arena) const { + BlobShape* n = new BlobShape; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void BlobShape::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.BlobShape) + dim_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool BlobShape::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.BlobShape) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int64 dim = 1 [packed = true]; + case 1: { + if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dim()))); + } else if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 10, input, this->mutable_dim()))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.BlobShape) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.BlobShape) + return false; +#undef DO_ +} + +void BlobShape::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.BlobShape) + // repeated int64 dim = 1 [packed = true]; + if (this->dim_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_dim_cached_byte_size_); + } + for (int i = 0; i < this->dim_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->dim(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.BlobShape) +} + +::google::protobuf::uint8* BlobShape::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.BlobShape) + // repeated int64 dim = 1 [packed = true]; + if (this->dim_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _dim_cached_byte_size_, target); + } + for (int i = 0; i < this->dim_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->dim(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.BlobShape) + return target; +} + +size_t BlobShape::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.BlobShape) + size_t total_size = 0; + + // repeated int64 dim = 1 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->dim_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->dim(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dim_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobShape::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.BlobShape) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const BlobShape* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.BlobShape) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.BlobShape) + UnsafeMergeFrom(*source); + } +} + +void BlobShape::MergeFrom(const BlobShape& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.BlobShape) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void BlobShape::UnsafeMergeFrom(const BlobShape& from) { + GOOGLE_DCHECK(&from != this); + dim_.UnsafeMergeFrom(from.dim_); + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void BlobShape::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.BlobShape) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobShape::CopyFrom(const BlobShape& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.BlobShape) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool BlobShape::IsInitialized() const { + + return true; +} + +void BlobShape::Swap(BlobShape* other) { + if (other == this) return; + InternalSwap(other); +} +void BlobShape::InternalSwap(BlobShape* other) { + dim_.UnsafeArenaSwap(&other->dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata BlobShape::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BlobShape_descriptor_; + metadata.reflection = BlobShape_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BlobShape + +// repeated int64 dim = 1 [packed = true]; +int BlobShape::dim_size() const { + return dim_.size(); +} +void BlobShape::clear_dim() { + dim_.Clear(); +} +::google::protobuf::int64 BlobShape::dim(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobShape.dim) + return dim_.Get(index); +} +void BlobShape::set_dim(int index, ::google::protobuf::int64 value) { + dim_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobShape.dim) +} +void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobShape.dim) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:caffe.BlobShape.dim) + return dim_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobShape.dim) + return &dim_; +} + +inline const BlobShape* BlobShape::internal_default_instance() { + return &BlobShape_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BlobProto::kShapeFieldNumber; +const int BlobProto::kDataFieldNumber; +const int BlobProto::kDiffFieldNumber; +const int BlobProto::kDoubleDataFieldNumber; +const int BlobProto::kDoubleDiffFieldNumber; +const int BlobProto::kNumFieldNumber; +const int BlobProto::kChannelsFieldNumber; +const int BlobProto::kHeightFieldNumber; +const int BlobProto::kWidthFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BlobProto::BlobProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.BlobProto) +} + +void BlobProto::InitAsDefaultInstance() { + shape_ = const_cast< ::caffe::BlobShape*>( + ::caffe::BlobShape::internal_default_instance()); +} + +BlobProto::BlobProto(const BlobProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.BlobProto) +} + +void BlobProto::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + ::memset(&num_, 0, reinterpret_cast(&width_) - + reinterpret_cast(&num_) + sizeof(width_)); +} + +BlobProto::~BlobProto() { + // @@protoc_insertion_point(destructor:caffe.BlobProto) + SharedDtor(); +} + +void BlobProto::SharedDtor() { + if (this != &BlobProto_default_instance_.get()) { + delete shape_; + } +} + +void BlobProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BlobProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BlobProto_descriptor_; +} + +const BlobProto& BlobProto::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed BlobProto_default_instance_; + +BlobProto* BlobProto::New(::google::protobuf::Arena* arena) const { + BlobProto* n = new BlobProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void BlobProto::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.BlobProto) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(BlobProto, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 225u) { + ZR_(num_, height_); + if (has_shape()) { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + } + } + width_ = 0; + +#undef ZR_HELPER_ +#undef ZR_ + + data_.Clear(); + diff_.Clear(); + double_data_.Clear(); + double_diff_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool BlobProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.BlobProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 num = 1 [default = 0]; + case 1: { + if (tag == 8) { + set_has_num(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_channels; + break; + } + + // optional int32 channels = 2 [default = 0]; + case 2: { + if (tag == 16) { + parse_channels: + set_has_channels(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_height; + break; + } + + // optional int32 height = 3 [default = 0]; + case 3: { + if (tag == 24) { + parse_height: + set_has_height(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_width; + break; + } + + // optional int32 width = 4 [default = 0]; + case 4: { + if (tag == 32) { + parse_width: + set_has_width(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_data; + break; + } + + // repeated float data = 5 [packed = true]; + case 5: { + if (tag == 42) { + parse_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_data()))); + } else if (tag == 45) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 42, input, this->mutable_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_diff; + break; + } + + // repeated float diff = 6 [packed = true]; + case 6: { + if (tag == 50) { + parse_diff: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_diff()))); + } else if (tag == 53) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 50, input, this->mutable_diff()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_shape; + break; + } + + // optional .caffe.BlobShape shape = 7; + case 7: { + if (tag == 58) { + parse_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_double_data; + break; + } + + // repeated double double_data = 8 [packed = true]; + case 8: { + if (tag == 66) { + parse_double_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_double_data()))); + } else if (tag == 65) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 66, input, this->mutable_double_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_double_diff; + break; + } + + // repeated double double_diff = 9 [packed = true]; + case 9: { + if (tag == 74) { + parse_double_diff: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_double_diff()))); + } else if (tag == 73) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 74, input, this->mutable_double_diff()))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.BlobProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.BlobProto) + return false; +#undef DO_ +} + +void BlobProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.BlobProto) + // optional int32 num = 1 [default = 0]; + if (has_num()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->num(), output); + } + + // optional int32 channels = 2 [default = 0]; + if (has_channels()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->channels(), output); + } + + // optional int32 height = 3 [default = 0]; + if (has_height()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->height(), output); + } + + // optional int32 width = 4 [default = 0]; + if (has_width()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->width(), output); + } + + // repeated float data = 5 [packed = true]; + if (this->data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_data_cached_byte_size_); + } + for (int i = 0; i < this->data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloatNoTag( + this->data(i), output); + } + + // repeated float diff = 6 [packed = true]; + if (this->diff_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_diff_cached_byte_size_); + } + for (int i = 0; i < this->diff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloatNoTag( + this->diff(i), output); + } + + // optional .caffe.BlobShape shape = 7; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *this->shape_, output); + } + + // repeated double double_data = 8 [packed = true]; + if (this->double_data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_double_data_cached_byte_size_); + } + for (int i = 0; i < this->double_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteDoubleNoTag( + this->double_data(i), output); + } + + // repeated double double_diff = 9 [packed = true]; + if (this->double_diff_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_double_diff_cached_byte_size_); + } + for (int i = 0; i < this->double_diff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteDoubleNoTag( + this->double_diff(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.BlobProto) +} + +::google::protobuf::uint8* BlobProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.BlobProto) + // optional int32 num = 1 [default = 0]; + if (has_num()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->num(), target); + } + + // optional int32 channels = 2 [default = 0]; + if (has_channels()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->channels(), target); + } + + // optional int32 height = 3 [default = 0]; + if (has_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->height(), target); + } + + // optional int32 width = 4 [default = 0]; + if (has_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->width(), target); + } + + // repeated float data = 5 [packed = true]; + if (this->data_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _data_cached_byte_size_, target); + } + for (int i = 0; i < this->data_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->data(i), target); + } + + // repeated float diff = 6 [packed = true]; + if (this->diff_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _diff_cached_byte_size_, target); + } + for (int i = 0; i < this->diff_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->diff(i), target); + } + + // optional .caffe.BlobShape shape = 7; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *this->shape_, false, target); + } + + // repeated double double_data = 8 [packed = true]; + if (this->double_data_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _double_data_cached_byte_size_, target); + } + for (int i = 0; i < this->double_data_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->double_data(i), target); + } + + // repeated double double_diff = 9 [packed = true]; + if (this->double_diff_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _double_diff_cached_byte_size_, target); + } + for (int i = 0; i < this->double_diff_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->double_diff(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.BlobProto) + return target; +} + +size_t BlobProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.BlobProto) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 225u) { + // optional .caffe.BlobShape shape = 7; + if (has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->shape_); + } + + // optional int32 num = 1 [default = 0]; + if (has_num()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num()); + } + + // optional int32 channels = 2 [default = 0]; + if (has_channels()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->channels()); + } + + // optional int32 height = 3 [default = 0]; + if (has_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->height()); + } + + } + // optional int32 width = 4 [default = 0]; + if (has_width()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->width()); + } + + // repeated float data = 5 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->data_size(); + data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _data_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float diff = 6 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->diff_size(); + data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _diff_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_data = 8 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->double_data_size(); + data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_data_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_diff = 9 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->double_diff_size(); + data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_diff_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.BlobProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const BlobProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.BlobProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.BlobProto) + UnsafeMergeFrom(*source); + } +} + +void BlobProto::MergeFrom(const BlobProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.BlobProto) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void BlobProto::UnsafeMergeFrom(const BlobProto& from) { + GOOGLE_DCHECK(&from != this); + data_.UnsafeMergeFrom(from.data_); + diff_.UnsafeMergeFrom(from.diff_); + double_data_.UnsafeMergeFrom(from.double_data_); + double_diff_.UnsafeMergeFrom(from.double_diff_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::caffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_num()) { + set_num(from.num()); + } + if (from.has_channels()) { + set_channels(from.channels()); + } + if (from.has_height()) { + set_height(from.height()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_width()) { + set_width(from.width()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void BlobProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.BlobProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobProto::CopyFrom(const BlobProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.BlobProto) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool BlobProto::IsInitialized() const { + + return true; +} + +void BlobProto::Swap(BlobProto* other) { + if (other == this) return; + InternalSwap(other); +} +void BlobProto::InternalSwap(BlobProto* other) { + std::swap(shape_, other->shape_); + data_.UnsafeArenaSwap(&other->data_); + diff_.UnsafeArenaSwap(&other->diff_); + double_data_.UnsafeArenaSwap(&other->double_data_); + double_diff_.UnsafeArenaSwap(&other->double_diff_); + std::swap(num_, other->num_); + std::swap(channels_, other->channels_); + std::swap(height_, other->height_); + std::swap(width_, other->width_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata BlobProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BlobProto_descriptor_; + metadata.reflection = BlobProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BlobProto + +// optional .caffe.BlobShape shape = 7; +bool BlobProto::has_shape() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void BlobProto::set_has_shape() { + _has_bits_[0] |= 0x00000001u; +} +void BlobProto::clear_has_shape() { + _has_bits_[0] &= ~0x00000001u; +} +void BlobProto::clear_shape() { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::caffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.shape) + return shape_ != NULL ? *shape_ + : *::caffe::BlobShape::internal_default_instance(); +} +::caffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::caffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:caffe.BlobProto.shape) + return shape_; +} +::caffe::BlobShape* BlobProto::release_shape() { + // @@protoc_insertion_point(field_release:caffe.BlobProto.shape) + clear_has_shape(); + ::caffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void BlobProto::set_allocated_shape(::caffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.BlobProto.shape) +} + +// repeated float data = 5 [packed = true]; +int BlobProto::data_size() const { + return data_.size(); +} +void BlobProto::clear_data() { + data_.Clear(); +} +float BlobProto::data(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.data) + return data_.Get(index); +} +void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.data) +} +void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.data) +} +const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.data) + return data_; +} +::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.data) + return &data_; +} + +// repeated float diff = 6 [packed = true]; +int BlobProto::diff_size() const { + return diff_.size(); +} +void BlobProto::clear_diff() { + diff_.Clear(); +} +float BlobProto::diff(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.diff) + return diff_.Get(index); +} +void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.diff) +} +void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.diff) +} +const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.diff) + return diff_; +} +::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.diff) + return &diff_; +} + +// repeated double double_data = 8 [packed = true]; +int BlobProto::double_data_size() const { + return double_data_.size(); +} +void BlobProto::clear_double_data() { + double_data_.Clear(); +} +double BlobProto::double_data(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.double_data) + return double_data_.Get(index); +} +void BlobProto::set_double_data(int index, double value) { + double_data_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.double_data) +} +void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.double_data) +} +const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.double_data) + return double_data_; +} +::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.double_data) + return &double_data_; +} + +// repeated double double_diff = 9 [packed = true]; +int BlobProto::double_diff_size() const { + return double_diff_.size(); +} +void BlobProto::clear_double_diff() { + double_diff_.Clear(); +} +double BlobProto::double_diff(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.double_diff) + return double_diff_.Get(index); +} +void BlobProto::set_double_diff(int index, double value) { + double_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.double_diff) +} +void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.double_diff) +} +const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.double_diff) + return double_diff_; +} +::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.double_diff) + return &double_diff_; +} + +// optional int32 num = 1 [default = 0]; +bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000020u; +} +void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000020u; +} +void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} +::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.num) + return num_; +} +void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000040u; +} +void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000040u; +} +void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.channels) + return channels_; +} +void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000080u; +} +void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000080u; +} +void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} +::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.height) + return height_; +} +void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000100u; +} +void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000100u; +} +void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} +::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.width) + return width_; +} +void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.width) +} + +inline const BlobProto* BlobProto::internal_default_instance() { + return &BlobProto_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BlobProtoVector::kBlobsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BlobProtoVector::BlobProtoVector() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.BlobProtoVector) +} + +void BlobProtoVector::InitAsDefaultInstance() { +} + +BlobProtoVector::BlobProtoVector(const BlobProtoVector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.BlobProtoVector) +} + +void BlobProtoVector::SharedCtor() { + _cached_size_ = 0; +} + +BlobProtoVector::~BlobProtoVector() { + // @@protoc_insertion_point(destructor:caffe.BlobProtoVector) + SharedDtor(); +} + +void BlobProtoVector::SharedDtor() { +} + +void BlobProtoVector::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BlobProtoVector::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BlobProtoVector_descriptor_; +} + +const BlobProtoVector& BlobProtoVector::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed BlobProtoVector_default_instance_; + +BlobProtoVector* BlobProtoVector::New(::google::protobuf::Arena* arena) const { + BlobProtoVector* n = new BlobProtoVector; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void BlobProtoVector::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.BlobProtoVector) + blobs_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool BlobProtoVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.BlobProtoVector) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .caffe.BlobProto blobs = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_blobs; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.BlobProtoVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.BlobProtoVector) + return false; +#undef DO_ +} + +void BlobProtoVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.BlobProtoVector) + // repeated .caffe.BlobProto blobs = 1; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->blobs(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.BlobProtoVector) +} + +::google::protobuf::uint8* BlobProtoVector::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.BlobProtoVector) + // repeated .caffe.BlobProto blobs = 1; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->blobs(i), false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.BlobProtoVector) + return target; +} + +size_t BlobProtoVector::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.BlobProtoVector) + size_t total_size = 0; + + // repeated .caffe.BlobProto blobs = 1; + { + unsigned int count = this->blobs_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProtoVector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.BlobProtoVector) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const BlobProtoVector* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.BlobProtoVector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.BlobProtoVector) + UnsafeMergeFrom(*source); + } +} + +void BlobProtoVector::MergeFrom(const BlobProtoVector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.BlobProtoVector) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void BlobProtoVector::UnsafeMergeFrom(const BlobProtoVector& from) { + GOOGLE_DCHECK(&from != this); + blobs_.MergeFrom(from.blobs_); + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void BlobProtoVector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.BlobProtoVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobProtoVector::CopyFrom(const BlobProtoVector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.BlobProtoVector) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool BlobProtoVector::IsInitialized() const { + + return true; +} + +void BlobProtoVector::Swap(BlobProtoVector* other) { + if (other == this) return; + InternalSwap(other); +} +void BlobProtoVector::InternalSwap(BlobProtoVector* other) { + blobs_.UnsafeArenaSwap(&other->blobs_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata BlobProtoVector::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BlobProtoVector_descriptor_; + metadata.reflection = BlobProtoVector_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BlobProtoVector + +// repeated .caffe.BlobProto blobs = 1; +int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +const ::caffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +::caffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +::caffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProtoVector.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:caffe.BlobProtoVector.blobs) + return blobs_; +} + +inline const BlobProtoVector* BlobProtoVector::internal_default_instance() { + return &BlobProtoVector_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PermuteParameter::kOrderFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PermuteParameter::PermuteParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.PermuteParameter) +} + +void PermuteParameter::InitAsDefaultInstance() { +} + +PermuteParameter::PermuteParameter(const PermuteParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.PermuteParameter) +} + +void PermuteParameter::SharedCtor() { + _cached_size_ = 0; +} + +PermuteParameter::~PermuteParameter() { + // @@protoc_insertion_point(destructor:caffe.PermuteParameter) + SharedDtor(); +} + +void PermuteParameter::SharedDtor() { +} + +void PermuteParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PermuteParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PermuteParameter_descriptor_; +} + +const PermuteParameter& PermuteParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed PermuteParameter_default_instance_; + +PermuteParameter* PermuteParameter::New(::google::protobuf::Arena* arena) const { + PermuteParameter* n = new PermuteParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void PermuteParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.PermuteParameter) + order_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool PermuteParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.PermuteParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated uint32 order = 1; + case 1: { + if (tag == 8) { + parse_order: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 8, input, this->mutable_order()))); + } else if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_order()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8)) goto parse_order; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.PermuteParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.PermuteParameter) + return false; +#undef DO_ +} + +void PermuteParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.PermuteParameter) + // repeated uint32 order = 1; + for (int i = 0; i < this->order_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 1, this->order(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.PermuteParameter) +} + +::google::protobuf::uint8* PermuteParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.PermuteParameter) + // repeated uint32 order = 1; + for (int i = 0; i < this->order_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(1, this->order(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.PermuteParameter) + return target; +} + +size_t PermuteParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.PermuteParameter) + size_t total_size = 0; + + // repeated uint32 order = 1; + { + size_t data_size = 0; + unsigned int count = this->order_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->order(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->order_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PermuteParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.PermuteParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const PermuteParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.PermuteParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.PermuteParameter) + UnsafeMergeFrom(*source); + } +} + +void PermuteParameter::MergeFrom(const PermuteParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.PermuteParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void PermuteParameter::UnsafeMergeFrom(const PermuteParameter& from) { + GOOGLE_DCHECK(&from != this); + order_.UnsafeMergeFrom(from.order_); + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void PermuteParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.PermuteParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PermuteParameter::CopyFrom(const PermuteParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.PermuteParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool PermuteParameter::IsInitialized() const { + + return true; +} + +void PermuteParameter::Swap(PermuteParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void PermuteParameter::InternalSwap(PermuteParameter* other) { + order_.UnsafeArenaSwap(&other->order_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata PermuteParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PermuteParameter_descriptor_; + metadata.reflection = PermuteParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PermuteParameter + +// repeated uint32 order = 1; +int PermuteParameter::order_size() const { + return order_.size(); +} +void PermuteParameter::clear_order() { + order_.Clear(); +} +::google::protobuf::uint32 PermuteParameter::order(int index) const { + // @@protoc_insertion_point(field_get:caffe.PermuteParameter.order) + return order_.Get(index); +} +void PermuteParameter::set_order(int index, ::google::protobuf::uint32 value) { + order_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.PermuteParameter.order) +} +void PermuteParameter::add_order(::google::protobuf::uint32 value) { + order_.Add(value); + // @@protoc_insertion_point(field_add:caffe.PermuteParameter.order) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +PermuteParameter::order() const { + // @@protoc_insertion_point(field_list:caffe.PermuteParameter.order) + return order_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +PermuteParameter::mutable_order() { + // @@protoc_insertion_point(field_mutable_list:caffe.PermuteParameter.order) + return &order_; +} + +inline const PermuteParameter* PermuteParameter::internal_default_instance() { + return &PermuteParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NormalizeBBoxParameter::kAcrossSpatialFieldNumber; +const int NormalizeBBoxParameter::kScaleFillerFieldNumber; +const int NormalizeBBoxParameter::kChannelSharedFieldNumber; +const int NormalizeBBoxParameter::kEpsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NormalizeBBoxParameter::NormalizeBBoxParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.NormalizeBBoxParameter) +} + +void NormalizeBBoxParameter::InitAsDefaultInstance() { + scale_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +NormalizeBBoxParameter::NormalizeBBoxParameter(const NormalizeBBoxParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.NormalizeBBoxParameter) +} + +void NormalizeBBoxParameter::SharedCtor() { + _cached_size_ = 0; + scale_filler_ = NULL; + across_spatial_ = true; + channel_shared_ = true; + eps_ = 1e-10f; +} + +NormalizeBBoxParameter::~NormalizeBBoxParameter() { + // @@protoc_insertion_point(destructor:caffe.NormalizeBBoxParameter) + SharedDtor(); +} + +void NormalizeBBoxParameter::SharedDtor() { + if (this != &NormalizeBBoxParameter_default_instance_.get()) { + delete scale_filler_; + } +} + +void NormalizeBBoxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NormalizeBBoxParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NormalizeBBoxParameter_descriptor_; +} + +const NormalizeBBoxParameter& NormalizeBBoxParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NormalizeBBoxParameter_default_instance_; + +NormalizeBBoxParameter* NormalizeBBoxParameter::New(::google::protobuf::Arena* arena) const { + NormalizeBBoxParameter* n = new NormalizeBBoxParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void NormalizeBBoxParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.NormalizeBBoxParameter) + if (_has_bits_[0 / 32] & 15u) { + across_spatial_ = true; + if (has_scale_filler()) { + if (scale_filler_ != NULL) scale_filler_->::caffe::FillerParameter::Clear(); + } + channel_shared_ = true; + eps_ = 1e-10f; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool NormalizeBBoxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.NormalizeBBoxParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool across_spatial = 1 [default = true]; + case 1: { + if (tag == 8) { + set_has_across_spatial(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &across_spatial_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_scale_filler; + break; + } + + // optional .caffe.FillerParameter scale_filler = 2; + case 2: { + if (tag == 18) { + parse_scale_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_scale_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_channel_shared; + break; + } + + // optional bool channel_shared = 3 [default = true]; + case 3: { + if (tag == 24) { + parse_channel_shared: + set_has_channel_shared(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(37)) goto parse_eps; + break; + } + + // optional float eps = 4 [default = 1e-10]; + case 4: { + if (tag == 37) { + parse_eps: + set_has_eps(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.NormalizeBBoxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.NormalizeBBoxParameter) + return false; +#undef DO_ +} + +void NormalizeBBoxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.NormalizeBBoxParameter) + // optional bool across_spatial = 1 [default = true]; + if (has_across_spatial()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->across_spatial(), output); + } + + // optional .caffe.FillerParameter scale_filler = 2; + if (has_scale_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *this->scale_filler_, output); + } + + // optional bool channel_shared = 3 [default = true]; + if (has_channel_shared()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->channel_shared(), output); + } + + // optional float eps = 4 [default = 1e-10]; + if (has_eps()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->eps(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.NormalizeBBoxParameter) +} + +::google::protobuf::uint8* NormalizeBBoxParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.NormalizeBBoxParameter) + // optional bool across_spatial = 1 [default = true]; + if (has_across_spatial()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->across_spatial(), target); + } + + // optional .caffe.FillerParameter scale_filler = 2; + if (has_scale_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *this->scale_filler_, false, target); + } + + // optional bool channel_shared = 3 [default = true]; + if (has_channel_shared()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->channel_shared(), target); + } + + // optional float eps = 4 [default = 1e-10]; + if (has_eps()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->eps(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.NormalizeBBoxParameter) + return target; +} + +size_t NormalizeBBoxParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.NormalizeBBoxParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 15u) { + // optional bool across_spatial = 1 [default = true]; + if (has_across_spatial()) { + total_size += 1 + 1; + } + + // optional .caffe.FillerParameter scale_filler = 2; + if (has_scale_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->scale_filler_); + } + + // optional bool channel_shared = 3 [default = true]; + if (has_channel_shared()) { + total_size += 1 + 1; + } + + // optional float eps = 4 [default = 1e-10]; + if (has_eps()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NormalizeBBoxParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.NormalizeBBoxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NormalizeBBoxParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.NormalizeBBoxParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.NormalizeBBoxParameter) + UnsafeMergeFrom(*source); + } +} + +void NormalizeBBoxParameter::MergeFrom(const NormalizeBBoxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.NormalizeBBoxParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NormalizeBBoxParameter::UnsafeMergeFrom(const NormalizeBBoxParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_across_spatial()) { + set_across_spatial(from.across_spatial()); + } + if (from.has_scale_filler()) { + mutable_scale_filler()->::caffe::FillerParameter::MergeFrom(from.scale_filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + if (from.has_eps()) { + set_eps(from.eps()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void NormalizeBBoxParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.NormalizeBBoxParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NormalizeBBoxParameter::CopyFrom(const NormalizeBBoxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.NormalizeBBoxParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NormalizeBBoxParameter::IsInitialized() const { + + return true; +} + +void NormalizeBBoxParameter::Swap(NormalizeBBoxParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void NormalizeBBoxParameter::InternalSwap(NormalizeBBoxParameter* other) { + std::swap(across_spatial_, other->across_spatial_); + std::swap(scale_filler_, other->scale_filler_); + std::swap(channel_shared_, other->channel_shared_); + std::swap(eps_, other->eps_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NormalizeBBoxParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NormalizeBBoxParameter_descriptor_; + metadata.reflection = NormalizeBBoxParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NormalizeBBoxParameter + +// optional bool across_spatial = 1 [default = true]; +bool NormalizeBBoxParameter::has_across_spatial() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void NormalizeBBoxParameter::set_has_across_spatial() { + _has_bits_[0] |= 0x00000001u; +} +void NormalizeBBoxParameter::clear_has_across_spatial() { + _has_bits_[0] &= ~0x00000001u; +} +void NormalizeBBoxParameter::clear_across_spatial() { + across_spatial_ = true; + clear_has_across_spatial(); +} +bool NormalizeBBoxParameter::across_spatial() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.across_spatial) + return across_spatial_; +} +void NormalizeBBoxParameter::set_across_spatial(bool value) { + set_has_across_spatial(); + across_spatial_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizeBBoxParameter.across_spatial) +} + +// optional .caffe.FillerParameter scale_filler = 2; +bool NormalizeBBoxParameter::has_scale_filler() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void NormalizeBBoxParameter::set_has_scale_filler() { + _has_bits_[0] |= 0x00000002u; +} +void NormalizeBBoxParameter::clear_has_scale_filler() { + _has_bits_[0] &= ~0x00000002u; +} +void NormalizeBBoxParameter::clear_scale_filler() { + if (scale_filler_ != NULL) scale_filler_->::caffe::FillerParameter::Clear(); + clear_has_scale_filler(); +} +const ::caffe::FillerParameter& NormalizeBBoxParameter::scale_filler() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.scale_filler) + return scale_filler_ != NULL ? *scale_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* NormalizeBBoxParameter::mutable_scale_filler() { + set_has_scale_filler(); + if (scale_filler_ == NULL) { + scale_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.NormalizeBBoxParameter.scale_filler) + return scale_filler_; +} +::caffe::FillerParameter* NormalizeBBoxParameter::release_scale_filler() { + // @@protoc_insertion_point(field_release:caffe.NormalizeBBoxParameter.scale_filler) + clear_has_scale_filler(); + ::caffe::FillerParameter* temp = scale_filler_; + scale_filler_ = NULL; + return temp; +} +void NormalizeBBoxParameter::set_allocated_scale_filler(::caffe::FillerParameter* scale_filler) { + delete scale_filler_; + scale_filler_ = scale_filler; + if (scale_filler) { + set_has_scale_filler(); + } else { + clear_has_scale_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.NormalizeBBoxParameter.scale_filler) +} + +// optional bool channel_shared = 3 [default = true]; +bool NormalizeBBoxParameter::has_channel_shared() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void NormalizeBBoxParameter::set_has_channel_shared() { + _has_bits_[0] |= 0x00000004u; +} +void NormalizeBBoxParameter::clear_has_channel_shared() { + _has_bits_[0] &= ~0x00000004u; +} +void NormalizeBBoxParameter::clear_channel_shared() { + channel_shared_ = true; + clear_has_channel_shared(); +} +bool NormalizeBBoxParameter::channel_shared() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.channel_shared) + return channel_shared_; +} +void NormalizeBBoxParameter::set_channel_shared(bool value) { + set_has_channel_shared(); + channel_shared_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizeBBoxParameter.channel_shared) +} + +// optional float eps = 4 [default = 1e-10]; +bool NormalizeBBoxParameter::has_eps() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void NormalizeBBoxParameter::set_has_eps() { + _has_bits_[0] |= 0x00000008u; +} +void NormalizeBBoxParameter::clear_has_eps() { + _has_bits_[0] &= ~0x00000008u; +} +void NormalizeBBoxParameter::clear_eps() { + eps_ = 1e-10f; + clear_has_eps(); +} +float NormalizeBBoxParameter::eps() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.eps) + return eps_; +} +void NormalizeBBoxParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizeBBoxParameter.eps) +} + +inline const NormalizeBBoxParameter* NormalizeBBoxParameter::internal_default_instance() { + return &NormalizeBBoxParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* PriorBoxParameter_CodeType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return PriorBoxParameter_CodeType_descriptor_; +} +bool PriorBoxParameter_CodeType_IsValid(int value) { + switch (value) { + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const PriorBoxParameter_CodeType PriorBoxParameter::CORNER; +const PriorBoxParameter_CodeType PriorBoxParameter::CENTER_SIZE; +const PriorBoxParameter_CodeType PriorBoxParameter::CodeType_MIN; +const PriorBoxParameter_CodeType PriorBoxParameter::CodeType_MAX; +const int PriorBoxParameter::CodeType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PriorBoxParameter::kMinSizeFieldNumber; +const int PriorBoxParameter::kMaxSizeFieldNumber; +const int PriorBoxParameter::kAspectRatioFieldNumber; +const int PriorBoxParameter::kFlipFieldNumber; +const int PriorBoxParameter::kClipFieldNumber; +const int PriorBoxParameter::kVarianceFieldNumber; +const int PriorBoxParameter::kImgSizeFieldNumber; +const int PriorBoxParameter::kImgHFieldNumber; +const int PriorBoxParameter::kImgWFieldNumber; +const int PriorBoxParameter::kStepFieldNumber; +const int PriorBoxParameter::kStepHFieldNumber; +const int PriorBoxParameter::kStepWFieldNumber; +const int PriorBoxParameter::kOffsetFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PriorBoxParameter::PriorBoxParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.PriorBoxParameter) +} + +void PriorBoxParameter::InitAsDefaultInstance() { +} + +PriorBoxParameter::PriorBoxParameter(const PriorBoxParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.PriorBoxParameter) +} + +void PriorBoxParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&min_size_, 0, reinterpret_cast(&step_w_) - + reinterpret_cast(&min_size_) + sizeof(step_w_)); + flip_ = true; + clip_ = true; + offset_ = 0.5f; +} + +PriorBoxParameter::~PriorBoxParameter() { + // @@protoc_insertion_point(destructor:caffe.PriorBoxParameter) + SharedDtor(); +} + +void PriorBoxParameter::SharedDtor() { +} + +void PriorBoxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PriorBoxParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PriorBoxParameter_descriptor_; +} + +const PriorBoxParameter& PriorBoxParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed PriorBoxParameter_default_instance_; + +PriorBoxParameter* PriorBoxParameter::New(::google::protobuf::Arena* arena) const { + PriorBoxParameter* n = new PriorBoxParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void PriorBoxParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.PriorBoxParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(PriorBoxParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 219u) { + ZR_(min_size_, img_h_); + flip_ = true; + clip_ = true; + } + if (_has_bits_[8 / 32] & 7936u) { + ZR_(img_w_, step_w_); + offset_ = 0.5f; + } + +#undef ZR_HELPER_ +#undef ZR_ + + aspect_ratio_.Clear(); + variance_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool PriorBoxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.PriorBoxParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float min_size = 1; + case 1: { + if (tag == 13) { + set_has_min_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_max_size; + break; + } + + // optional float max_size = 2; + case 2: { + if (tag == 21) { + parse_max_size: + set_has_max_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_aspect_ratio; + break; + } + + // repeated float aspect_ratio = 3; + case 3: { + if (tag == 29) { + parse_aspect_ratio: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 29, input, this->mutable_aspect_ratio()))); + } else if (tag == 26) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_aspect_ratio()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_aspect_ratio; + if (input->ExpectTag(32)) goto parse_flip; + break; + } + + // optional bool flip = 4 [default = true]; + case 4: { + if (tag == 32) { + parse_flip: + set_has_flip(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &flip_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_clip; + break; + } + + // optional bool clip = 5 [default = true]; + case 5: { + if (tag == 40) { + parse_clip: + set_has_clip(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &clip_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(53)) goto parse_variance; + break; + } + + // repeated float variance = 6; + case 6: { + if (tag == 53) { + parse_variance: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 53, input, this->mutable_variance()))); + } else if (tag == 50) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_variance()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(53)) goto parse_variance; + if (input->ExpectTag(56)) goto parse_img_size; + break; + } + + // optional uint32 img_size = 7; + case 7: { + if (tag == 56) { + parse_img_size: + set_has_img_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &img_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_img_h; + break; + } + + // optional uint32 img_h = 8; + case 8: { + if (tag == 64) { + parse_img_h: + set_has_img_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &img_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_img_w; + break; + } + + // optional uint32 img_w = 9; + case 9: { + if (tag == 72) { + parse_img_w: + set_has_img_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &img_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(85)) goto parse_step; + break; + } + + // optional float step = 10; + case 10: { + if (tag == 85) { + parse_step: + set_has_step(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &step_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(93)) goto parse_step_h; + break; + } + + // optional float step_h = 11; + case 11: { + if (tag == 93) { + parse_step_h: + set_has_step_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &step_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(101)) goto parse_step_w; + break; + } + + // optional float step_w = 12; + case 12: { + if (tag == 101) { + parse_step_w: + set_has_step_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &step_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(109)) goto parse_offset; + break; + } + + // optional float offset = 13 [default = 0.5]; + case 13: { + if (tag == 109) { + parse_offset: + set_has_offset(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &offset_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.PriorBoxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.PriorBoxParameter) + return false; +#undef DO_ +} + +void PriorBoxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.PriorBoxParameter) + // optional float min_size = 1; + if (has_min_size()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->min_size(), output); + } + + // optional float max_size = 2; + if (has_max_size()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->max_size(), output); + } + + // repeated float aspect_ratio = 3; + for (int i = 0; i < this->aspect_ratio_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 3, this->aspect_ratio(i), output); + } + + // optional bool flip = 4 [default = true]; + if (has_flip()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->flip(), output); + } + + // optional bool clip = 5 [default = true]; + if (has_clip()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->clip(), output); + } + + // repeated float variance = 6; + for (int i = 0; i < this->variance_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 6, this->variance(i), output); + } + + // optional uint32 img_size = 7; + if (has_img_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->img_size(), output); + } + + // optional uint32 img_h = 8; + if (has_img_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->img_h(), output); + } + + // optional uint32 img_w = 9; + if (has_img_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->img_w(), output); + } + + // optional float step = 10; + if (has_step()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->step(), output); + } + + // optional float step_h = 11; + if (has_step_h()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->step_h(), output); + } + + // optional float step_w = 12; + if (has_step_w()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(12, this->step_w(), output); + } + + // optional float offset = 13 [default = 0.5]; + if (has_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(13, this->offset(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.PriorBoxParameter) +} + +::google::protobuf::uint8* PriorBoxParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.PriorBoxParameter) + // optional float min_size = 1; + if (has_min_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->min_size(), target); + } + + // optional float max_size = 2; + if (has_max_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->max_size(), target); + } + + // repeated float aspect_ratio = 3; + for (int i = 0; i < this->aspect_ratio_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(3, this->aspect_ratio(i), target); + } + + // optional bool flip = 4 [default = true]; + if (has_flip()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->flip(), target); + } + + // optional bool clip = 5 [default = true]; + if (has_clip()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->clip(), target); + } + + // repeated float variance = 6; + for (int i = 0; i < this->variance_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(6, this->variance(i), target); + } + + // optional uint32 img_size = 7; + if (has_img_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->img_size(), target); + } + + // optional uint32 img_h = 8; + if (has_img_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->img_h(), target); + } + + // optional uint32 img_w = 9; + if (has_img_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->img_w(), target); + } + + // optional float step = 10; + if (has_step()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->step(), target); + } + + // optional float step_h = 11; + if (has_step_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->step_h(), target); + } + + // optional float step_w = 12; + if (has_step_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(12, this->step_w(), target); + } + + // optional float offset = 13 [default = 0.5]; + if (has_offset()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(13, this->offset(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.PriorBoxParameter) + return target; +} + +size_t PriorBoxParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.PriorBoxParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 219u) { + // optional float min_size = 1; + if (has_min_size()) { + total_size += 1 + 4; + } + + // optional float max_size = 2; + if (has_max_size()) { + total_size += 1 + 4; + } + + // optional bool flip = 4 [default = true]; + if (has_flip()) { + total_size += 1 + 1; + } + + // optional bool clip = 5 [default = true]; + if (has_clip()) { + total_size += 1 + 1; + } + + // optional uint32 img_size = 7; + if (has_img_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->img_size()); + } + + // optional uint32 img_h = 8; + if (has_img_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->img_h()); + } + + } + if (_has_bits_[8 / 32] & 7936u) { + // optional uint32 img_w = 9; + if (has_img_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->img_w()); + } + + // optional float step = 10; + if (has_step()) { + total_size += 1 + 4; + } + + // optional float step_h = 11; + if (has_step_h()) { + total_size += 1 + 4; + } + + // optional float step_w = 12; + if (has_step_w()) { + total_size += 1 + 4; + } + + // optional float offset = 13 [default = 0.5]; + if (has_offset()) { + total_size += 1 + 4; + } + + } + // repeated float aspect_ratio = 3; + { + size_t data_size = 0; + unsigned int count = this->aspect_ratio_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->aspect_ratio_size()); + total_size += data_size; + } + + // repeated float variance = 6; + { + size_t data_size = 0; + unsigned int count = this->variance_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->variance_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PriorBoxParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.PriorBoxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const PriorBoxParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.PriorBoxParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.PriorBoxParameter) + UnsafeMergeFrom(*source); + } +} + +void PriorBoxParameter::MergeFrom(const PriorBoxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.PriorBoxParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void PriorBoxParameter::UnsafeMergeFrom(const PriorBoxParameter& from) { + GOOGLE_DCHECK(&from != this); + aspect_ratio_.UnsafeMergeFrom(from.aspect_ratio_); + variance_.UnsafeMergeFrom(from.variance_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_min_size()) { + set_min_size(from.min_size()); + } + if (from.has_max_size()) { + set_max_size(from.max_size()); + } + if (from.has_flip()) { + set_flip(from.flip()); + } + if (from.has_clip()) { + set_clip(from.clip()); + } + if (from.has_img_size()) { + set_img_size(from.img_size()); + } + if (from.has_img_h()) { + set_img_h(from.img_h()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_img_w()) { + set_img_w(from.img_w()); + } + if (from.has_step()) { + set_step(from.step()); + } + if (from.has_step_h()) { + set_step_h(from.step_h()); + } + if (from.has_step_w()) { + set_step_w(from.step_w()); + } + if (from.has_offset()) { + set_offset(from.offset()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void PriorBoxParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.PriorBoxParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PriorBoxParameter::CopyFrom(const PriorBoxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.PriorBoxParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool PriorBoxParameter::IsInitialized() const { + + return true; +} + +void PriorBoxParameter::Swap(PriorBoxParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void PriorBoxParameter::InternalSwap(PriorBoxParameter* other) { + std::swap(min_size_, other->min_size_); + std::swap(max_size_, other->max_size_); + aspect_ratio_.UnsafeArenaSwap(&other->aspect_ratio_); + std::swap(flip_, other->flip_); + std::swap(clip_, other->clip_); + variance_.UnsafeArenaSwap(&other->variance_); + std::swap(img_size_, other->img_size_); + std::swap(img_h_, other->img_h_); + std::swap(img_w_, other->img_w_); + std::swap(step_, other->step_); + std::swap(step_h_, other->step_h_); + std::swap(step_w_, other->step_w_); + std::swap(offset_, other->offset_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata PriorBoxParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PriorBoxParameter_descriptor_; + metadata.reflection = PriorBoxParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PriorBoxParameter + +// optional float min_size = 1; +bool PriorBoxParameter::has_min_size() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void PriorBoxParameter::set_has_min_size() { + _has_bits_[0] |= 0x00000001u; +} +void PriorBoxParameter::clear_has_min_size() { + _has_bits_[0] &= ~0x00000001u; +} +void PriorBoxParameter::clear_min_size() { + min_size_ = 0; + clear_has_min_size(); +} +float PriorBoxParameter::min_size() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.min_size) + return min_size_; +} +void PriorBoxParameter::set_min_size(float value) { + set_has_min_size(); + min_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.min_size) +} + +// optional float max_size = 2; +bool PriorBoxParameter::has_max_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void PriorBoxParameter::set_has_max_size() { + _has_bits_[0] |= 0x00000002u; +} +void PriorBoxParameter::clear_has_max_size() { + _has_bits_[0] &= ~0x00000002u; +} +void PriorBoxParameter::clear_max_size() { + max_size_ = 0; + clear_has_max_size(); +} +float PriorBoxParameter::max_size() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.max_size) + return max_size_; +} +void PriorBoxParameter::set_max_size(float value) { + set_has_max_size(); + max_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.max_size) +} + +// repeated float aspect_ratio = 3; +int PriorBoxParameter::aspect_ratio_size() const { + return aspect_ratio_.size(); +} +void PriorBoxParameter::clear_aspect_ratio() { + aspect_ratio_.Clear(); +} +float PriorBoxParameter::aspect_ratio(int index) const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.aspect_ratio) + return aspect_ratio_.Get(index); +} +void PriorBoxParameter::set_aspect_ratio(int index, float value) { + aspect_ratio_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.aspect_ratio) +} +void PriorBoxParameter::add_aspect_ratio(float value) { + aspect_ratio_.Add(value); + // @@protoc_insertion_point(field_add:caffe.PriorBoxParameter.aspect_ratio) +} +const ::google::protobuf::RepeatedField< float >& +PriorBoxParameter::aspect_ratio() const { + // @@protoc_insertion_point(field_list:caffe.PriorBoxParameter.aspect_ratio) + return aspect_ratio_; +} +::google::protobuf::RepeatedField< float >* +PriorBoxParameter::mutable_aspect_ratio() { + // @@protoc_insertion_point(field_mutable_list:caffe.PriorBoxParameter.aspect_ratio) + return &aspect_ratio_; +} + +// optional bool flip = 4 [default = true]; +bool PriorBoxParameter::has_flip() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void PriorBoxParameter::set_has_flip() { + _has_bits_[0] |= 0x00000008u; +} +void PriorBoxParameter::clear_has_flip() { + _has_bits_[0] &= ~0x00000008u; +} +void PriorBoxParameter::clear_flip() { + flip_ = true; + clear_has_flip(); +} +bool PriorBoxParameter::flip() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.flip) + return flip_; +} +void PriorBoxParameter::set_flip(bool value) { + set_has_flip(); + flip_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.flip) +} + +// optional bool clip = 5 [default = true]; +bool PriorBoxParameter::has_clip() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void PriorBoxParameter::set_has_clip() { + _has_bits_[0] |= 0x00000010u; +} +void PriorBoxParameter::clear_has_clip() { + _has_bits_[0] &= ~0x00000010u; +} +void PriorBoxParameter::clear_clip() { + clip_ = true; + clear_has_clip(); +} +bool PriorBoxParameter::clip() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.clip) + return clip_; +} +void PriorBoxParameter::set_clip(bool value) { + set_has_clip(); + clip_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.clip) +} + +// repeated float variance = 6; +int PriorBoxParameter::variance_size() const { + return variance_.size(); +} +void PriorBoxParameter::clear_variance() { + variance_.Clear(); +} +float PriorBoxParameter::variance(int index) const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.variance) + return variance_.Get(index); +} +void PriorBoxParameter::set_variance(int index, float value) { + variance_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.variance) +} +void PriorBoxParameter::add_variance(float value) { + variance_.Add(value); + // @@protoc_insertion_point(field_add:caffe.PriorBoxParameter.variance) +} +const ::google::protobuf::RepeatedField< float >& +PriorBoxParameter::variance() const { + // @@protoc_insertion_point(field_list:caffe.PriorBoxParameter.variance) + return variance_; +} +::google::protobuf::RepeatedField< float >* +PriorBoxParameter::mutable_variance() { + // @@protoc_insertion_point(field_mutable_list:caffe.PriorBoxParameter.variance) + return &variance_; +} + +// optional uint32 img_size = 7; +bool PriorBoxParameter::has_img_size() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void PriorBoxParameter::set_has_img_size() { + _has_bits_[0] |= 0x00000040u; +} +void PriorBoxParameter::clear_has_img_size() { + _has_bits_[0] &= ~0x00000040u; +} +void PriorBoxParameter::clear_img_size() { + img_size_ = 0u; + clear_has_img_size(); +} +::google::protobuf::uint32 PriorBoxParameter::img_size() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.img_size) + return img_size_; +} +void PriorBoxParameter::set_img_size(::google::protobuf::uint32 value) { + set_has_img_size(); + img_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.img_size) +} + +// optional uint32 img_h = 8; +bool PriorBoxParameter::has_img_h() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void PriorBoxParameter::set_has_img_h() { + _has_bits_[0] |= 0x00000080u; +} +void PriorBoxParameter::clear_has_img_h() { + _has_bits_[0] &= ~0x00000080u; +} +void PriorBoxParameter::clear_img_h() { + img_h_ = 0u; + clear_has_img_h(); +} +::google::protobuf::uint32 PriorBoxParameter::img_h() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.img_h) + return img_h_; +} +void PriorBoxParameter::set_img_h(::google::protobuf::uint32 value) { + set_has_img_h(); + img_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.img_h) +} + +// optional uint32 img_w = 9; +bool PriorBoxParameter::has_img_w() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void PriorBoxParameter::set_has_img_w() { + _has_bits_[0] |= 0x00000100u; +} +void PriorBoxParameter::clear_has_img_w() { + _has_bits_[0] &= ~0x00000100u; +} +void PriorBoxParameter::clear_img_w() { + img_w_ = 0u; + clear_has_img_w(); +} +::google::protobuf::uint32 PriorBoxParameter::img_w() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.img_w) + return img_w_; +} +void PriorBoxParameter::set_img_w(::google::protobuf::uint32 value) { + set_has_img_w(); + img_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.img_w) +} + +// optional float step = 10; +bool PriorBoxParameter::has_step() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void PriorBoxParameter::set_has_step() { + _has_bits_[0] |= 0x00000200u; +} +void PriorBoxParameter::clear_has_step() { + _has_bits_[0] &= ~0x00000200u; +} +void PriorBoxParameter::clear_step() { + step_ = 0; + clear_has_step(); +} +float PriorBoxParameter::step() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.step) + return step_; +} +void PriorBoxParameter::set_step(float value) { + set_has_step(); + step_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.step) +} + +// optional float step_h = 11; +bool PriorBoxParameter::has_step_h() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void PriorBoxParameter::set_has_step_h() { + _has_bits_[0] |= 0x00000400u; +} +void PriorBoxParameter::clear_has_step_h() { + _has_bits_[0] &= ~0x00000400u; +} +void PriorBoxParameter::clear_step_h() { + step_h_ = 0; + clear_has_step_h(); +} +float PriorBoxParameter::step_h() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.step_h) + return step_h_; +} +void PriorBoxParameter::set_step_h(float value) { + set_has_step_h(); + step_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.step_h) +} + +// optional float step_w = 12; +bool PriorBoxParameter::has_step_w() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void PriorBoxParameter::set_has_step_w() { + _has_bits_[0] |= 0x00000800u; +} +void PriorBoxParameter::clear_has_step_w() { + _has_bits_[0] &= ~0x00000800u; +} +void PriorBoxParameter::clear_step_w() { + step_w_ = 0; + clear_has_step_w(); +} +float PriorBoxParameter::step_w() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.step_w) + return step_w_; +} +void PriorBoxParameter::set_step_w(float value) { + set_has_step_w(); + step_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.step_w) +} + +// optional float offset = 13 [default = 0.5]; +bool PriorBoxParameter::has_offset() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void PriorBoxParameter::set_has_offset() { + _has_bits_[0] |= 0x00001000u; +} +void PriorBoxParameter::clear_has_offset() { + _has_bits_[0] &= ~0x00001000u; +} +void PriorBoxParameter::clear_offset() { + offset_ = 0.5f; + clear_has_offset(); +} +float PriorBoxParameter::offset() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.offset) + return offset_; +} +void PriorBoxParameter::set_offset(float value) { + set_has_offset(); + offset_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.offset) +} + +inline const PriorBoxParameter* PriorBoxParameter::internal_default_instance() { + return &PriorBoxParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DetectionOutputParameter::kNumClassesFieldNumber; +const int DetectionOutputParameter::kShareLocationFieldNumber; +const int DetectionOutputParameter::kBackgroundLabelIdFieldNumber; +const int DetectionOutputParameter::kNmsParamFieldNumber; +const int DetectionOutputParameter::kSaveOutputParamFieldNumber; +const int DetectionOutputParameter::kCodeTypeFieldNumber; +const int DetectionOutputParameter::kVarianceEncodedInTargetFieldNumber; +const int DetectionOutputParameter::kKeepTopKFieldNumber; +const int DetectionOutputParameter::kConfidenceThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DetectionOutputParameter::DetectionOutputParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.DetectionOutputParameter) +} + +void DetectionOutputParameter::InitAsDefaultInstance() { + nms_param_ = const_cast< ::caffe::NonMaximumSuppressionParameter*>( + ::caffe::NonMaximumSuppressionParameter::internal_default_instance()); + save_output_param_ = const_cast< ::caffe::SaveOutputParameter*>( + ::caffe::SaveOutputParameter::internal_default_instance()); +} + +DetectionOutputParameter::DetectionOutputParameter(const DetectionOutputParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.DetectionOutputParameter) +} + +void DetectionOutputParameter::SharedCtor() { + _cached_size_ = 0; + nms_param_ = NULL; + save_output_param_ = NULL; + ::memset(&num_classes_, 0, reinterpret_cast(&confidence_threshold_) - + reinterpret_cast(&num_classes_) + sizeof(confidence_threshold_)); + keep_top_k_ = -1; + share_location_ = true; + code_type_ = 1; +} + +DetectionOutputParameter::~DetectionOutputParameter() { + // @@protoc_insertion_point(destructor:caffe.DetectionOutputParameter) + SharedDtor(); +} + +void DetectionOutputParameter::SharedDtor() { + if (this != &DetectionOutputParameter_default_instance_.get()) { + delete nms_param_; + delete save_output_param_; + } +} + +void DetectionOutputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DetectionOutputParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DetectionOutputParameter_descriptor_; +} + +const DetectionOutputParameter& DetectionOutputParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed DetectionOutputParameter_default_instance_; + +DetectionOutputParameter* DetectionOutputParameter::New(::google::protobuf::Arena* arena) const { + DetectionOutputParameter* n = new DetectionOutputParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DetectionOutputParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.DetectionOutputParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(DetectionOutputParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(num_classes_, variance_encoded_in_target_); + share_location_ = true; + if (has_nms_param()) { + if (nms_param_ != NULL) nms_param_->::caffe::NonMaximumSuppressionParameter::Clear(); + } + if (has_save_output_param()) { + if (save_output_param_ != NULL) save_output_param_->::caffe::SaveOutputParameter::Clear(); + } + code_type_ = 1; + keep_top_k_ = -1; + } + confidence_threshold_ = 0; + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DetectionOutputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.DetectionOutputParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 num_classes = 1; + case 1: { + if (tag == 8) { + set_has_num_classes(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_classes_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_share_location; + break; + } + + // optional bool share_location = 2 [default = true]; + case 2: { + if (tag == 16) { + parse_share_location: + set_has_share_location(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &share_location_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_background_label_id; + break; + } + + // optional int32 background_label_id = 3 [default = 0]; + case 3: { + if (tag == 24) { + parse_background_label_id: + set_has_background_label_id(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &background_label_id_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_nms_param; + break; + } + + // optional .caffe.NonMaximumSuppressionParameter nms_param = 4; + case 4: { + if (tag == 34) { + parse_nms_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_nms_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_save_output_param; + break; + } + + // optional .caffe.SaveOutputParameter save_output_param = 5; + case 5: { + if (tag == 42) { + parse_save_output_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_save_output_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_code_type; + break; + } + + // optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; + case 6: { + if (tag == 48) { + parse_code_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::PriorBoxParameter_CodeType_IsValid(value)) { + set_code_type(static_cast< ::caffe::PriorBoxParameter_CodeType >(value)); + } else { + mutable_unknown_fields()->AddVarint(6, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_keep_top_k; + break; + } + + // optional int32 keep_top_k = 7 [default = -1]; + case 7: { + if (tag == 56) { + parse_keep_top_k: + set_has_keep_top_k(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &keep_top_k_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_variance_encoded_in_target; + break; + } + + // optional bool variance_encoded_in_target = 8 [default = false]; + case 8: { + if (tag == 64) { + parse_variance_encoded_in_target: + set_has_variance_encoded_in_target(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &variance_encoded_in_target_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(77)) goto parse_confidence_threshold; + break; + } + + // optional float confidence_threshold = 9; + case 9: { + if (tag == 77) { + parse_confidence_threshold: + set_has_confidence_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &confidence_threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.DetectionOutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.DetectionOutputParameter) + return false; +#undef DO_ +} + +void DetectionOutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.DetectionOutputParameter) + // optional uint32 num_classes = 1; + if (has_num_classes()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_classes(), output); + } + + // optional bool share_location = 2 [default = true]; + if (has_share_location()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->share_location(), output); + } + + // optional int32 background_label_id = 3 [default = 0]; + if (has_background_label_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->background_label_id(), output); + } + + // optional .caffe.NonMaximumSuppressionParameter nms_param = 4; + if (has_nms_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *this->nms_param_, output); + } + + // optional .caffe.SaveOutputParameter save_output_param = 5; + if (has_save_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *this->save_output_param_, output); + } + + // optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; + if (has_code_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->code_type(), output); + } + + // optional int32 keep_top_k = 7 [default = -1]; + if (has_keep_top_k()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->keep_top_k(), output); + } + + // optional bool variance_encoded_in_target = 8 [default = false]; + if (has_variance_encoded_in_target()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->variance_encoded_in_target(), output); + } + + // optional float confidence_threshold = 9; + if (has_confidence_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->confidence_threshold(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.DetectionOutputParameter) +} + +::google::protobuf::uint8* DetectionOutputParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.DetectionOutputParameter) + // optional uint32 num_classes = 1; + if (has_num_classes()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_classes(), target); + } + + // optional bool share_location = 2 [default = true]; + if (has_share_location()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->share_location(), target); + } + + // optional int32 background_label_id = 3 [default = 0]; + if (has_background_label_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->background_label_id(), target); + } + + // optional .caffe.NonMaximumSuppressionParameter nms_param = 4; + if (has_nms_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *this->nms_param_, false, target); + } + + // optional .caffe.SaveOutputParameter save_output_param = 5; + if (has_save_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *this->save_output_param_, false, target); + } + + // optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; + if (has_code_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->code_type(), target); + } + + // optional int32 keep_top_k = 7 [default = -1]; + if (has_keep_top_k()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->keep_top_k(), target); + } + + // optional bool variance_encoded_in_target = 8 [default = false]; + if (has_variance_encoded_in_target()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->variance_encoded_in_target(), target); + } + + // optional float confidence_threshold = 9; + if (has_confidence_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->confidence_threshold(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.DetectionOutputParameter) + return target; +} + +size_t DetectionOutputParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.DetectionOutputParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional uint32 num_classes = 1; + if (has_num_classes()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_classes()); + } + + // optional bool share_location = 2 [default = true]; + if (has_share_location()) { + total_size += 1 + 1; + } + + // optional int32 background_label_id = 3 [default = 0]; + if (has_background_label_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->background_label_id()); + } + + // optional .caffe.NonMaximumSuppressionParameter nms_param = 4; + if (has_nms_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->nms_param_); + } + + // optional .caffe.SaveOutputParameter save_output_param = 5; + if (has_save_output_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->save_output_param_); + } + + // optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; + if (has_code_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->code_type()); + } + + // optional bool variance_encoded_in_target = 8 [default = false]; + if (has_variance_encoded_in_target()) { + total_size += 1 + 1; + } + + // optional int32 keep_top_k = 7 [default = -1]; + if (has_keep_top_k()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->keep_top_k()); + } + + } + // optional float confidence_threshold = 9; + if (has_confidence_threshold()) { + total_size += 1 + 4; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DetectionOutputParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.DetectionOutputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DetectionOutputParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.DetectionOutputParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.DetectionOutputParameter) + UnsafeMergeFrom(*source); + } +} + +void DetectionOutputParameter::MergeFrom(const DetectionOutputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.DetectionOutputParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void DetectionOutputParameter::UnsafeMergeFrom(const DetectionOutputParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_classes()) { + set_num_classes(from.num_classes()); + } + if (from.has_share_location()) { + set_share_location(from.share_location()); + } + if (from.has_background_label_id()) { + set_background_label_id(from.background_label_id()); + } + if (from.has_nms_param()) { + mutable_nms_param()->::caffe::NonMaximumSuppressionParameter::MergeFrom(from.nms_param()); + } + if (from.has_save_output_param()) { + mutable_save_output_param()->::caffe::SaveOutputParameter::MergeFrom(from.save_output_param()); + } + if (from.has_code_type()) { + set_code_type(from.code_type()); + } + if (from.has_variance_encoded_in_target()) { + set_variance_encoded_in_target(from.variance_encoded_in_target()); + } + if (from.has_keep_top_k()) { + set_keep_top_k(from.keep_top_k()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_confidence_threshold()) { + set_confidence_threshold(from.confidence_threshold()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void DetectionOutputParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.DetectionOutputParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DetectionOutputParameter::CopyFrom(const DetectionOutputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.DetectionOutputParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool DetectionOutputParameter::IsInitialized() const { + + return true; +} + +void DetectionOutputParameter::Swap(DetectionOutputParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void DetectionOutputParameter::InternalSwap(DetectionOutputParameter* other) { + std::swap(num_classes_, other->num_classes_); + std::swap(share_location_, other->share_location_); + std::swap(background_label_id_, other->background_label_id_); + std::swap(nms_param_, other->nms_param_); + std::swap(save_output_param_, other->save_output_param_); + std::swap(code_type_, other->code_type_); + std::swap(variance_encoded_in_target_, other->variance_encoded_in_target_); + std::swap(keep_top_k_, other->keep_top_k_); + std::swap(confidence_threshold_, other->confidence_threshold_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DetectionOutputParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DetectionOutputParameter_descriptor_; + metadata.reflection = DetectionOutputParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// DetectionOutputParameter + +// optional uint32 num_classes = 1; +bool DetectionOutputParameter::has_num_classes() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void DetectionOutputParameter::set_has_num_classes() { + _has_bits_[0] |= 0x00000001u; +} +void DetectionOutputParameter::clear_has_num_classes() { + _has_bits_[0] &= ~0x00000001u; +} +void DetectionOutputParameter::clear_num_classes() { + num_classes_ = 0u; + clear_has_num_classes(); +} +::google::protobuf::uint32 DetectionOutputParameter::num_classes() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.num_classes) + return num_classes_; +} +void DetectionOutputParameter::set_num_classes(::google::protobuf::uint32 value) { + set_has_num_classes(); + num_classes_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.num_classes) +} + +// optional bool share_location = 2 [default = true]; +bool DetectionOutputParameter::has_share_location() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void DetectionOutputParameter::set_has_share_location() { + _has_bits_[0] |= 0x00000002u; +} +void DetectionOutputParameter::clear_has_share_location() { + _has_bits_[0] &= ~0x00000002u; +} +void DetectionOutputParameter::clear_share_location() { + share_location_ = true; + clear_has_share_location(); +} +bool DetectionOutputParameter::share_location() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.share_location) + return share_location_; +} +void DetectionOutputParameter::set_share_location(bool value) { + set_has_share_location(); + share_location_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.share_location) +} + +// optional int32 background_label_id = 3 [default = 0]; +bool DetectionOutputParameter::has_background_label_id() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void DetectionOutputParameter::set_has_background_label_id() { + _has_bits_[0] |= 0x00000004u; +} +void DetectionOutputParameter::clear_has_background_label_id() { + _has_bits_[0] &= ~0x00000004u; +} +void DetectionOutputParameter::clear_background_label_id() { + background_label_id_ = 0; + clear_has_background_label_id(); +} +::google::protobuf::int32 DetectionOutputParameter::background_label_id() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.background_label_id) + return background_label_id_; +} +void DetectionOutputParameter::set_background_label_id(::google::protobuf::int32 value) { + set_has_background_label_id(); + background_label_id_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.background_label_id) +} + +// optional .caffe.NonMaximumSuppressionParameter nms_param = 4; +bool DetectionOutputParameter::has_nms_param() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void DetectionOutputParameter::set_has_nms_param() { + _has_bits_[0] |= 0x00000008u; +} +void DetectionOutputParameter::clear_has_nms_param() { + _has_bits_[0] &= ~0x00000008u; +} +void DetectionOutputParameter::clear_nms_param() { + if (nms_param_ != NULL) nms_param_->::caffe::NonMaximumSuppressionParameter::Clear(); + clear_has_nms_param(); +} +const ::caffe::NonMaximumSuppressionParameter& DetectionOutputParameter::nms_param() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.nms_param) + return nms_param_ != NULL ? *nms_param_ + : *::caffe::NonMaximumSuppressionParameter::internal_default_instance(); +} +::caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::mutable_nms_param() { + set_has_nms_param(); + if (nms_param_ == NULL) { + nms_param_ = new ::caffe::NonMaximumSuppressionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.DetectionOutputParameter.nms_param) + return nms_param_; +} +::caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::release_nms_param() { + // @@protoc_insertion_point(field_release:caffe.DetectionOutputParameter.nms_param) + clear_has_nms_param(); + ::caffe::NonMaximumSuppressionParameter* temp = nms_param_; + nms_param_ = NULL; + return temp; +} +void DetectionOutputParameter::set_allocated_nms_param(::caffe::NonMaximumSuppressionParameter* nms_param) { + delete nms_param_; + nms_param_ = nms_param; + if (nms_param) { + set_has_nms_param(); + } else { + clear_has_nms_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.DetectionOutputParameter.nms_param) +} + +// optional .caffe.SaveOutputParameter save_output_param = 5; +bool DetectionOutputParameter::has_save_output_param() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void DetectionOutputParameter::set_has_save_output_param() { + _has_bits_[0] |= 0x00000010u; +} +void DetectionOutputParameter::clear_has_save_output_param() { + _has_bits_[0] &= ~0x00000010u; +} +void DetectionOutputParameter::clear_save_output_param() { + if (save_output_param_ != NULL) save_output_param_->::caffe::SaveOutputParameter::Clear(); + clear_has_save_output_param(); +} +const ::caffe::SaveOutputParameter& DetectionOutputParameter::save_output_param() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.save_output_param) + return save_output_param_ != NULL ? *save_output_param_ + : *::caffe::SaveOutputParameter::internal_default_instance(); +} +::caffe::SaveOutputParameter* DetectionOutputParameter::mutable_save_output_param() { + set_has_save_output_param(); + if (save_output_param_ == NULL) { + save_output_param_ = new ::caffe::SaveOutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.DetectionOutputParameter.save_output_param) + return save_output_param_; +} +::caffe::SaveOutputParameter* DetectionOutputParameter::release_save_output_param() { + // @@protoc_insertion_point(field_release:caffe.DetectionOutputParameter.save_output_param) + clear_has_save_output_param(); + ::caffe::SaveOutputParameter* temp = save_output_param_; + save_output_param_ = NULL; + return temp; +} +void DetectionOutputParameter::set_allocated_save_output_param(::caffe::SaveOutputParameter* save_output_param) { + delete save_output_param_; + save_output_param_ = save_output_param; + if (save_output_param) { + set_has_save_output_param(); + } else { + clear_has_save_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.DetectionOutputParameter.save_output_param) +} + +// optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; +bool DetectionOutputParameter::has_code_type() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void DetectionOutputParameter::set_has_code_type() { + _has_bits_[0] |= 0x00000020u; +} +void DetectionOutputParameter::clear_has_code_type() { + _has_bits_[0] &= ~0x00000020u; +} +void DetectionOutputParameter::clear_code_type() { + code_type_ = 1; + clear_has_code_type(); +} +::caffe::PriorBoxParameter_CodeType DetectionOutputParameter::code_type() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.code_type) + return static_cast< ::caffe::PriorBoxParameter_CodeType >(code_type_); +} +void DetectionOutputParameter::set_code_type(::caffe::PriorBoxParameter_CodeType value) { + assert(::caffe::PriorBoxParameter_CodeType_IsValid(value)); + set_has_code_type(); + code_type_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.code_type) +} + +// optional bool variance_encoded_in_target = 8 [default = false]; +bool DetectionOutputParameter::has_variance_encoded_in_target() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void DetectionOutputParameter::set_has_variance_encoded_in_target() { + _has_bits_[0] |= 0x00000040u; +} +void DetectionOutputParameter::clear_has_variance_encoded_in_target() { + _has_bits_[0] &= ~0x00000040u; +} +void DetectionOutputParameter::clear_variance_encoded_in_target() { + variance_encoded_in_target_ = false; + clear_has_variance_encoded_in_target(); +} +bool DetectionOutputParameter::variance_encoded_in_target() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.variance_encoded_in_target) + return variance_encoded_in_target_; +} +void DetectionOutputParameter::set_variance_encoded_in_target(bool value) { + set_has_variance_encoded_in_target(); + variance_encoded_in_target_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.variance_encoded_in_target) +} + +// optional int32 keep_top_k = 7 [default = -1]; +bool DetectionOutputParameter::has_keep_top_k() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void DetectionOutputParameter::set_has_keep_top_k() { + _has_bits_[0] |= 0x00000080u; +} +void DetectionOutputParameter::clear_has_keep_top_k() { + _has_bits_[0] &= ~0x00000080u; +} +void DetectionOutputParameter::clear_keep_top_k() { + keep_top_k_ = -1; + clear_has_keep_top_k(); +} +::google::protobuf::int32 DetectionOutputParameter::keep_top_k() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.keep_top_k) + return keep_top_k_; +} +void DetectionOutputParameter::set_keep_top_k(::google::protobuf::int32 value) { + set_has_keep_top_k(); + keep_top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.keep_top_k) +} + +// optional float confidence_threshold = 9; +bool DetectionOutputParameter::has_confidence_threshold() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void DetectionOutputParameter::set_has_confidence_threshold() { + _has_bits_[0] |= 0x00000100u; +} +void DetectionOutputParameter::clear_has_confidence_threshold() { + _has_bits_[0] &= ~0x00000100u; +} +void DetectionOutputParameter::clear_confidence_threshold() { + confidence_threshold_ = 0; + clear_has_confidence_threshold(); +} +float DetectionOutputParameter::confidence_threshold() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.confidence_threshold) + return confidence_threshold_; +} +void DetectionOutputParameter::set_confidence_threshold(float value) { + set_has_confidence_threshold(); + confidence_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.confidence_threshold) +} + +inline const DetectionOutputParameter* DetectionOutputParameter::internal_default_instance() { + return &DetectionOutputParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Datum::kChannelsFieldNumber; +const int Datum::kHeightFieldNumber; +const int Datum::kWidthFieldNumber; +const int Datum::kDataFieldNumber; +const int Datum::kLabelFieldNumber; +const int Datum::kFloatDataFieldNumber; +const int Datum::kEncodedFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Datum::Datum() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.Datum) +} + +void Datum::InitAsDefaultInstance() { +} + +Datum::Datum(const Datum& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.Datum) +} + +void Datum::SharedCtor() { + _cached_size_ = 0; + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&channels_, 0, reinterpret_cast(&encoded_) - + reinterpret_cast(&channels_) + sizeof(encoded_)); +} + +Datum::~Datum() { + // @@protoc_insertion_point(destructor:caffe.Datum) + SharedDtor(); +} + +void Datum::SharedDtor() { + data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Datum::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Datum::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Datum_descriptor_; +} + +const Datum& Datum::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed Datum_default_instance_; + +Datum* Datum::New(::google::protobuf::Arena* arena) const { + Datum* n = new Datum; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void Datum::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.Datum) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(Datum, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 95u) { + ZR_(channels_, encoded_); + if (has_data()) { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + float_data_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool Datum::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.Datum) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 channels = 1; + case 1: { + if (tag == 8) { + set_has_channels(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_height; + break; + } + + // optional int32 height = 2; + case 2: { + if (tag == 16) { + parse_height: + set_has_height(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_width; + break; + } + + // optional int32 width = 3; + case 3: { + if (tag == 24) { + parse_width: + set_has_width(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_data; + break; + } + + // optional bytes data = 4; + case 4: { + if (tag == 34) { + parse_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_label; + break; + } + + // optional int32 label = 5; + case 5: { + if (tag == 40) { + parse_label: + set_has_label(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &label_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(53)) goto parse_float_data; + break; + } + + // repeated float float_data = 6; + case 6: { + if (tag == 53) { + parse_float_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 53, input, this->mutable_float_data()))); + } else if (tag == 50) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_float_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(53)) goto parse_float_data; + if (input->ExpectTag(56)) goto parse_encoded; + break; + } + + // optional bool encoded = 7 [default = false]; + case 7: { + if (tag == 56) { + parse_encoded: + set_has_encoded(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &encoded_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.Datum) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.Datum) + return false; +#undef DO_ +} + +void Datum::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.Datum) + // optional int32 channels = 1; + if (has_channels()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->channels(), output); + } + + // optional int32 height = 2; + if (has_height()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->height(), output); + } + + // optional int32 width = 3; + if (has_width()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->width(), output); + } + + // optional bytes data = 4; + if (has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->data(), output); + } + + // optional int32 label = 5; + if (has_label()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->label(), output); + } + + // repeated float float_data = 6; + for (int i = 0; i < this->float_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 6, this->float_data(i), output); + } + + // optional bool encoded = 7 [default = false]; + if (has_encoded()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->encoded(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.Datum) +} + +::google::protobuf::uint8* Datum::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.Datum) + // optional int32 channels = 1; + if (has_channels()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->channels(), target); + } + + // optional int32 height = 2; + if (has_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->height(), target); + } + + // optional int32 width = 3; + if (has_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->width(), target); + } + + // optional bytes data = 4; + if (has_data()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->data(), target); + } + + // optional int32 label = 5; + if (has_label()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->label(), target); + } + + // repeated float float_data = 6; + for (int i = 0; i < this->float_data_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(6, this->float_data(i), target); + } + + // optional bool encoded = 7 [default = false]; + if (has_encoded()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->encoded(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.Datum) + return target; +} + +size_t Datum::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.Datum) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 95u) { + // optional int32 channels = 1; + if (has_channels()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->channels()); + } + + // optional int32 height = 2; + if (has_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->height()); + } + + // optional int32 width = 3; + if (has_width()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->width()); + } + + // optional bytes data = 4; + if (has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->data()); + } + + // optional int32 label = 5; + if (has_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->label()); + } + + // optional bool encoded = 7 [default = false]; + if (has_encoded()) { + total_size += 1 + 1; + } + + } + // repeated float float_data = 6; + { + size_t data_size = 0; + unsigned int count = this->float_data_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->float_data_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Datum::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.Datum) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const Datum* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.Datum) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.Datum) + UnsafeMergeFrom(*source); + } +} + +void Datum::MergeFrom(const Datum& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.Datum) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void Datum::UnsafeMergeFrom(const Datum& from) { + GOOGLE_DCHECK(&from != this); + float_data_.UnsafeMergeFrom(from.float_data_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_channels()) { + set_channels(from.channels()); + } + if (from.has_height()) { + set_height(from.height()); + } + if (from.has_width()) { + set_width(from.width()); + } + if (from.has_data()) { + set_has_data(); + data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_); + } + if (from.has_label()) { + set_label(from.label()); + } + if (from.has_encoded()) { + set_encoded(from.encoded()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void Datum::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.Datum) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Datum::CopyFrom(const Datum& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.Datum) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool Datum::IsInitialized() const { + + return true; +} + +void Datum::Swap(Datum* other) { + if (other == this) return; + InternalSwap(other); +} +void Datum::InternalSwap(Datum* other) { + std::swap(channels_, other->channels_); + std::swap(height_, other->height_); + std::swap(width_, other->width_); + data_.Swap(&other->data_); + std::swap(label_, other->label_); + float_data_.UnsafeArenaSwap(&other->float_data_); + std::swap(encoded_, other->encoded_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata Datum::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Datum_descriptor_; + metadata.reflection = Datum_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// Datum + +// optional int32 channels = 1; +bool Datum::has_channels() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void Datum::set_has_channels() { + _has_bits_[0] |= 0x00000001u; +} +void Datum::clear_has_channels() { + _has_bits_[0] &= ~0x00000001u; +} +void Datum::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +::google::protobuf::int32 Datum::channels() const { + // @@protoc_insertion_point(field_get:caffe.Datum.channels) + return channels_; +} +void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.channels) +} + +// optional int32 height = 2; +bool Datum::has_height() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void Datum::set_has_height() { + _has_bits_[0] |= 0x00000002u; +} +void Datum::clear_has_height() { + _has_bits_[0] &= ~0x00000002u; +} +void Datum::clear_height() { + height_ = 0; + clear_has_height(); +} +::google::protobuf::int32 Datum::height() const { + // @@protoc_insertion_point(field_get:caffe.Datum.height) + return height_; +} +void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.height) +} + +// optional int32 width = 3; +bool Datum::has_width() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void Datum::set_has_width() { + _has_bits_[0] |= 0x00000004u; +} +void Datum::clear_has_width() { + _has_bits_[0] &= ~0x00000004u; +} +void Datum::clear_width() { + width_ = 0; + clear_has_width(); +} +::google::protobuf::int32 Datum::width() const { + // @@protoc_insertion_point(field_get:caffe.Datum.width) + return width_; +} +void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.width) +} + +// optional bytes data = 4; +bool Datum::has_data() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void Datum::set_has_data() { + _has_bits_[0] |= 0x00000008u; +} +void Datum::clear_has_data() { + _has_bits_[0] &= ~0x00000008u; +} +void Datum::clear_data() { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_data(); +} +const ::std::string& Datum::data() const { + // @@protoc_insertion_point(field_get:caffe.Datum.data) + return data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void Datum::set_data(const ::std::string& value) { + set_has_data(); + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.Datum.data) +} +void Datum::set_data(const char* value) { + set_has_data(); + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.Datum.data) +} +void Datum::set_data(const void* value, size_t size) { + set_has_data(); + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.Datum.data) +} +::std::string* Datum::mutable_data() { + set_has_data(); + // @@protoc_insertion_point(field_mutable:caffe.Datum.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* Datum::release_data() { + // @@protoc_insertion_point(field_release:caffe.Datum.data) + clear_has_data(); + return data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void Datum::set_allocated_data(::std::string* data) { + if (data != NULL) { + set_has_data(); + } else { + clear_has_data(); + } + data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data); + // @@protoc_insertion_point(field_set_allocated:caffe.Datum.data) +} + +// optional int32 label = 5; +bool Datum::has_label() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void Datum::set_has_label() { + _has_bits_[0] |= 0x00000010u; +} +void Datum::clear_has_label() { + _has_bits_[0] &= ~0x00000010u; +} +void Datum::clear_label() { + label_ = 0; + clear_has_label(); +} +::google::protobuf::int32 Datum::label() const { + // @@protoc_insertion_point(field_get:caffe.Datum.label) + return label_; +} +void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.label) +} + +// repeated float float_data = 6; +int Datum::float_data_size() const { + return float_data_.size(); +} +void Datum::clear_float_data() { + float_data_.Clear(); +} +float Datum::float_data(int index) const { + // @@protoc_insertion_point(field_get:caffe.Datum.float_data) + return float_data_.Get(index); +} +void Datum::set_float_data(int index, float value) { + float_data_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.Datum.float_data) +} +void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:caffe.Datum.float_data) +} +const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:caffe.Datum.float_data) + return float_data_; +} +::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:caffe.Datum.float_data) + return &float_data_; +} + +// optional bool encoded = 7 [default = false]; +bool Datum::has_encoded() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void Datum::set_has_encoded() { + _has_bits_[0] |= 0x00000040u; +} +void Datum::clear_has_encoded() { + _has_bits_[0] &= ~0x00000040u; +} +void Datum::clear_encoded() { + encoded_ = false; + clear_has_encoded(); +} +bool Datum::encoded() const { + // @@protoc_insertion_point(field_get:caffe.Datum.encoded) + return encoded_; +} +void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.encoded) +} + +inline const Datum* Datum::internal_default_instance() { + return &Datum_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* FillerParameter_VarianceNorm_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FillerParameter_VarianceNorm_descriptor_; +} +bool FillerParameter_VarianceNorm_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FillerParameter_VarianceNorm FillerParameter::FAN_IN; +const FillerParameter_VarianceNorm FillerParameter::FAN_OUT; +const FillerParameter_VarianceNorm FillerParameter::AVERAGE; +const FillerParameter_VarianceNorm FillerParameter::VarianceNorm_MIN; +const FillerParameter_VarianceNorm FillerParameter::VarianceNorm_MAX; +const int FillerParameter::VarianceNorm_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +::std::string* FillerParameter::_default_type_ = NULL; +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FillerParameter::kTypeFieldNumber; +const int FillerParameter::kValueFieldNumber; +const int FillerParameter::kMinFieldNumber; +const int FillerParameter::kMaxFieldNumber; +const int FillerParameter::kMeanFieldNumber; +const int FillerParameter::kStdFieldNumber; +const int FillerParameter::kSparseFieldNumber; +const int FillerParameter::kVarianceNormFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FillerParameter::FillerParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.FillerParameter) +} + +void FillerParameter::InitAsDefaultInstance() { +} + +FillerParameter::FillerParameter(const FillerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.FillerParameter) +} + +void FillerParameter::SharedCtor() { + _cached_size_ = 0; + type_.UnsafeSetDefault(_default_type_); + ::memset(&value_, 0, reinterpret_cast(&variance_norm_) - + reinterpret_cast(&value_) + sizeof(variance_norm_)); + sparse_ = -1; + max_ = 1; + std_ = 1; +} + +FillerParameter::~FillerParameter() { + // @@protoc_insertion_point(destructor:caffe.FillerParameter) + SharedDtor(); +} + +void FillerParameter::SharedDtor() { + type_.DestroyNoArena(_default_type_); +} + +void FillerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FillerParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FillerParameter_descriptor_; +} + +const FillerParameter& FillerParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed FillerParameter_default_instance_; + +FillerParameter* FillerParameter::New(::google::protobuf::Arena* arena) const { + FillerParameter* n = new FillerParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FillerParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.FillerParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(FillerParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(value_, variance_norm_); + if (has_type()) { + type_.ClearToDefaultNoArena(_default_type_); + } + max_ = 1; + std_ = 1; + sparse_ = -1; + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FillerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.FillerParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string type = 1 [default = "constant"]; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.FillerParameter.type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_value; + break; + } + + // optional float value = 2 [default = 0]; + case 2: { + if (tag == 21) { + parse_value: + set_has_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_min; + break; + } + + // optional float min = 3 [default = 0]; + case 3: { + if (tag == 29) { + parse_min: + set_has_min(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(37)) goto parse_max; + break; + } + + // optional float max = 4 [default = 1]; + case 4: { + if (tag == 37) { + parse_max: + set_has_max(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(45)) goto parse_mean; + break; + } + + // optional float mean = 5 [default = 0]; + case 5: { + if (tag == 45) { + parse_mean: + set_has_mean(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mean_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(53)) goto parse_std; + break; + } + + // optional float std = 6 [default = 1]; + case 6: { + if (tag == 53) { + parse_std: + set_has_std(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &std_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_sparse; + break; + } + + // optional int32 sparse = 7 [default = -1]; + case 7: { + if (tag == 56) { + parse_sparse: + set_has_sparse(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &sparse_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_variance_norm; + break; + } + + // optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + case 8: { + if (tag == 64) { + parse_variance_norm: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::FillerParameter_VarianceNorm_IsValid(value)) { + set_variance_norm(static_cast< ::caffe::FillerParameter_VarianceNorm >(value)); + } else { + mutable_unknown_fields()->AddVarint(8, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.FillerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.FillerParameter) + return false; +#undef DO_ +} + +void FillerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.FillerParameter) + // optional string type = 1 [default = "constant"]; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.FillerParameter.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->type(), output); + } + + // optional float value = 2 [default = 0]; + if (has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->value(), output); + } + + // optional float min = 3 [default = 0]; + if (has_min()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->min(), output); + } + + // optional float max = 4 [default = 1]; + if (has_max()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->max(), output); + } + + // optional float mean = 5 [default = 0]; + if (has_mean()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->mean(), output); + } + + // optional float std = 6 [default = 1]; + if (has_std()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->std(), output); + } + + // optional int32 sparse = 7 [default = -1]; + if (has_sparse()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->sparse(), output); + } + + // optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->variance_norm(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.FillerParameter) +} + +::google::protobuf::uint8* FillerParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.FillerParameter) + // optional string type = 1 [default = "constant"]; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.FillerParameter.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->type(), target); + } + + // optional float value = 2 [default = 0]; + if (has_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->value(), target); + } + + // optional float min = 3 [default = 0]; + if (has_min()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->min(), target); + } + + // optional float max = 4 [default = 1]; + if (has_max()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->max(), target); + } + + // optional float mean = 5 [default = 0]; + if (has_mean()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->mean(), target); + } + + // optional float std = 6 [default = 1]; + if (has_std()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->std(), target); + } + + // optional int32 sparse = 7 [default = -1]; + if (has_sparse()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->sparse(), target); + } + + // optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->variance_norm(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.FillerParameter) + return target; +} + +size_t FillerParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.FillerParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string type = 1 [default = "constant"]; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // optional float value = 2 [default = 0]; + if (has_value()) { + total_size += 1 + 4; + } + + // optional float min = 3 [default = 0]; + if (has_min()) { + total_size += 1 + 4; + } + + // optional float max = 4 [default = 1]; + if (has_max()) { + total_size += 1 + 4; + } + + // optional float mean = 5 [default = 0]; + if (has_mean()) { + total_size += 1 + 4; + } + + // optional float std = 6 [default = 1]; + if (has_std()) { + total_size += 1 + 4; + } + + // optional int32 sparse = 7 [default = -1]; + if (has_sparse()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->sparse()); + } + + // optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->variance_norm()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FillerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.FillerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FillerParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.FillerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.FillerParameter) + UnsafeMergeFrom(*source); + } +} + +void FillerParameter::MergeFrom(const FillerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.FillerParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void FillerParameter::UnsafeMergeFrom(const FillerParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_type()) { + set_has_type(); + type_.AssignWithDefault(_default_type_, from.type_); + } + if (from.has_value()) { + set_value(from.value()); + } + if (from.has_min()) { + set_min(from.min()); + } + if (from.has_max()) { + set_max(from.max()); + } + if (from.has_mean()) { + set_mean(from.mean()); + } + if (from.has_std()) { + set_std(from.std()); + } + if (from.has_sparse()) { + set_sparse(from.sparse()); + } + if (from.has_variance_norm()) { + set_variance_norm(from.variance_norm()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void FillerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.FillerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FillerParameter::CopyFrom(const FillerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.FillerParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool FillerParameter::IsInitialized() const { + + return true; +} + +void FillerParameter::Swap(FillerParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void FillerParameter::InternalSwap(FillerParameter* other) { + type_.Swap(&other->type_); + std::swap(value_, other->value_); + std::swap(min_, other->min_); + std::swap(max_, other->max_); + std::swap(mean_, other->mean_); + std::swap(std_, other->std_); + std::swap(sparse_, other->sparse_); + std::swap(variance_norm_, other->variance_norm_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FillerParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FillerParameter_descriptor_; + metadata.reflection = FillerParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FillerParameter + +// optional string type = 1 [default = "constant"]; +bool FillerParameter::has_type() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void FillerParameter::set_has_type() { + _has_bits_[0] |= 0x00000001u; +} +void FillerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000001u; +} +void FillerParameter::clear_type() { + type_.ClearToDefaultNoArena(_default_type_); + clear_has_type(); +} +const ::std::string& FillerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.type) + return type_.GetNoArena(_default_type_); +} +void FillerParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(_default_type_, value); + // @@protoc_insertion_point(field_set:caffe.FillerParameter.type) +} +void FillerParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(_default_type_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.FillerParameter.type) +} +void FillerParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(_default_type_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.FillerParameter.type) +} +::std::string* FillerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.FillerParameter.type) + return type_.MutableNoArena(_default_type_); +} +::std::string* FillerParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.FillerParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(_default_type_); +} +void FillerParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(_default_type_, type); + // @@protoc_insertion_point(field_set_allocated:caffe.FillerParameter.type) +} + +// optional float value = 2 [default = 0]; +bool FillerParameter::has_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void FillerParameter::set_has_value() { + _has_bits_[0] |= 0x00000002u; +} +void FillerParameter::clear_has_value() { + _has_bits_[0] &= ~0x00000002u; +} +void FillerParameter::clear_value() { + value_ = 0; + clear_has_value(); +} +float FillerParameter::value() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.value) + return value_; +} +void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.value) +} + +// optional float min = 3 [default = 0]; +bool FillerParameter::has_min() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void FillerParameter::set_has_min() { + _has_bits_[0] |= 0x00000004u; +} +void FillerParameter::clear_has_min() { + _has_bits_[0] &= ~0x00000004u; +} +void FillerParameter::clear_min() { + min_ = 0; + clear_has_min(); +} +float FillerParameter::min() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.min) + return min_; +} +void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.min) +} + +// optional float max = 4 [default = 1]; +bool FillerParameter::has_max() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void FillerParameter::set_has_max() { + _has_bits_[0] |= 0x00000008u; +} +void FillerParameter::clear_has_max() { + _has_bits_[0] &= ~0x00000008u; +} +void FillerParameter::clear_max() { + max_ = 1; + clear_has_max(); +} +float FillerParameter::max() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.max) + return max_; +} +void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.max) +} + +// optional float mean = 5 [default = 0]; +bool FillerParameter::has_mean() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void FillerParameter::set_has_mean() { + _has_bits_[0] |= 0x00000010u; +} +void FillerParameter::clear_has_mean() { + _has_bits_[0] &= ~0x00000010u; +} +void FillerParameter::clear_mean() { + mean_ = 0; + clear_has_mean(); +} +float FillerParameter::mean() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.mean) + return mean_; +} +void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.mean) +} + +// optional float std = 6 [default = 1]; +bool FillerParameter::has_std() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void FillerParameter::set_has_std() { + _has_bits_[0] |= 0x00000020u; +} +void FillerParameter::clear_has_std() { + _has_bits_[0] &= ~0x00000020u; +} +void FillerParameter::clear_std() { + std_ = 1; + clear_has_std(); +} +float FillerParameter::std() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.std) + return std_; +} +void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.std) +} + +// optional int32 sparse = 7 [default = -1]; +bool FillerParameter::has_sparse() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void FillerParameter::set_has_sparse() { + _has_bits_[0] |= 0x00000040u; +} +void FillerParameter::clear_has_sparse() { + _has_bits_[0] &= ~0x00000040u; +} +void FillerParameter::clear_sparse() { + sparse_ = -1; + clear_has_sparse(); +} +::google::protobuf::int32 FillerParameter::sparse() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.sparse) + return sparse_; +} +void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.sparse) +} + +// optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; +bool FillerParameter::has_variance_norm() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void FillerParameter::set_has_variance_norm() { + _has_bits_[0] |= 0x00000080u; +} +void FillerParameter::clear_has_variance_norm() { + _has_bits_[0] &= ~0x00000080u; +} +void FillerParameter::clear_variance_norm() { + variance_norm_ = 0; + clear_has_variance_norm(); +} +::caffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.variance_norm) + return static_cast< ::caffe::FillerParameter_VarianceNorm >(variance_norm_); +} +void FillerParameter::set_variance_norm(::caffe::FillerParameter_VarianceNorm value) { + assert(::caffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.variance_norm) +} + +inline const FillerParameter* FillerParameter::internal_default_instance() { + return &FillerParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NetParameter::kNameFieldNumber; +const int NetParameter::kInputFieldNumber; +const int NetParameter::kInputShapeFieldNumber; +const int NetParameter::kInputDimFieldNumber; +const int NetParameter::kForceBackwardFieldNumber; +const int NetParameter::kStateFieldNumber; +const int NetParameter::kDebugInfoFieldNumber; +const int NetParameter::kLayerFieldNumber; +const int NetParameter::kLayersFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NetParameter::NetParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.NetParameter) +} + +void NetParameter::InitAsDefaultInstance() { + state_ = const_cast< ::caffe::NetState*>( + ::caffe::NetState::internal_default_instance()); +} + +NetParameter::NetParameter(const NetParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.NetParameter) +} + +void NetParameter::SharedCtor() { + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + state_ = NULL; + ::memset(&force_backward_, 0, reinterpret_cast(&debug_info_) - + reinterpret_cast(&force_backward_) + sizeof(debug_info_)); +} + +NetParameter::~NetParameter() { + // @@protoc_insertion_point(destructor:caffe.NetParameter) + SharedDtor(); +} + +void NetParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != &NetParameter_default_instance_.get()) { + delete state_; + } +} + +void NetParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NetParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NetParameter_descriptor_; +} + +const NetParameter& NetParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NetParameter_default_instance_; + +NetParameter* NetParameter::New(::google::protobuf::Arena* arena) const { + NetParameter* n = new NetParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void NetParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.NetParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(NetParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 113u) { + ZR_(force_backward_, debug_info_); + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_state()) { + if (state_ != NULL) state_->::caffe::NetState::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + input_.Clear(); + input_shape_.Clear(); + input_dim_.Clear(); + layer_.Clear(); + layers_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool NetParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.NetParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.NetParameter.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + break; + } + + // repeated .caffe.V1LayerParameter layers = 2; + case 2: { + if (tag == 18) { + parse_layers: + DO_(input->IncrementRecursionDepth()); + parse_loop_layers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_layers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_layers; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(26)) goto parse_input; + break; + } + + // repeated string input = 3; + case 3: { + if (tag == 26) { + parse_input: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_input())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->input(this->input_size() - 1).data(), + this->input(this->input_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.NetParameter.input"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_input; + if (input->ExpectTag(32)) goto parse_input_dim; + break; + } + + // repeated int32 input_dim = 4; + case 4: { + if (tag == 32) { + parse_input_dim: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 32, input, this->mutable_input_dim()))); + } else if (tag == 34) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_input_dim()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_input_dim; + if (input->ExpectTag(40)) goto parse_force_backward; + break; + } + + // optional bool force_backward = 5 [default = false]; + case 5: { + if (tag == 40) { + parse_force_backward: + set_has_force_backward(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_backward_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_state; + break; + } + + // optional .caffe.NetState state = 6; + case 6: { + if (tag == 50) { + parse_state: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_state())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_debug_info; + break; + } + + // optional bool debug_info = 7 [default = false]; + case 7: { + if (tag == 56) { + parse_debug_info: + set_has_debug_info(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + break; + } + + // repeated .caffe.BlobShape input_shape = 8; + case 8: { + if (tag == 66) { + parse_input_shape: + DO_(input->IncrementRecursionDepth()); + parse_loop_input_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_input_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_loop_input_shape; + if (input->ExpectTag(802)) goto parse_loop_layer; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .caffe.LayerParameter layer = 100; + case 100: { + if (tag == 802) { + DO_(input->IncrementRecursionDepth()); + parse_loop_layer: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_layer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(802)) goto parse_loop_layer; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.NetParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.NetParameter) + return false; +#undef DO_ +} + +void NetParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetParameter.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .caffe.V1LayerParameter layers = 2; + for (unsigned int i = 0, n = this->layers_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->layers(i), output); + } + + // repeated string input = 3; + for (int i = 0; i < this->input_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->input(i).data(), this->input(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetParameter.input"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->input(i), output); + } + + // repeated int32 input_dim = 4; + for (int i = 0; i < this->input_dim_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 4, this->input_dim(i), output); + } + + // optional bool force_backward = 5 [default = false]; + if (has_force_backward()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->force_backward(), output); + } + + // optional .caffe.NetState state = 6; + if (has_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *this->state_, output); + } + + // optional bool debug_info = 7 [default = false]; + if (has_debug_info()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->debug_info(), output); + } + + // repeated .caffe.BlobShape input_shape = 8; + for (unsigned int i = 0, n = this->input_shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->input_shape(i), output); + } + + // repeated .caffe.LayerParameter layer = 100; + for (unsigned int i = 0, n = this->layer_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 100, this->layer(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.NetParameter) +} + +::google::protobuf::uint8* NetParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetParameter.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .caffe.V1LayerParameter layers = 2; + for (unsigned int i = 0, n = this->layers_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, this->layers(i), false, target); + } + + // repeated string input = 3; + for (int i = 0; i < this->input_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->input(i).data(), this->input(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetParameter.input"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->input(i), target); + } + + // repeated int32 input_dim = 4; + for (int i = 0; i < this->input_dim_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(4, this->input_dim(i), target); + } + + // optional bool force_backward = 5 [default = false]; + if (has_force_backward()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->force_backward(), target); + } + + // optional .caffe.NetState state = 6; + if (has_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, *this->state_, false, target); + } + + // optional bool debug_info = 7 [default = false]; + if (has_debug_info()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->debug_info(), target); + } + + // repeated .caffe.BlobShape input_shape = 8; + for (unsigned int i = 0, n = this->input_shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, this->input_shape(i), false, target); + } + + // repeated .caffe.LayerParameter layer = 100; + for (unsigned int i = 0, n = this->layer_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 100, this->layer(i), false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.NetParameter) + return target; +} + +size_t NetParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.NetParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 113u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional bool force_backward = 5 [default = false]; + if (has_force_backward()) { + total_size += 1 + 1; + } + + // optional .caffe.NetState state = 6; + if (has_state()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->state_); + } + + // optional bool debug_info = 7 [default = false]; + if (has_debug_info()) { + total_size += 1 + 1; + } + + } + // repeated string input = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->input_size()); + for (int i = 0; i < this->input_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // repeated .caffe.BlobShape input_shape = 8; + { + unsigned int count = this->input_shape_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_shape(i)); + } + } + + // repeated int32 input_dim = 4; + { + size_t data_size = 0; + unsigned int count = this->input_dim_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->input_dim(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->input_dim_size()); + total_size += data_size; + } + + // repeated .caffe.LayerParameter layer = 100; + { + unsigned int count = this->layer_size(); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer(i)); + } + } + + // repeated .caffe.V1LayerParameter layers = 2; + { + unsigned int count = this->layers_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layers(i)); + } + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.NetParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NetParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.NetParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.NetParameter) + UnsafeMergeFrom(*source); + } +} + +void NetParameter::MergeFrom(const NetParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.NetParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NetParameter::UnsafeMergeFrom(const NetParameter& from) { + GOOGLE_DCHECK(&from != this); + input_.UnsafeMergeFrom(from.input_); + input_shape_.MergeFrom(from.input_shape_); + input_dim_.UnsafeMergeFrom(from.input_dim_); + layer_.MergeFrom(from.layer_); + layers_.MergeFrom(from.layers_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_force_backward()) { + set_force_backward(from.force_backward()); + } + if (from.has_state()) { + mutable_state()->::caffe::NetState::MergeFrom(from.state()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void NetParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.NetParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetParameter::CopyFrom(const NetParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.NetParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NetParameter::IsInitialized() const { + + return true; +} + +void NetParameter::Swap(NetParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void NetParameter::InternalSwap(NetParameter* other) { + name_.Swap(&other->name_); + input_.UnsafeArenaSwap(&other->input_); + input_shape_.UnsafeArenaSwap(&other->input_shape_); + input_dim_.UnsafeArenaSwap(&other->input_dim_); + std::swap(force_backward_, other->force_backward_); + std::swap(state_, other->state_); + std::swap(debug_info_, other->debug_info_); + layer_.UnsafeArenaSwap(&other->layer_); + layers_.UnsafeArenaSwap(&other->layers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NetParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NetParameter_descriptor_; + metadata.reflection = NetParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NetParameter + +// optional string name = 1; +bool NetParameter::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void NetParameter::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void NetParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void NetParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +const ::std::string& NetParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void NetParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.NetParameter.name) +} +void NetParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.NetParameter.name) +} +void NetParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.NetParameter.name) +} +::std::string* NetParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* NetParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.NetParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void NetParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.NetParameter.name) +} + +// repeated string input = 3; +int NetParameter::input_size() const { + return input_.size(); +} +void NetParameter::clear_input() { + input_.Clear(); +} +const ::std::string& NetParameter::input(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.input) + return input_.Get(index); +} +::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.input) + return input_.Mutable(index); +} +void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetParameter.input) + input_.Mutable(index)->assign(value); +} +void NetParameter::set_input(int index, const char* value) { + input_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetParameter.input) +} +void NetParameter::set_input(int index, const char* value, size_t size) { + input_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetParameter.input) +} +::std::string* NetParameter::add_input() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetParameter.input) + return input_.Add(); +} +void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetParameter.input) +} +void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetParameter.input) +} +void NetParameter::add_input(const char* value, size_t size) { + input_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetParameter.input) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.input) + return input_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.input) + return &input_; +} + +// repeated .caffe.BlobShape input_shape = 8; +int NetParameter::input_shape_size() const { + return input_shape_.size(); +} +void NetParameter::clear_input_shape() { + input_shape_.Clear(); +} +const ::caffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +::caffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +::caffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:caffe.NetParameter.input_shape) + return input_shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.input_shape) + return &input_shape_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.input_shape) + return input_shape_; +} + +// repeated int32 input_dim = 4; +int NetParameter::input_dim_size() const { + return input_dim_.size(); +} +void NetParameter::clear_input_dim() { + input_dim_.Clear(); +} +::google::protobuf::int32 NetParameter::input_dim(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.input_dim) + return input_dim_.Get(index); +} +void NetParameter::set_input_dim(int index, ::google::protobuf::int32 value) { + input_dim_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.NetParameter.input_dim) +} +void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:caffe.NetParameter.input_dim) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.input_dim) + return input_dim_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.input_dim) + return &input_dim_; +} + +// optional bool force_backward = 5 [default = false]; +bool NetParameter::has_force_backward() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void NetParameter::set_has_force_backward() { + _has_bits_[0] |= 0x00000010u; +} +void NetParameter::clear_has_force_backward() { + _has_bits_[0] &= ~0x00000010u; +} +void NetParameter::clear_force_backward() { + force_backward_ = false; + clear_has_force_backward(); +} +bool NetParameter::force_backward() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.force_backward) + return force_backward_; +} +void NetParameter::set_force_backward(bool value) { + set_has_force_backward(); + force_backward_ = value; + // @@protoc_insertion_point(field_set:caffe.NetParameter.force_backward) +} + +// optional .caffe.NetState state = 6; +bool NetParameter::has_state() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void NetParameter::set_has_state() { + _has_bits_[0] |= 0x00000020u; +} +void NetParameter::clear_has_state() { + _has_bits_[0] &= ~0x00000020u; +} +void NetParameter::clear_state() { + if (state_ != NULL) state_->::caffe::NetState::Clear(); + clear_has_state(); +} +const ::caffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.state) + return state_ != NULL ? *state_ + : *::caffe::NetState::internal_default_instance(); +} +::caffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) { + state_ = new ::caffe::NetState; + } + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.state) + return state_; +} +::caffe::NetState* NetParameter::release_state() { + // @@protoc_insertion_point(field_release:caffe.NetParameter.state) + clear_has_state(); + ::caffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +void NetParameter::set_allocated_state(::caffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.NetParameter.state) +} + +// optional bool debug_info = 7 [default = false]; +bool NetParameter::has_debug_info() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void NetParameter::set_has_debug_info() { + _has_bits_[0] |= 0x00000040u; +} +void NetParameter::clear_has_debug_info() { + _has_bits_[0] &= ~0x00000040u; +} +void NetParameter::clear_debug_info() { + debug_info_ = false; + clear_has_debug_info(); +} +bool NetParameter::debug_info() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.debug_info) + return debug_info_; +} +void NetParameter::set_debug_info(bool value) { + set_has_debug_info(); + debug_info_ = value; + // @@protoc_insertion_point(field_set:caffe.NetParameter.debug_info) +} + +// repeated .caffe.LayerParameter layer = 100; +int NetParameter::layer_size() const { + return layer_.size(); +} +void NetParameter::clear_layer() { + layer_.Clear(); +} +const ::caffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.layer) + return layer_.Get(index); +} +::caffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.layer) + return layer_.Mutable(index); +} +::caffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:caffe.NetParameter.layer) + return layer_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.layer) + return &layer_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.layer) + return layer_; +} + +// repeated .caffe.V1LayerParameter layers = 2; +int NetParameter::layers_size() const { + return layers_.size(); +} +void NetParameter::clear_layers() { + layers_.Clear(); +} +const ::caffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.layers) + return layers_.Get(index); +} +::caffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.layers) + return layers_.Mutable(index); +} +::caffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:caffe.NetParameter.layers) + return layers_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.layers) + return &layers_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.layers) + return layers_; +} + +inline const NetParameter* NetParameter::internal_default_instance() { + return &NetParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SolverParameter_SnapshotFormat_descriptor_; +} +bool SolverParameter_SnapshotFormat_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SolverParameter_SnapshotFormat SolverParameter::HDF5; +const SolverParameter_SnapshotFormat SolverParameter::BINARYPROTO; +const SolverParameter_SnapshotFormat SolverParameter::SnapshotFormat_MIN; +const SolverParameter_SnapshotFormat SolverParameter::SnapshotFormat_MAX; +const int SolverParameter::SnapshotFormat_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* SolverParameter_SolverMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SolverParameter_SolverMode_descriptor_; +} +bool SolverParameter_SolverMode_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SolverParameter_SolverMode SolverParameter::CPU; +const SolverParameter_SolverMode SolverParameter::GPU; +const SolverParameter_SolverMode SolverParameter::SolverMode_MIN; +const SolverParameter_SolverMode SolverParameter::SolverMode_MAX; +const int SolverParameter::SolverMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* SolverParameter_SolverType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SolverParameter_SolverType_descriptor_; +} +bool SolverParameter_SolverType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SolverParameter_SolverType SolverParameter::SGD; +const SolverParameter_SolverType SolverParameter::NESTEROV; +const SolverParameter_SolverType SolverParameter::ADAGRAD; +const SolverParameter_SolverType SolverParameter::RMSPROP; +const SolverParameter_SolverType SolverParameter::ADADELTA; +const SolverParameter_SolverType SolverParameter::ADAM; +const SolverParameter_SolverType SolverParameter::SolverType_MIN; +const SolverParameter_SolverType SolverParameter::SolverType_MAX; +const int SolverParameter::SolverType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +::std::string* SolverParameter::_default_regularization_type_ = NULL; +::std::string* SolverParameter::_default_type_ = NULL; +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SolverParameter::kNetFieldNumber; +const int SolverParameter::kNetParamFieldNumber; +const int SolverParameter::kTrainNetFieldNumber; +const int SolverParameter::kTestNetFieldNumber; +const int SolverParameter::kTrainNetParamFieldNumber; +const int SolverParameter::kTestNetParamFieldNumber; +const int SolverParameter::kTrainStateFieldNumber; +const int SolverParameter::kTestStateFieldNumber; +const int SolverParameter::kTestIterFieldNumber; +const int SolverParameter::kTestIntervalFieldNumber; +const int SolverParameter::kTestComputeLossFieldNumber; +const int SolverParameter::kTestInitializationFieldNumber; +const int SolverParameter::kBaseLrFieldNumber; +const int SolverParameter::kDisplayFieldNumber; +const int SolverParameter::kAverageLossFieldNumber; +const int SolverParameter::kMaxIterFieldNumber; +const int SolverParameter::kIterSizeFieldNumber; +const int SolverParameter::kLrPolicyFieldNumber; +const int SolverParameter::kGammaFieldNumber; +const int SolverParameter::kPowerFieldNumber; +const int SolverParameter::kMomentumFieldNumber; +const int SolverParameter::kWeightDecayFieldNumber; +const int SolverParameter::kRegularizationTypeFieldNumber; +const int SolverParameter::kStepsizeFieldNumber; +const int SolverParameter::kStepvalueFieldNumber; +const int SolverParameter::kClipGradientsFieldNumber; +const int SolverParameter::kSnapshotFieldNumber; +const int SolverParameter::kSnapshotPrefixFieldNumber; +const int SolverParameter::kSnapshotDiffFieldNumber; +const int SolverParameter::kSnapshotFormatFieldNumber; +const int SolverParameter::kSolverModeFieldNumber; +const int SolverParameter::kDeviceIdFieldNumber; +const int SolverParameter::kRandomSeedFieldNumber; +const int SolverParameter::kTypeFieldNumber; +const int SolverParameter::kDeltaFieldNumber; +const int SolverParameter::kMomentum2FieldNumber; +const int SolverParameter::kRmsDecayFieldNumber; +const int SolverParameter::kDebugInfoFieldNumber; +const int SolverParameter::kSnapshotAfterTrainFieldNumber; +const int SolverParameter::kSolverTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SolverParameter::SolverParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SolverParameter) +} + +void SolverParameter::InitAsDefaultInstance() { + net_param_ = const_cast< ::caffe::NetParameter*>( + ::caffe::NetParameter::internal_default_instance()); + train_net_param_ = const_cast< ::caffe::NetParameter*>( + ::caffe::NetParameter::internal_default_instance()); + train_state_ = const_cast< ::caffe::NetState*>( + ::caffe::NetState::internal_default_instance()); +} + +SolverParameter::SolverParameter(const SolverParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SolverParameter) +} + +void SolverParameter::SharedCtor() { + net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + train_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + lr_policy_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + regularization_type_.UnsafeSetDefault(_default_regularization_type_); + snapshot_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(_default_type_); + net_param_ = NULL; + train_net_param_ = NULL; + train_state_ = NULL; + ::memset(&test_interval_, 0, reinterpret_cast(&solver_type_) - + reinterpret_cast(&test_interval_) + sizeof(solver_type_)); + rms_decay_ = 0.99f; + average_loss_ = 1; + iter_size_ = 1; + test_initialization_ = true; + snapshot_after_train_ = true; + clip_gradients_ = -1; + snapshot_format_ = 1; + solver_mode_ = 1; + random_seed_ = GOOGLE_LONGLONG(-1); + delta_ = 1e-08f; + momentum2_ = 0.999f; + _cached_size_ = 0; +} + +SolverParameter::~SolverParameter() { + // @@protoc_insertion_point(destructor:caffe.SolverParameter) + SharedDtor(); +} + +void SolverParameter::SharedDtor() { + net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + train_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + lr_policy_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + regularization_type_.DestroyNoArena(_default_regularization_type_); + snapshot_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(_default_type_); + if (this != &SolverParameter_default_instance_.get()) { + delete net_param_; + delete train_net_param_; + delete train_state_; + } +} + +void SolverParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SolverParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SolverParameter_descriptor_; +} + +const SolverParameter& SolverParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SolverParameter_default_instance_; + +SolverParameter* SolverParameter::New(::google::protobuf::Arena* arena) const { + SolverParameter* n = new SolverParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SolverParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SolverParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(SolverParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 87u) { + if (has_net()) { + net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_net_param()) { + if (net_param_ != NULL) net_param_->::caffe::NetParameter::Clear(); + } + if (has_train_net()) { + train_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_train_net_param()) { + if (train_net_param_ != NULL) train_net_param_->::caffe::NetParameter::Clear(); + } + if (has_train_state()) { + if (train_state_ != NULL) train_state_->::caffe::NetState::Clear(); + } + } + if (_has_bits_[8 / 32] & 65024u) { + ZR_(test_interval_, max_iter_); + test_compute_loss_ = false; + test_initialization_ = true; + average_loss_ = 1; + } + if (_has_bits_[16 / 32] & 16711680u) { + ZR_(gamma_, stepsize_); + iter_size_ = 1; + if (has_lr_policy()) { + lr_policy_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_regularization_type()) { + regularization_type_.ClearToDefaultNoArena(_default_regularization_type_); + } + } + if (_has_bits_[24 / 32] & 4261412864u) { + ZR_(snapshot_, device_id_); + clip_gradients_ = -1; + if (has_snapshot_prefix()) { + snapshot_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + } + if (_has_bits_[32 / 32] & 255u) { + random_seed_ = GOOGLE_LONGLONG(-1); + if (has_type()) { + type_.ClearToDefaultNoArena(_default_type_); + } + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0.99f; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + } + +#undef ZR_HELPER_ +#undef ZR_ + + test_net_.Clear(); + test_net_param_.Clear(); + test_state_.Clear(); + test_iter_.Clear(); + stepvalue_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SolverParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SolverParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string train_net = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_train_net())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->train_net().data(), this->train_net().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.train_net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_test_net; + break; + } + + // repeated string test_net = 2; + case 2: { + if (tag == 18) { + parse_test_net: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_test_net())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->test_net(this->test_net_size() - 1).data(), + this->test_net(this->test_net_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.test_net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_test_net; + if (input->ExpectTag(24)) goto parse_test_iter; + break; + } + + // repeated int32 test_iter = 3; + case 3: { + if (tag == 24) { + parse_test_iter: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 24, input, this->mutable_test_iter()))); + } else if (tag == 26) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_test_iter()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_test_iter; + if (input->ExpectTag(32)) goto parse_test_interval; + break; + } + + // optional int32 test_interval = 4 [default = 0]; + case 4: { + if (tag == 32) { + parse_test_interval: + set_has_test_interval(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &test_interval_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(45)) goto parse_base_lr; + break; + } + + // optional float base_lr = 5; + case 5: { + if (tag == 45) { + parse_base_lr: + set_has_base_lr(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_lr_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_display; + break; + } + + // optional int32 display = 6; + case 6: { + if (tag == 48) { + parse_display: + set_has_display(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &display_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_max_iter; + break; + } + + // optional int32 max_iter = 7; + case 7: { + if (tag == 56) { + parse_max_iter: + set_has_max_iter(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_iter_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_lr_policy; + break; + } + + // optional string lr_policy = 8; + case 8: { + if (tag == 66) { + parse_lr_policy: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_lr_policy())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->lr_policy().data(), this->lr_policy().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.lr_policy"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(77)) goto parse_gamma; + break; + } + + // optional float gamma = 9; + case 9: { + if (tag == 77) { + parse_gamma: + set_has_gamma(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gamma_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(85)) goto parse_power; + break; + } + + // optional float power = 10; + case 10: { + if (tag == 85) { + parse_power: + set_has_power(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(93)) goto parse_momentum; + break; + } + + // optional float momentum = 11; + case 11: { + if (tag == 93) { + parse_momentum: + set_has_momentum(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(101)) goto parse_weight_decay; + break; + } + + // optional float weight_decay = 12; + case 12: { + if (tag == 101) { + parse_weight_decay: + set_has_weight_decay(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_decay_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_stepsize; + break; + } + + // optional int32 stepsize = 13; + case 13: { + if (tag == 104) { + parse_stepsize: + set_has_stepsize(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &stepsize_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_snapshot; + break; + } + + // optional int32 snapshot = 14 [default = 0]; + case 14: { + if (tag == 112) { + parse_snapshot: + set_has_snapshot(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &snapshot_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(122)) goto parse_snapshot_prefix; + break; + } + + // optional string snapshot_prefix = 15; + case 15: { + if (tag == 122) { + parse_snapshot_prefix: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_snapshot_prefix())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->snapshot_prefix().data(), this->snapshot_prefix().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.snapshot_prefix"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_snapshot_diff; + break; + } + + // optional bool snapshot_diff = 16 [default = false]; + case 16: { + if (tag == 128) { + parse_snapshot_diff: + set_has_snapshot_diff(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_diff_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_solver_mode; + break; + } + + // optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + case 17: { + if (tag == 136) { + parse_solver_mode: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SolverParameter_SolverMode_IsValid(value)) { + set_solver_mode(static_cast< ::caffe::SolverParameter_SolverMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(17, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_device_id; + break; + } + + // optional int32 device_id = 18 [default = 0]; + case 18: { + if (tag == 144) { + parse_device_id: + set_has_device_id(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_id_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_test_compute_loss; + break; + } + + // optional bool test_compute_loss = 19 [default = false]; + case 19: { + if (tag == 152) { + parse_test_compute_loss: + set_has_test_compute_loss(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_compute_loss_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(160)) goto parse_random_seed; + break; + } + + // optional int64 random_seed = 20 [default = -1]; + case 20: { + if (tag == 160) { + parse_random_seed: + set_has_random_seed(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &random_seed_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(170)) goto parse_train_net_param; + break; + } + + // optional .caffe.NetParameter train_net_param = 21; + case 21: { + if (tag == 170) { + parse_train_net_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_train_net_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_test_net_param; + break; + } + + // repeated .caffe.NetParameter test_net_param = 22; + case 22: { + if (tag == 178) { + parse_test_net_param: + DO_(input->IncrementRecursionDepth()); + parse_loop_test_net_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_test_net_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_loop_test_net_param; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(184)) goto parse_debug_info; + break; + } + + // optional bool debug_info = 23 [default = false]; + case 23: { + if (tag == 184) { + parse_debug_info: + set_has_debug_info(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(194)) goto parse_net; + break; + } + + // optional string net = 24; + case 24: { + if (tag == 194) { + parse_net: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_net())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->net().data(), this->net().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(202)) goto parse_net_param; + break; + } + + // optional .caffe.NetParameter net_param = 25; + case 25: { + if (tag == 202) { + parse_net_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_net_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(210)) goto parse_train_state; + break; + } + + // optional .caffe.NetState train_state = 26; + case 26: { + if (tag == 210) { + parse_train_state: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_train_state())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(218)) goto parse_test_state; + break; + } + + // repeated .caffe.NetState test_state = 27; + case 27: { + if (tag == 218) { + parse_test_state: + DO_(input->IncrementRecursionDepth()); + parse_loop_test_state: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_test_state())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(218)) goto parse_loop_test_state; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(224)) goto parse_snapshot_after_train; + break; + } + + // optional bool snapshot_after_train = 28 [default = true]; + case 28: { + if (tag == 224) { + parse_snapshot_after_train: + set_has_snapshot_after_train(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_after_train_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(234)) goto parse_regularization_type; + break; + } + + // optional string regularization_type = 29 [default = "L2"]; + case 29: { + if (tag == 234) { + parse_regularization_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_regularization_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->regularization_type().data(), this->regularization_type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.regularization_type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(240)) goto parse_solver_type; + break; + } + + // optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + case 30: { + if (tag == 240) { + parse_solver_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SolverParameter_SolverType_IsValid(value)) { + set_solver_type(static_cast< ::caffe::SolverParameter_SolverType >(value)); + } else { + mutable_unknown_fields()->AddVarint(30, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(253)) goto parse_delta; + break; + } + + // optional float delta = 31 [default = 1e-08]; + case 31: { + if (tag == 253) { + parse_delta: + set_has_delta(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &delta_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(256)) goto parse_test_initialization; + break; + } + + // optional bool test_initialization = 32 [default = true]; + case 32: { + if (tag == 256) { + parse_test_initialization: + set_has_test_initialization(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_initialization_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(264)) goto parse_average_loss; + break; + } + + // optional int32 average_loss = 33 [default = 1]; + case 33: { + if (tag == 264) { + parse_average_loss: + set_has_average_loss(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &average_loss_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(272)) goto parse_stepvalue; + break; + } + + // repeated int32 stepvalue = 34; + case 34: { + if (tag == 272) { + parse_stepvalue: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 2, 272, input, this->mutable_stepvalue()))); + } else if (tag == 274) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_stepvalue()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(272)) goto parse_stepvalue; + if (input->ExpectTag(285)) goto parse_clip_gradients; + break; + } + + // optional float clip_gradients = 35 [default = -1]; + case 35: { + if (tag == 285) { + parse_clip_gradients: + set_has_clip_gradients(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &clip_gradients_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(288)) goto parse_iter_size; + break; + } + + // optional int32 iter_size = 36 [default = 1]; + case 36: { + if (tag == 288) { + parse_iter_size: + set_has_iter_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(296)) goto parse_snapshot_format; + break; + } + + // optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + case 37: { + if (tag == 296) { + parse_snapshot_format: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SolverParameter_SnapshotFormat_IsValid(value)) { + set_snapshot_format(static_cast< ::caffe::SolverParameter_SnapshotFormat >(value)); + } else { + mutable_unknown_fields()->AddVarint(37, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(309)) goto parse_rms_decay; + break; + } + + // optional float rms_decay = 38 [default = 0.99]; + case 38: { + if (tag == 309) { + parse_rms_decay: + set_has_rms_decay(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rms_decay_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(317)) goto parse_momentum2; + break; + } + + // optional float momentum2 = 39 [default = 0.999]; + case 39: { + if (tag == 317) { + parse_momentum2: + set_has_momentum2(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum2_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(322)) goto parse_type; + break; + } + + // optional string type = 40 [default = "SGD"]; + case 40: { + if (tag == 322) { + parse_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverParameter.type"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SolverParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SolverParameter) + return false; +#undef DO_ +} + +void SolverParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SolverParameter) + // optional string train_net = 1; + if (has_train_net()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->train_net().data(), this->train_net().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.train_net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->train_net(), output); + } + + // repeated string test_net = 2; + for (int i = 0; i < this->test_net_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->test_net(i).data(), this->test_net(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.test_net"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->test_net(i), output); + } + + // repeated int32 test_iter = 3; + for (int i = 0; i < this->test_iter_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 3, this->test_iter(i), output); + } + + // optional int32 test_interval = 4 [default = 0]; + if (has_test_interval()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->test_interval(), output); + } + + // optional float base_lr = 5; + if (has_base_lr()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->base_lr(), output); + } + + // optional int32 display = 6; + if (has_display()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->display(), output); + } + + // optional int32 max_iter = 7; + if (has_max_iter()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->max_iter(), output); + } + + // optional string lr_policy = 8; + if (has_lr_policy()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->lr_policy().data(), this->lr_policy().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.lr_policy"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 8, this->lr_policy(), output); + } + + // optional float gamma = 9; + if (has_gamma()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->gamma(), output); + } + + // optional float power = 10; + if (has_power()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(10, this->power(), output); + } + + // optional float momentum = 11; + if (has_momentum()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->momentum(), output); + } + + // optional float weight_decay = 12; + if (has_weight_decay()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(12, this->weight_decay(), output); + } + + // optional int32 stepsize = 13; + if (has_stepsize()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->stepsize(), output); + } + + // optional int32 snapshot = 14 [default = 0]; + if (has_snapshot()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->snapshot(), output); + } + + // optional string snapshot_prefix = 15; + if (has_snapshot_prefix()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->snapshot_prefix().data(), this->snapshot_prefix().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.snapshot_prefix"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 15, this->snapshot_prefix(), output); + } + + // optional bool snapshot_diff = 16 [default = false]; + if (has_snapshot_diff()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->snapshot_diff(), output); + } + + // optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + if (has_solver_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 17, this->solver_mode(), output); + } + + // optional int32 device_id = 18 [default = 0]; + if (has_device_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->device_id(), output); + } + + // optional bool test_compute_loss = 19 [default = false]; + if (has_test_compute_loss()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->test_compute_loss(), output); + } + + // optional int64 random_seed = 20 [default = -1]; + if (has_random_seed()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(20, this->random_seed(), output); + } + + // optional .caffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, *this->train_net_param_, output); + } + + // repeated .caffe.NetParameter test_net_param = 22; + for (unsigned int i = 0, n = this->test_net_param_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 22, this->test_net_param(i), output); + } + + // optional bool debug_info = 23 [default = false]; + if (has_debug_info()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->debug_info(), output); + } + + // optional string net = 24; + if (has_net()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->net().data(), this->net().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 24, this->net(), output); + } + + // optional .caffe.NetParameter net_param = 25; + if (has_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 25, *this->net_param_, output); + } + + // optional .caffe.NetState train_state = 26; + if (has_train_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 26, *this->train_state_, output); + } + + // repeated .caffe.NetState test_state = 27; + for (unsigned int i = 0, n = this->test_state_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 27, this->test_state(i), output); + } + + // optional bool snapshot_after_train = 28 [default = true]; + if (has_snapshot_after_train()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(28, this->snapshot_after_train(), output); + } + + // optional string regularization_type = 29 [default = "L2"]; + if (has_regularization_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->regularization_type().data(), this->regularization_type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.regularization_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 29, this->regularization_type(), output); + } + + // optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + if (has_solver_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 30, this->solver_type(), output); + } + + // optional float delta = 31 [default = 1e-08]; + if (has_delta()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(31, this->delta(), output); + } + + // optional bool test_initialization = 32 [default = true]; + if (has_test_initialization()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(32, this->test_initialization(), output); + } + + // optional int32 average_loss = 33 [default = 1]; + if (has_average_loss()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(33, this->average_loss(), output); + } + + // repeated int32 stepvalue = 34; + for (int i = 0; i < this->stepvalue_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 34, this->stepvalue(i), output); + } + + // optional float clip_gradients = 35 [default = -1]; + if (has_clip_gradients()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(35, this->clip_gradients(), output); + } + + // optional int32 iter_size = 36 [default = 1]; + if (has_iter_size()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(36, this->iter_size(), output); + } + + // optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 37, this->snapshot_format(), output); + } + + // optional float rms_decay = 38 [default = 0.99]; + if (has_rms_decay()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(38, this->rms_decay(), output); + } + + // optional float momentum2 = 39 [default = 0.999]; + if (has_momentum2()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(39, this->momentum2(), output); + } + + // optional string type = 40 [default = "SGD"]; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 40, this->type(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SolverParameter) +} + +::google::protobuf::uint8* SolverParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SolverParameter) + // optional string train_net = 1; + if (has_train_net()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->train_net().data(), this->train_net().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.train_net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->train_net(), target); + } + + // repeated string test_net = 2; + for (int i = 0; i < this->test_net_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->test_net(i).data(), this->test_net(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.test_net"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(2, this->test_net(i), target); + } + + // repeated int32 test_iter = 3; + for (int i = 0; i < this->test_iter_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(3, this->test_iter(i), target); + } + + // optional int32 test_interval = 4 [default = 0]; + if (has_test_interval()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->test_interval(), target); + } + + // optional float base_lr = 5; + if (has_base_lr()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->base_lr(), target); + } + + // optional int32 display = 6; + if (has_display()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->display(), target); + } + + // optional int32 max_iter = 7; + if (has_max_iter()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->max_iter(), target); + } + + // optional string lr_policy = 8; + if (has_lr_policy()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->lr_policy().data(), this->lr_policy().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.lr_policy"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 8, this->lr_policy(), target); + } + + // optional float gamma = 9; + if (has_gamma()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->gamma(), target); + } + + // optional float power = 10; + if (has_power()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(10, this->power(), target); + } + + // optional float momentum = 11; + if (has_momentum()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(11, this->momentum(), target); + } + + // optional float weight_decay = 12; + if (has_weight_decay()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(12, this->weight_decay(), target); + } + + // optional int32 stepsize = 13; + if (has_stepsize()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->stepsize(), target); + } + + // optional int32 snapshot = 14 [default = 0]; + if (has_snapshot()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->snapshot(), target); + } + + // optional string snapshot_prefix = 15; + if (has_snapshot_prefix()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->snapshot_prefix().data(), this->snapshot_prefix().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.snapshot_prefix"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 15, this->snapshot_prefix(), target); + } + + // optional bool snapshot_diff = 16 [default = false]; + if (has_snapshot_diff()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->snapshot_diff(), target); + } + + // optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + if (has_solver_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 17, this->solver_mode(), target); + } + + // optional int32 device_id = 18 [default = 0]; + if (has_device_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->device_id(), target); + } + + // optional bool test_compute_loss = 19 [default = false]; + if (has_test_compute_loss()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->test_compute_loss(), target); + } + + // optional int64 random_seed = 20 [default = -1]; + if (has_random_seed()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(20, this->random_seed(), target); + } + + // optional .caffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 21, *this->train_net_param_, false, target); + } + + // repeated .caffe.NetParameter test_net_param = 22; + for (unsigned int i = 0, n = this->test_net_param_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 22, this->test_net_param(i), false, target); + } + + // optional bool debug_info = 23 [default = false]; + if (has_debug_info()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->debug_info(), target); + } + + // optional string net = 24; + if (has_net()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->net().data(), this->net().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 24, this->net(), target); + } + + // optional .caffe.NetParameter net_param = 25; + if (has_net_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 25, *this->net_param_, false, target); + } + + // optional .caffe.NetState train_state = 26; + if (has_train_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 26, *this->train_state_, false, target); + } + + // repeated .caffe.NetState test_state = 27; + for (unsigned int i = 0, n = this->test_state_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 27, this->test_state(i), false, target); + } + + // optional bool snapshot_after_train = 28 [default = true]; + if (has_snapshot_after_train()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(28, this->snapshot_after_train(), target); + } + + // optional string regularization_type = 29 [default = "L2"]; + if (has_regularization_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->regularization_type().data(), this->regularization_type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.regularization_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 29, this->regularization_type(), target); + } + + // optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + if (has_solver_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 30, this->solver_type(), target); + } + + // optional float delta = 31 [default = 1e-08]; + if (has_delta()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(31, this->delta(), target); + } + + // optional bool test_initialization = 32 [default = true]; + if (has_test_initialization()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(32, this->test_initialization(), target); + } + + // optional int32 average_loss = 33 [default = 1]; + if (has_average_loss()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(33, this->average_loss(), target); + } + + // repeated int32 stepvalue = 34; + for (int i = 0; i < this->stepvalue_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(34, this->stepvalue(i), target); + } + + // optional float clip_gradients = 35 [default = -1]; + if (has_clip_gradients()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(35, this->clip_gradients(), target); + } + + // optional int32 iter_size = 36 [default = 1]; + if (has_iter_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(36, this->iter_size(), target); + } + + // optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 37, this->snapshot_format(), target); + } + + // optional float rms_decay = 38 [default = 0.99]; + if (has_rms_decay()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(38, this->rms_decay(), target); + } + + // optional float momentum2 = 39 [default = 0.999]; + if (has_momentum2()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(39, this->momentum2(), target); + } + + // optional string type = 40 [default = "SGD"]; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverParameter.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 40, this->type(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SolverParameter) + return target; +} + +size_t SolverParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SolverParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 87u) { + // optional string net = 24; + if (has_net()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->net()); + } + + // optional .caffe.NetParameter net_param = 25; + if (has_net_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->net_param_); + } + + // optional string train_net = 1; + if (has_train_net()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->train_net()); + } + + // optional .caffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->train_net_param_); + } + + // optional .caffe.NetState train_state = 26; + if (has_train_state()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->train_state_); + } + + } + if (_has_bits_[9 / 32] & 65024u) { + // optional int32 test_interval = 4 [default = 0]; + if (has_test_interval()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->test_interval()); + } + + // optional bool test_compute_loss = 19 [default = false]; + if (has_test_compute_loss()) { + total_size += 2 + 1; + } + + // optional bool test_initialization = 32 [default = true]; + if (has_test_initialization()) { + total_size += 2 + 1; + } + + // optional float base_lr = 5; + if (has_base_lr()) { + total_size += 1 + 4; + } + + // optional int32 display = 6; + if (has_display()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->display()); + } + + // optional int32 average_loss = 33 [default = 1]; + if (has_average_loss()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->average_loss()); + } + + // optional int32 max_iter = 7; + if (has_max_iter()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->max_iter()); + } + + } + if (_has_bits_[16 / 32] & 16711680u) { + // optional int32 iter_size = 36 [default = 1]; + if (has_iter_size()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->iter_size()); + } + + // optional string lr_policy = 8; + if (has_lr_policy()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->lr_policy()); + } + + // optional float gamma = 9; + if (has_gamma()) { + total_size += 1 + 4; + } + + // optional float power = 10; + if (has_power()) { + total_size += 1 + 4; + } + + // optional float momentum = 11; + if (has_momentum()) { + total_size += 1 + 4; + } + + // optional float weight_decay = 12; + if (has_weight_decay()) { + total_size += 1 + 4; + } + + // optional string regularization_type = 29 [default = "L2"]; + if (has_regularization_type()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->regularization_type()); + } + + // optional int32 stepsize = 13; + if (has_stepsize()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->stepsize()); + } + + } + if (_has_bits_[25 / 32] & 4261412864u) { + // optional float clip_gradients = 35 [default = -1]; + if (has_clip_gradients()) { + total_size += 2 + 4; + } + + // optional int32 snapshot = 14 [default = 0]; + if (has_snapshot()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->snapshot()); + } + + // optional string snapshot_prefix = 15; + if (has_snapshot_prefix()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->snapshot_prefix()); + } + + // optional bool snapshot_diff = 16 [default = false]; + if (has_snapshot_diff()) { + total_size += 2 + 1; + } + + // optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->snapshot_format()); + } + + // optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + if (has_solver_mode()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->solver_mode()); + } + + // optional int32 device_id = 18 [default = 0]; + if (has_device_id()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->device_id()); + } + + } + if (_has_bits_[32 / 32] & 255u) { + // optional int64 random_seed = 20 [default = -1]; + if (has_random_seed()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->random_seed()); + } + + // optional string type = 40 [default = "SGD"]; + if (has_type()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // optional float delta = 31 [default = 1e-08]; + if (has_delta()) { + total_size += 2 + 4; + } + + // optional float momentum2 = 39 [default = 0.999]; + if (has_momentum2()) { + total_size += 2 + 4; + } + + // optional float rms_decay = 38 [default = 0.99]; + if (has_rms_decay()) { + total_size += 2 + 4; + } + + // optional bool debug_info = 23 [default = false]; + if (has_debug_info()) { + total_size += 2 + 1; + } + + // optional bool snapshot_after_train = 28 [default = true]; + if (has_snapshot_after_train()) { + total_size += 2 + 1; + } + + // optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + if (has_solver_type()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->solver_type()); + } + + } + // repeated string test_net = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->test_net_size()); + for (int i = 0; i < this->test_net_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->test_net(i)); + } + + // repeated .caffe.NetParameter test_net_param = 22; + { + unsigned int count = this->test_net_param_size(); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_net_param(i)); + } + } + + // repeated .caffe.NetState test_state = 27; + { + unsigned int count = this->test_state_size(); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_state(i)); + } + } + + // repeated int32 test_iter = 3; + { + size_t data_size = 0; + unsigned int count = this->test_iter_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->test_iter(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->test_iter_size()); + total_size += data_size; + } + + // repeated int32 stepvalue = 34; + { + size_t data_size = 0; + unsigned int count = this->stepvalue_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->stepvalue(i)); + } + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->stepvalue_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SolverParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SolverParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SolverParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SolverParameter) + UnsafeMergeFrom(*source); + } +} + +void SolverParameter::MergeFrom(const SolverParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SolverParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SolverParameter::UnsafeMergeFrom(const SolverParameter& from) { + GOOGLE_DCHECK(&from != this); + test_net_.UnsafeMergeFrom(from.test_net_); + test_net_param_.MergeFrom(from.test_net_param_); + test_state_.MergeFrom(from.test_state_); + test_iter_.UnsafeMergeFrom(from.test_iter_); + stepvalue_.UnsafeMergeFrom(from.stepvalue_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_net()) { + set_has_net(); + net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.net_); + } + if (from.has_net_param()) { + mutable_net_param()->::caffe::NetParameter::MergeFrom(from.net_param()); + } + if (from.has_train_net()) { + set_has_train_net(); + train_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.train_net_); + } + if (from.has_train_net_param()) { + mutable_train_net_param()->::caffe::NetParameter::MergeFrom(from.train_net_param()); + } + if (from.has_train_state()) { + mutable_train_state()->::caffe::NetState::MergeFrom(from.train_state()); + } + } + if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) { + if (from.has_test_interval()) { + set_test_interval(from.test_interval()); + } + if (from.has_test_compute_loss()) { + set_test_compute_loss(from.test_compute_loss()); + } + if (from.has_test_initialization()) { + set_test_initialization(from.test_initialization()); + } + if (from.has_base_lr()) { + set_base_lr(from.base_lr()); + } + if (from.has_display()) { + set_display(from.display()); + } + if (from.has_average_loss()) { + set_average_loss(from.average_loss()); + } + if (from.has_max_iter()) { + set_max_iter(from.max_iter()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_iter_size()) { + set_iter_size(from.iter_size()); + } + if (from.has_lr_policy()) { + set_has_lr_policy(); + lr_policy_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lr_policy_); + } + if (from.has_gamma()) { + set_gamma(from.gamma()); + } + if (from.has_power()) { + set_power(from.power()); + } + if (from.has_momentum()) { + set_momentum(from.momentum()); + } + if (from.has_weight_decay()) { + set_weight_decay(from.weight_decay()); + } + if (from.has_regularization_type()) { + set_has_regularization_type(); + regularization_type_.AssignWithDefault(_default_regularization_type_, from.regularization_type_); + } + if (from.has_stepsize()) { + set_stepsize(from.stepsize()); + } + } + if (from._has_bits_[25 / 32] & (0xffu << (25 % 32))) { + if (from.has_clip_gradients()) { + set_clip_gradients(from.clip_gradients()); + } + if (from.has_snapshot()) { + set_snapshot(from.snapshot()); + } + if (from.has_snapshot_prefix()) { + set_has_snapshot_prefix(); + snapshot_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.snapshot_prefix_); + } + if (from.has_snapshot_diff()) { + set_snapshot_diff(from.snapshot_diff()); + } + if (from.has_snapshot_format()) { + set_snapshot_format(from.snapshot_format()); + } + if (from.has_solver_mode()) { + set_solver_mode(from.solver_mode()); + } + if (from.has_device_id()) { + set_device_id(from.device_id()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_random_seed()) { + set_random_seed(from.random_seed()); + } + if (from.has_type()) { + set_has_type(); + type_.AssignWithDefault(_default_type_, from.type_); + } + if (from.has_delta()) { + set_delta(from.delta()); + } + if (from.has_momentum2()) { + set_momentum2(from.momentum2()); + } + if (from.has_rms_decay()) { + set_rms_decay(from.rms_decay()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + if (from.has_snapshot_after_train()) { + set_snapshot_after_train(from.snapshot_after_train()); + } + if (from.has_solver_type()) { + set_solver_type(from.solver_type()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SolverParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SolverParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SolverParameter::CopyFrom(const SolverParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SolverParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SolverParameter::IsInitialized() const { + + return true; +} + +void SolverParameter::Swap(SolverParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void SolverParameter::InternalSwap(SolverParameter* other) { + net_.Swap(&other->net_); + std::swap(net_param_, other->net_param_); + train_net_.Swap(&other->train_net_); + test_net_.UnsafeArenaSwap(&other->test_net_); + std::swap(train_net_param_, other->train_net_param_); + test_net_param_.UnsafeArenaSwap(&other->test_net_param_); + std::swap(train_state_, other->train_state_); + test_state_.UnsafeArenaSwap(&other->test_state_); + test_iter_.UnsafeArenaSwap(&other->test_iter_); + std::swap(test_interval_, other->test_interval_); + std::swap(test_compute_loss_, other->test_compute_loss_); + std::swap(test_initialization_, other->test_initialization_); + std::swap(base_lr_, other->base_lr_); + std::swap(display_, other->display_); + std::swap(average_loss_, other->average_loss_); + std::swap(max_iter_, other->max_iter_); + std::swap(iter_size_, other->iter_size_); + lr_policy_.Swap(&other->lr_policy_); + std::swap(gamma_, other->gamma_); + std::swap(power_, other->power_); + std::swap(momentum_, other->momentum_); + std::swap(weight_decay_, other->weight_decay_); + regularization_type_.Swap(&other->regularization_type_); + std::swap(stepsize_, other->stepsize_); + stepvalue_.UnsafeArenaSwap(&other->stepvalue_); + std::swap(clip_gradients_, other->clip_gradients_); + std::swap(snapshot_, other->snapshot_); + snapshot_prefix_.Swap(&other->snapshot_prefix_); + std::swap(snapshot_diff_, other->snapshot_diff_); + std::swap(snapshot_format_, other->snapshot_format_); + std::swap(solver_mode_, other->solver_mode_); + std::swap(device_id_, other->device_id_); + std::swap(random_seed_, other->random_seed_); + type_.Swap(&other->type_); + std::swap(delta_, other->delta_); + std::swap(momentum2_, other->momentum2_); + std::swap(rms_decay_, other->rms_decay_); + std::swap(debug_info_, other->debug_info_); + std::swap(snapshot_after_train_, other->snapshot_after_train_); + std::swap(solver_type_, other->solver_type_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_has_bits_[1], other->_has_bits_[1]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SolverParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SolverParameter_descriptor_; + metadata.reflection = SolverParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SolverParameter + +// optional string net = 24; +bool SolverParameter::has_net() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SolverParameter::set_has_net() { + _has_bits_[0] |= 0x00000001u; +} +void SolverParameter::clear_has_net() { + _has_bits_[0] &= ~0x00000001u; +} +void SolverParameter::clear_net() { + net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_net(); +} +const ::std::string& SolverParameter::net() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.net) + return net_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_net(const ::std::string& value) { + set_has_net(); + net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.net) +} +void SolverParameter::set_net(const char* value) { + set_has_net(); + net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.net) +} +void SolverParameter::set_net(const char* value, size_t size) { + set_has_net(); + net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.net) +} +::std::string* SolverParameter::mutable_net() { + set_has_net(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.net) + return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SolverParameter::release_net() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.net) + clear_has_net(); + return net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_allocated_net(::std::string* net) { + if (net != NULL) { + set_has_net(); + } else { + clear_has_net(); + } + net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), net); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.net) +} + +// optional .caffe.NetParameter net_param = 25; +bool SolverParameter::has_net_param() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void SolverParameter::set_has_net_param() { + _has_bits_[0] |= 0x00000002u; +} +void SolverParameter::clear_has_net_param() { + _has_bits_[0] &= ~0x00000002u; +} +void SolverParameter::clear_net_param() { + if (net_param_ != NULL) net_param_->::caffe::NetParameter::Clear(); + clear_has_net_param(); +} +const ::caffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.net_param) + return net_param_ != NULL ? *net_param_ + : *::caffe::NetParameter::internal_default_instance(); +} +::caffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) { + net_param_ = new ::caffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.net_param) + return net_param_; +} +::caffe::NetParameter* SolverParameter::release_net_param() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.net_param) + clear_has_net_param(); + ::caffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +void SolverParameter::set_allocated_net_param(::caffe::NetParameter* net_param) { + delete net_param_; + net_param_ = net_param; + if (net_param) { + set_has_net_param(); + } else { + clear_has_net_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.net_param) +} + +// optional string train_net = 1; +bool SolverParameter::has_train_net() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void SolverParameter::set_has_train_net() { + _has_bits_[0] |= 0x00000004u; +} +void SolverParameter::clear_has_train_net() { + _has_bits_[0] &= ~0x00000004u; +} +void SolverParameter::clear_train_net() { + train_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_train_net(); +} +const ::std::string& SolverParameter::train_net() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.train_net) + return train_net_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_train_net(const ::std::string& value) { + set_has_train_net(); + train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.train_net) +} +void SolverParameter::set_train_net(const char* value) { + set_has_train_net(); + train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.train_net) +} +void SolverParameter::set_train_net(const char* value, size_t size) { + set_has_train_net(); + train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.train_net) +} +::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.train_net) + return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SolverParameter::release_train_net() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.train_net) + clear_has_train_net(); + return train_net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_allocated_train_net(::std::string* train_net) { + if (train_net != NULL) { + set_has_train_net(); + } else { + clear_has_train_net(); + } + train_net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), train_net); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.train_net) +} + +// repeated string test_net = 2; +int SolverParameter::test_net_size() const { + return test_net_.size(); +} +void SolverParameter::clear_test_net() { + test_net_.Clear(); +} +const ::std::string& SolverParameter::test_net(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_net) + return test_net_.Get(index); +} +::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.test_net) + return test_net_.Mutable(index); +} +void SolverParameter::set_test_net(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_net) + test_net_.Mutable(index)->assign(value); +} +void SolverParameter::set_test_net(int index, const char* value) { + test_net_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.test_net) +} +void SolverParameter::set_test_net(int index, const char* value, size_t size) { + test_net_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.test_net) +} +::std::string* SolverParameter::add_test_net() { + // @@protoc_insertion_point(field_add_mutable:caffe.SolverParameter.test_net) + return test_net_.Add(); +} +void SolverParameter::add_test_net(const ::std::string& value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_net) +} +void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.SolverParameter.test_net) +} +void SolverParameter::add_test_net(const char* value, size_t size) { + test_net_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.SolverParameter.test_net) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_net) + return test_net_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .caffe.NetParameter train_net_param = 21; +bool SolverParameter::has_train_net_param() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void SolverParameter::set_has_train_net_param() { + _has_bits_[0] |= 0x00000010u; +} +void SolverParameter::clear_has_train_net_param() { + _has_bits_[0] &= ~0x00000010u; +} +void SolverParameter::clear_train_net_param() { + if (train_net_param_ != NULL) train_net_param_->::caffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +const ::caffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.train_net_param) + return train_net_param_ != NULL ? *train_net_param_ + : *::caffe::NetParameter::internal_default_instance(); +} +::caffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) { + train_net_param_ = new ::caffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.train_net_param) + return train_net_param_; +} +::caffe::NetParameter* SolverParameter::release_train_net_param() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.train_net_param) + clear_has_train_net_param(); + ::caffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +void SolverParameter::set_allocated_train_net_param(::caffe::NetParameter* train_net_param) { + delete train_net_param_; + train_net_param_ = train_net_param; + if (train_net_param) { + set_has_train_net_param(); + } else { + clear_has_train_net_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.train_net_param) +} + +// repeated .caffe.NetParameter test_net_param = 22; +int SolverParameter::test_net_param_size() const { + return test_net_param_.size(); +} +void SolverParameter::clear_test_net_param() { + test_net_param_.Clear(); +} +const ::caffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +::caffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +::caffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_net_param) + return &test_net_param_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_net_param) + return test_net_param_; +} + +// optional .caffe.NetState train_state = 26; +bool SolverParameter::has_train_state() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void SolverParameter::set_has_train_state() { + _has_bits_[0] |= 0x00000040u; +} +void SolverParameter::clear_has_train_state() { + _has_bits_[0] &= ~0x00000040u; +} +void SolverParameter::clear_train_state() { + if (train_state_ != NULL) train_state_->::caffe::NetState::Clear(); + clear_has_train_state(); +} +const ::caffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.train_state) + return train_state_ != NULL ? *train_state_ + : *::caffe::NetState::internal_default_instance(); +} +::caffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) { + train_state_ = new ::caffe::NetState; + } + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.train_state) + return train_state_; +} +::caffe::NetState* SolverParameter::release_train_state() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.train_state) + clear_has_train_state(); + ::caffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +void SolverParameter::set_allocated_train_state(::caffe::NetState* train_state) { + delete train_state_; + train_state_ = train_state; + if (train_state) { + set_has_train_state(); + } else { + clear_has_train_state(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.train_state) +} + +// repeated .caffe.NetState test_state = 27; +int SolverParameter::test_state_size() const { + return test_state_.size(); +} +void SolverParameter::clear_test_state() { + test_state_.Clear(); +} +const ::caffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_state) + return test_state_.Get(index); +} +::caffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +::caffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_state) + return test_state_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_state) + return &test_state_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_state) + return test_state_; +} + +// repeated int32 test_iter = 3; +int SolverParameter::test_iter_size() const { + return test_iter_.size(); +} +void SolverParameter::clear_test_iter() { + test_iter_.Clear(); +} +::google::protobuf::int32 SolverParameter::test_iter(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_iter) + return test_iter_.Get(index); +} +void SolverParameter::set_test_iter(int index, ::google::protobuf::int32 value) { + test_iter_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_iter) +} +void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_iter) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_iter) + return test_iter_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_iter) + return &test_iter_; +} + +// optional int32 test_interval = 4 [default = 0]; +bool SolverParameter::has_test_interval() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void SolverParameter::set_has_test_interval() { + _has_bits_[0] |= 0x00000200u; +} +void SolverParameter::clear_has_test_interval() { + _has_bits_[0] &= ~0x00000200u; +} +void SolverParameter::clear_test_interval() { + test_interval_ = 0; + clear_has_test_interval(); +} +::google::protobuf::int32 SolverParameter::test_interval() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_interval) + return test_interval_; +} +void SolverParameter::set_test_interval(::google::protobuf::int32 value) { + set_has_test_interval(); + test_interval_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_interval) +} + +// optional bool test_compute_loss = 19 [default = false]; +bool SolverParameter::has_test_compute_loss() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void SolverParameter::set_has_test_compute_loss() { + _has_bits_[0] |= 0x00000400u; +} +void SolverParameter::clear_has_test_compute_loss() { + _has_bits_[0] &= ~0x00000400u; +} +void SolverParameter::clear_test_compute_loss() { + test_compute_loss_ = false; + clear_has_test_compute_loss(); +} +bool SolverParameter::test_compute_loss() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_compute_loss) + return test_compute_loss_; +} +void SolverParameter::set_test_compute_loss(bool value) { + set_has_test_compute_loss(); + test_compute_loss_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_compute_loss) +} + +// optional bool test_initialization = 32 [default = true]; +bool SolverParameter::has_test_initialization() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void SolverParameter::set_has_test_initialization() { + _has_bits_[0] |= 0x00000800u; +} +void SolverParameter::clear_has_test_initialization() { + _has_bits_[0] &= ~0x00000800u; +} +void SolverParameter::clear_test_initialization() { + test_initialization_ = true; + clear_has_test_initialization(); +} +bool SolverParameter::test_initialization() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_initialization) + return test_initialization_; +} +void SolverParameter::set_test_initialization(bool value) { + set_has_test_initialization(); + test_initialization_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_initialization) +} + +// optional float base_lr = 5; +bool SolverParameter::has_base_lr() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void SolverParameter::set_has_base_lr() { + _has_bits_[0] |= 0x00001000u; +} +void SolverParameter::clear_has_base_lr() { + _has_bits_[0] &= ~0x00001000u; +} +void SolverParameter::clear_base_lr() { + base_lr_ = 0; + clear_has_base_lr(); +} +float SolverParameter::base_lr() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.base_lr) + return base_lr_; +} +void SolverParameter::set_base_lr(float value) { + set_has_base_lr(); + base_lr_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.base_lr) +} + +// optional int32 display = 6; +bool SolverParameter::has_display() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +void SolverParameter::set_has_display() { + _has_bits_[0] |= 0x00002000u; +} +void SolverParameter::clear_has_display() { + _has_bits_[0] &= ~0x00002000u; +} +void SolverParameter::clear_display() { + display_ = 0; + clear_has_display(); +} +::google::protobuf::int32 SolverParameter::display() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.display) + return display_; +} +void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.display) +} + +// optional int32 average_loss = 33 [default = 1]; +bool SolverParameter::has_average_loss() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +void SolverParameter::set_has_average_loss() { + _has_bits_[0] |= 0x00004000u; +} +void SolverParameter::clear_has_average_loss() { + _has_bits_[0] &= ~0x00004000u; +} +void SolverParameter::clear_average_loss() { + average_loss_ = 1; + clear_has_average_loss(); +} +::google::protobuf::int32 SolverParameter::average_loss() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.average_loss) + return average_loss_; +} +void SolverParameter::set_average_loss(::google::protobuf::int32 value) { + set_has_average_loss(); + average_loss_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.average_loss) +} + +// optional int32 max_iter = 7; +bool SolverParameter::has_max_iter() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +void SolverParameter::set_has_max_iter() { + _has_bits_[0] |= 0x00008000u; +} +void SolverParameter::clear_has_max_iter() { + _has_bits_[0] &= ~0x00008000u; +} +void SolverParameter::clear_max_iter() { + max_iter_ = 0; + clear_has_max_iter(); +} +::google::protobuf::int32 SolverParameter::max_iter() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.max_iter) + return max_iter_; +} +void SolverParameter::set_max_iter(::google::protobuf::int32 value) { + set_has_max_iter(); + max_iter_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.max_iter) +} + +// optional int32 iter_size = 36 [default = 1]; +bool SolverParameter::has_iter_size() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +void SolverParameter::set_has_iter_size() { + _has_bits_[0] |= 0x00010000u; +} +void SolverParameter::clear_has_iter_size() { + _has_bits_[0] &= ~0x00010000u; +} +void SolverParameter::clear_iter_size() { + iter_size_ = 1; + clear_has_iter_size(); +} +::google::protobuf::int32 SolverParameter::iter_size() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.iter_size) + return iter_size_; +} +void SolverParameter::set_iter_size(::google::protobuf::int32 value) { + set_has_iter_size(); + iter_size_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.iter_size) +} + +// optional string lr_policy = 8; +bool SolverParameter::has_lr_policy() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +void SolverParameter::set_has_lr_policy() { + _has_bits_[0] |= 0x00020000u; +} +void SolverParameter::clear_has_lr_policy() { + _has_bits_[0] &= ~0x00020000u; +} +void SolverParameter::clear_lr_policy() { + lr_policy_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_lr_policy(); +} +const ::std::string& SolverParameter::lr_policy() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.lr_policy) + return lr_policy_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_lr_policy(const ::std::string& value) { + set_has_lr_policy(); + lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.lr_policy) +} +void SolverParameter::set_lr_policy(const char* value) { + set_has_lr_policy(); + lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.lr_policy) +} +void SolverParameter::set_lr_policy(const char* value, size_t size) { + set_has_lr_policy(); + lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.lr_policy) +} +::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.lr_policy) + return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SolverParameter::release_lr_policy() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.lr_policy) + clear_has_lr_policy(); + return lr_policy_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_allocated_lr_policy(::std::string* lr_policy) { + if (lr_policy != NULL) { + set_has_lr_policy(); + } else { + clear_has_lr_policy(); + } + lr_policy_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), lr_policy); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.lr_policy) +} + +// optional float gamma = 9; +bool SolverParameter::has_gamma() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +void SolverParameter::set_has_gamma() { + _has_bits_[0] |= 0x00040000u; +} +void SolverParameter::clear_has_gamma() { + _has_bits_[0] &= ~0x00040000u; +} +void SolverParameter::clear_gamma() { + gamma_ = 0; + clear_has_gamma(); +} +float SolverParameter::gamma() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.gamma) + return gamma_; +} +void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.gamma) +} + +// optional float power = 10; +bool SolverParameter::has_power() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +void SolverParameter::set_has_power() { + _has_bits_[0] |= 0x00080000u; +} +void SolverParameter::clear_has_power() { + _has_bits_[0] &= ~0x00080000u; +} +void SolverParameter::clear_power() { + power_ = 0; + clear_has_power(); +} +float SolverParameter::power() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.power) + return power_; +} +void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.power) +} + +// optional float momentum = 11; +bool SolverParameter::has_momentum() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +void SolverParameter::set_has_momentum() { + _has_bits_[0] |= 0x00100000u; +} +void SolverParameter::clear_has_momentum() { + _has_bits_[0] &= ~0x00100000u; +} +void SolverParameter::clear_momentum() { + momentum_ = 0; + clear_has_momentum(); +} +float SolverParameter::momentum() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.momentum) + return momentum_; +} +void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.momentum) +} + +// optional float weight_decay = 12; +bool SolverParameter::has_weight_decay() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +void SolverParameter::set_has_weight_decay() { + _has_bits_[0] |= 0x00200000u; +} +void SolverParameter::clear_has_weight_decay() { + _has_bits_[0] &= ~0x00200000u; +} +void SolverParameter::clear_weight_decay() { + weight_decay_ = 0; + clear_has_weight_decay(); +} +float SolverParameter::weight_decay() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.weight_decay) + return weight_decay_; +} +void SolverParameter::set_weight_decay(float value) { + set_has_weight_decay(); + weight_decay_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.weight_decay) +} + +// optional string regularization_type = 29 [default = "L2"]; +bool SolverParameter::has_regularization_type() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +void SolverParameter::set_has_regularization_type() { + _has_bits_[0] |= 0x00400000u; +} +void SolverParameter::clear_has_regularization_type() { + _has_bits_[0] &= ~0x00400000u; +} +void SolverParameter::clear_regularization_type() { + regularization_type_.ClearToDefaultNoArena(_default_regularization_type_); + clear_has_regularization_type(); +} +const ::std::string& SolverParameter::regularization_type() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.regularization_type) + return regularization_type_.GetNoArena(_default_regularization_type_); +} +void SolverParameter::set_regularization_type(const ::std::string& value) { + set_has_regularization_type(); + regularization_type_.SetNoArena(_default_regularization_type_, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.regularization_type) +} +void SolverParameter::set_regularization_type(const char* value) { + set_has_regularization_type(); + regularization_type_.SetNoArena(_default_regularization_type_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.regularization_type) +} +void SolverParameter::set_regularization_type(const char* value, size_t size) { + set_has_regularization_type(); + regularization_type_.SetNoArena(_default_regularization_type_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.regularization_type) +} +::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.regularization_type) + return regularization_type_.MutableNoArena(_default_regularization_type_); +} +::std::string* SolverParameter::release_regularization_type() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.regularization_type) + clear_has_regularization_type(); + return regularization_type_.ReleaseNoArena(_default_regularization_type_); +} +void SolverParameter::set_allocated_regularization_type(::std::string* regularization_type) { + if (regularization_type != NULL) { + set_has_regularization_type(); + } else { + clear_has_regularization_type(); + } + regularization_type_.SetAllocatedNoArena(_default_regularization_type_, regularization_type); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.regularization_type) +} + +// optional int32 stepsize = 13; +bool SolverParameter::has_stepsize() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +void SolverParameter::set_has_stepsize() { + _has_bits_[0] |= 0x00800000u; +} +void SolverParameter::clear_has_stepsize() { + _has_bits_[0] &= ~0x00800000u; +} +void SolverParameter::clear_stepsize() { + stepsize_ = 0; + clear_has_stepsize(); +} +::google::protobuf::int32 SolverParameter::stepsize() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.stepsize) + return stepsize_; +} +void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.stepsize) +} + +// repeated int32 stepvalue = 34; +int SolverParameter::stepvalue_size() const { + return stepvalue_.size(); +} +void SolverParameter::clear_stepvalue() { + stepvalue_.Clear(); +} +::google::protobuf::int32 SolverParameter::stepvalue(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.stepvalue) + return stepvalue_.Get(index); +} +void SolverParameter::set_stepvalue(int index, ::google::protobuf::int32 value) { + stepvalue_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.stepvalue) +} +void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:caffe.SolverParameter.stepvalue) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.stepvalue) + return stepvalue_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.stepvalue) + return &stepvalue_; +} + +// optional float clip_gradients = 35 [default = -1]; +bool SolverParameter::has_clip_gradients() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +void SolverParameter::set_has_clip_gradients() { + _has_bits_[0] |= 0x02000000u; +} +void SolverParameter::clear_has_clip_gradients() { + _has_bits_[0] &= ~0x02000000u; +} +void SolverParameter::clear_clip_gradients() { + clip_gradients_ = -1; + clear_has_clip_gradients(); +} +float SolverParameter::clip_gradients() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.clip_gradients) + return clip_gradients_; +} +void SolverParameter::set_clip_gradients(float value) { + set_has_clip_gradients(); + clip_gradients_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.clip_gradients) +} + +// optional int32 snapshot = 14 [default = 0]; +bool SolverParameter::has_snapshot() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +void SolverParameter::set_has_snapshot() { + _has_bits_[0] |= 0x04000000u; +} +void SolverParameter::clear_has_snapshot() { + _has_bits_[0] &= ~0x04000000u; +} +void SolverParameter::clear_snapshot() { + snapshot_ = 0; + clear_has_snapshot(); +} +::google::protobuf::int32 SolverParameter::snapshot() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot) + return snapshot_; +} +void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot) +} + +// optional string snapshot_prefix = 15; +bool SolverParameter::has_snapshot_prefix() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +void SolverParameter::set_has_snapshot_prefix() { + _has_bits_[0] |= 0x08000000u; +} +void SolverParameter::clear_has_snapshot_prefix() { + _has_bits_[0] &= ~0x08000000u; +} +void SolverParameter::clear_snapshot_prefix() { + snapshot_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_snapshot_prefix(); +} +const ::std::string& SolverParameter::snapshot_prefix() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_snapshot_prefix(const ::std::string& value) { + set_has_snapshot_prefix(); + snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_prefix) +} +void SolverParameter::set_snapshot_prefix(const char* value) { + set_has_snapshot_prefix(); + snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.snapshot_prefix) +} +void SolverParameter::set_snapshot_prefix(const char* value, size_t size) { + set_has_snapshot_prefix(); + snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.snapshot_prefix) +} +::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SolverParameter::release_snapshot_prefix() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.snapshot_prefix) + clear_has_snapshot_prefix(); + return snapshot_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverParameter::set_allocated_snapshot_prefix(::std::string* snapshot_prefix) { + if (snapshot_prefix != NULL) { + set_has_snapshot_prefix(); + } else { + clear_has_snapshot_prefix(); + } + snapshot_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), snapshot_prefix); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.snapshot_prefix) +} + +// optional bool snapshot_diff = 16 [default = false]; +bool SolverParameter::has_snapshot_diff() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +void SolverParameter::set_has_snapshot_diff() { + _has_bits_[0] |= 0x10000000u; +} +void SolverParameter::clear_has_snapshot_diff() { + _has_bits_[0] &= ~0x10000000u; +} +void SolverParameter::clear_snapshot_diff() { + snapshot_diff_ = false; + clear_has_snapshot_diff(); +} +bool SolverParameter::snapshot_diff() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_diff) + return snapshot_diff_; +} +void SolverParameter::set_snapshot_diff(bool value) { + set_has_snapshot_diff(); + snapshot_diff_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_diff) +} + +// optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; +bool SolverParameter::has_snapshot_format() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +void SolverParameter::set_has_snapshot_format() { + _has_bits_[0] |= 0x20000000u; +} +void SolverParameter::clear_has_snapshot_format() { + _has_bits_[0] &= ~0x20000000u; +} +void SolverParameter::clear_snapshot_format() { + snapshot_format_ = 1; + clear_has_snapshot_format(); +} +::caffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_format) + return static_cast< ::caffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} +void SolverParameter::set_snapshot_format(::caffe::SolverParameter_SnapshotFormat value) { + assert(::caffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_format) +} + +// optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; +bool SolverParameter::has_solver_mode() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +void SolverParameter::set_has_solver_mode() { + _has_bits_[0] |= 0x40000000u; +} +void SolverParameter::clear_has_solver_mode() { + _has_bits_[0] &= ~0x40000000u; +} +void SolverParameter::clear_solver_mode() { + solver_mode_ = 1; + clear_has_solver_mode(); +} +::caffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.solver_mode) + return static_cast< ::caffe::SolverParameter_SolverMode >(solver_mode_); +} +void SolverParameter::set_solver_mode(::caffe::SolverParameter_SolverMode value) { + assert(::caffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.solver_mode) +} + +// optional int32 device_id = 18 [default = 0]; +bool SolverParameter::has_device_id() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +void SolverParameter::set_has_device_id() { + _has_bits_[0] |= 0x80000000u; +} +void SolverParameter::clear_has_device_id() { + _has_bits_[0] &= ~0x80000000u; +} +void SolverParameter::clear_device_id() { + device_id_ = 0; + clear_has_device_id(); +} +::google::protobuf::int32 SolverParameter::device_id() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.device_id) + return device_id_; +} +void SolverParameter::set_device_id(::google::protobuf::int32 value) { + set_has_device_id(); + device_id_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.device_id) +} + +// optional int64 random_seed = 20 [default = -1]; +bool SolverParameter::has_random_seed() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +void SolverParameter::set_has_random_seed() { + _has_bits_[1] |= 0x00000001u; +} +void SolverParameter::clear_has_random_seed() { + _has_bits_[1] &= ~0x00000001u; +} +void SolverParameter::clear_random_seed() { + random_seed_ = GOOGLE_LONGLONG(-1); + clear_has_random_seed(); +} +::google::protobuf::int64 SolverParameter::random_seed() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.random_seed) + return random_seed_; +} +void SolverParameter::set_random_seed(::google::protobuf::int64 value) { + set_has_random_seed(); + random_seed_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.random_seed) +} + +// optional string type = 40 [default = "SGD"]; +bool SolverParameter::has_type() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +void SolverParameter::set_has_type() { + _has_bits_[1] |= 0x00000002u; +} +void SolverParameter::clear_has_type() { + _has_bits_[1] &= ~0x00000002u; +} +void SolverParameter::clear_type() { + type_.ClearToDefaultNoArena(_default_type_); + clear_has_type(); +} +const ::std::string& SolverParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.type) + return type_.GetNoArena(_default_type_); +} +void SolverParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(_default_type_, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.type) +} +void SolverParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(_default_type_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.type) +} +void SolverParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(_default_type_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.type) +} +::std::string* SolverParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.type) + return type_.MutableNoArena(_default_type_); +} +::std::string* SolverParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(_default_type_); +} +void SolverParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(_default_type_, type); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.type) +} + +// optional float delta = 31 [default = 1e-08]; +bool SolverParameter::has_delta() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +void SolverParameter::set_has_delta() { + _has_bits_[1] |= 0x00000004u; +} +void SolverParameter::clear_has_delta() { + _has_bits_[1] &= ~0x00000004u; +} +void SolverParameter::clear_delta() { + delta_ = 1e-08f; + clear_has_delta(); +} +float SolverParameter::delta() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.delta) + return delta_; +} +void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.delta) +} + +// optional float momentum2 = 39 [default = 0.999]; +bool SolverParameter::has_momentum2() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +void SolverParameter::set_has_momentum2() { + _has_bits_[1] |= 0x00000008u; +} +void SolverParameter::clear_has_momentum2() { + _has_bits_[1] &= ~0x00000008u; +} +void SolverParameter::clear_momentum2() { + momentum2_ = 0.999f; + clear_has_momentum2(); +} +float SolverParameter::momentum2() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.momentum2) + return momentum2_; +} +void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38 [default = 0.99]; +bool SolverParameter::has_rms_decay() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +void SolverParameter::set_has_rms_decay() { + _has_bits_[1] |= 0x00000010u; +} +void SolverParameter::clear_has_rms_decay() { + _has_bits_[1] &= ~0x00000010u; +} +void SolverParameter::clear_rms_decay() { + rms_decay_ = 0.99f; + clear_has_rms_decay(); +} +float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.rms_decay) + return rms_decay_; +} +void SolverParameter::set_rms_decay(float value) { + set_has_rms_decay(); + rms_decay_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.rms_decay) +} + +// optional bool debug_info = 23 [default = false]; +bool SolverParameter::has_debug_info() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +void SolverParameter::set_has_debug_info() { + _has_bits_[1] |= 0x00000020u; +} +void SolverParameter::clear_has_debug_info() { + _has_bits_[1] &= ~0x00000020u; +} +void SolverParameter::clear_debug_info() { + debug_info_ = false; + clear_has_debug_info(); +} +bool SolverParameter::debug_info() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.debug_info) + return debug_info_; +} +void SolverParameter::set_debug_info(bool value) { + set_has_debug_info(); + debug_info_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.debug_info) +} + +// optional bool snapshot_after_train = 28 [default = true]; +bool SolverParameter::has_snapshot_after_train() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +void SolverParameter::set_has_snapshot_after_train() { + _has_bits_[1] |= 0x00000040u; +} +void SolverParameter::clear_has_snapshot_after_train() { + _has_bits_[1] &= ~0x00000040u; +} +void SolverParameter::clear_snapshot_after_train() { + snapshot_after_train_ = true; + clear_has_snapshot_after_train(); +} +bool SolverParameter::snapshot_after_train() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_after_train) + return snapshot_after_train_; +} +void SolverParameter::set_snapshot_after_train(bool value) { + set_has_snapshot_after_train(); + snapshot_after_train_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_after_train) +} + +// optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; +bool SolverParameter::has_solver_type() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +void SolverParameter::set_has_solver_type() { + _has_bits_[1] |= 0x00000080u; +} +void SolverParameter::clear_has_solver_type() { + _has_bits_[1] &= ~0x00000080u; +} +void SolverParameter::clear_solver_type() { + solver_type_ = 0; + clear_has_solver_type(); +} +::caffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.solver_type) + return static_cast< ::caffe::SolverParameter_SolverType >(solver_type_); +} +void SolverParameter::set_solver_type(::caffe::SolverParameter_SolverType value) { + assert(::caffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.solver_type) +} + +inline const SolverParameter* SolverParameter::internal_default_instance() { + return &SolverParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SolverState::kIterFieldNumber; +const int SolverState::kLearnedNetFieldNumber; +const int SolverState::kHistoryFieldNumber; +const int SolverState::kCurrentStepFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SolverState::SolverState() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SolverState) +} + +void SolverState::InitAsDefaultInstance() { +} + +SolverState::SolverState(const SolverState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SolverState) +} + +void SolverState::SharedCtor() { + _cached_size_ = 0; + learned_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&iter_, 0, reinterpret_cast(¤t_step_) - + reinterpret_cast(&iter_) + sizeof(current_step_)); +} + +SolverState::~SolverState() { + // @@protoc_insertion_point(destructor:caffe.SolverState) + SharedDtor(); +} + +void SolverState::SharedDtor() { + learned_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SolverState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SolverState::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SolverState_descriptor_; +} + +const SolverState& SolverState::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SolverState_default_instance_; + +SolverState* SolverState::New(::google::protobuf::Arena* arena) const { + SolverState* n = new SolverState; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SolverState::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SolverState) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(SolverState, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 11u) { + ZR_(iter_, current_step_); + if (has_learned_net()) { + learned_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + history_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SolverState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SolverState) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 iter = 1; + case 1: { + if (tag == 8) { + set_has_iter(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_learned_net; + break; + } + + // optional string learned_net = 2; + case 2: { + if (tag == 18) { + parse_learned_net: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_learned_net())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->learned_net().data(), this->learned_net().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SolverState.learned_net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + break; + } + + // repeated .caffe.BlobProto history = 3; + case 3: { + if (tag == 26) { + parse_history: + DO_(input->IncrementRecursionDepth()); + parse_loop_history: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_history())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_loop_history; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(32)) goto parse_current_step; + break; + } + + // optional int32 current_step = 4 [default = 0]; + case 4: { + if (tag == 32) { + parse_current_step: + set_has_current_step(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, ¤t_step_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SolverState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SolverState) + return false; +#undef DO_ +} + +void SolverState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SolverState) + // optional int32 iter = 1; + if (has_iter()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->iter(), output); + } + + // optional string learned_net = 2; + if (has_learned_net()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->learned_net().data(), this->learned_net().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverState.learned_net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->learned_net(), output); + } + + // repeated .caffe.BlobProto history = 3; + for (unsigned int i = 0, n = this->history_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->history(i), output); + } + + // optional int32 current_step = 4 [default = 0]; + if (has_current_step()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->current_step(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SolverState) +} + +::google::protobuf::uint8* SolverState::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SolverState) + // optional int32 iter = 1; + if (has_iter()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->iter(), target); + } + + // optional string learned_net = 2; + if (has_learned_net()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->learned_net().data(), this->learned_net().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SolverState.learned_net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->learned_net(), target); + } + + // repeated .caffe.BlobProto history = 3; + for (unsigned int i = 0, n = this->history_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, this->history(i), false, target); + } + + // optional int32 current_step = 4 [default = 0]; + if (has_current_step()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->current_step(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SolverState) + return target; +} + +size_t SolverState::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SolverState) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 11u) { + // optional int32 iter = 1; + if (has_iter()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->iter()); + } + + // optional string learned_net = 2; + if (has_learned_net()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->learned_net()); + } + + // optional int32 current_step = 4 [default = 0]; + if (has_current_step()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->current_step()); + } + + } + // repeated .caffe.BlobProto history = 3; + { + unsigned int count = this->history_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->history(i)); + } + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SolverState) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SolverState* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SolverState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SolverState) + UnsafeMergeFrom(*source); + } +} + +void SolverState::MergeFrom(const SolverState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SolverState) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SolverState::UnsafeMergeFrom(const SolverState& from) { + GOOGLE_DCHECK(&from != this); + history_.MergeFrom(from.history_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_iter()) { + set_iter(from.iter()); + } + if (from.has_learned_net()) { + set_has_learned_net(); + learned_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.learned_net_); + } + if (from.has_current_step()) { + set_current_step(from.current_step()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SolverState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SolverState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SolverState::CopyFrom(const SolverState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SolverState) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SolverState::IsInitialized() const { + + return true; +} + +void SolverState::Swap(SolverState* other) { + if (other == this) return; + InternalSwap(other); +} +void SolverState::InternalSwap(SolverState* other) { + std::swap(iter_, other->iter_); + learned_net_.Swap(&other->learned_net_); + history_.UnsafeArenaSwap(&other->history_); + std::swap(current_step_, other->current_step_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SolverState::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SolverState_descriptor_; + metadata.reflection = SolverState_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SolverState + +// optional int32 iter = 1; +bool SolverState::has_iter() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SolverState::set_has_iter() { + _has_bits_[0] |= 0x00000001u; +} +void SolverState::clear_has_iter() { + _has_bits_[0] &= ~0x00000001u; +} +void SolverState::clear_iter() { + iter_ = 0; + clear_has_iter(); +} +::google::protobuf::int32 SolverState::iter() const { + // @@protoc_insertion_point(field_get:caffe.SolverState.iter) + return iter_; +} +void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverState.iter) +} + +// optional string learned_net = 2; +bool SolverState::has_learned_net() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void SolverState::set_has_learned_net() { + _has_bits_[0] |= 0x00000002u; +} +void SolverState::clear_has_learned_net() { + _has_bits_[0] &= ~0x00000002u; +} +void SolverState::clear_learned_net() { + learned_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_learned_net(); +} +const ::std::string& SolverState::learned_net() const { + // @@protoc_insertion_point(field_get:caffe.SolverState.learned_net) + return learned_net_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverState::set_learned_net(const ::std::string& value) { + set_has_learned_net(); + learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverState.learned_net) +} +void SolverState::set_learned_net(const char* value) { + set_has_learned_net(); + learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverState.learned_net) +} +void SolverState::set_learned_net(const char* value, size_t size) { + set_has_learned_net(); + learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverState.learned_net) +} +::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + // @@protoc_insertion_point(field_mutable:caffe.SolverState.learned_net) + return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SolverState::release_learned_net() { + // @@protoc_insertion_point(field_release:caffe.SolverState.learned_net) + clear_has_learned_net(); + return learned_net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SolverState::set_allocated_learned_net(::std::string* learned_net) { + if (learned_net != NULL) { + set_has_learned_net(); + } else { + clear_has_learned_net(); + } + learned_net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), learned_net); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverState.learned_net) +} + +// repeated .caffe.BlobProto history = 3; +int SolverState::history_size() const { + return history_.size(); +} +void SolverState::clear_history() { + history_.Clear(); +} +const ::caffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverState.history) + return history_.Get(index); +} +::caffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverState.history) + return history_.Mutable(index); +} +::caffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:caffe.SolverState.history) + return history_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverState.history) + return &history_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:caffe.SolverState.history) + return history_; +} + +// optional int32 current_step = 4 [default = 0]; +bool SolverState::has_current_step() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void SolverState::set_has_current_step() { + _has_bits_[0] |= 0x00000008u; +} +void SolverState::clear_has_current_step() { + _has_bits_[0] &= ~0x00000008u; +} +void SolverState::clear_current_step() { + current_step_ = 0; + clear_has_current_step(); +} +::google::protobuf::int32 SolverState::current_step() const { + // @@protoc_insertion_point(field_get:caffe.SolverState.current_step) + return current_step_; +} +void SolverState::set_current_step(::google::protobuf::int32 value) { + set_has_current_step(); + current_step_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverState.current_step) +} + +inline const SolverState* SolverState::internal_default_instance() { + return &SolverState_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NetState::kPhaseFieldNumber; +const int NetState::kLevelFieldNumber; +const int NetState::kStageFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NetState::NetState() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.NetState) +} + +void NetState::InitAsDefaultInstance() { +} + +NetState::NetState(const NetState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.NetState) +} + +void NetState::SharedCtor() { + _cached_size_ = 0; + level_ = 0; + phase_ = 1; +} + +NetState::~NetState() { + // @@protoc_insertion_point(destructor:caffe.NetState) + SharedDtor(); +} + +void NetState::SharedDtor() { +} + +void NetState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NetState::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NetState_descriptor_; +} + +const NetState& NetState::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NetState_default_instance_; + +NetState* NetState::New(::google::protobuf::Arena* arena) const { + NetState* n = new NetState; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void NetState::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.NetState) + if (_has_bits_[0 / 32] & 3u) { + phase_ = 1; + level_ = 0; + } + stage_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool NetState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.NetState) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.Phase phase = 1 [default = TEST]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::Phase_IsValid(value)) { + set_phase(static_cast< ::caffe::Phase >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_level; + break; + } + + // optional int32 level = 2 [default = 0]; + case 2: { + if (tag == 16) { + parse_level: + set_has_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &level_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_stage; + break; + } + + // repeated string stage = 3; + case 3: { + if (tag == 26) { + parse_stage: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_stage())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->stage(this->stage_size() - 1).data(), + this->stage(this->stage_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.NetState.stage"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_stage; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.NetState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.NetState) + return false; +#undef DO_ +} + +void NetState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.NetState) + // optional .caffe.Phase phase = 1 [default = TEST]; + if (has_phase()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->phase(), output); + } + + // optional int32 level = 2 [default = 0]; + if (has_level()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->level(), output); + } + + // repeated string stage = 3; + for (int i = 0; i < this->stage_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->stage(i).data(), this->stage(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetState.stage"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->stage(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.NetState) +} + +::google::protobuf::uint8* NetState::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.NetState) + // optional .caffe.Phase phase = 1 [default = TEST]; + if (has_phase()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->phase(), target); + } + + // optional int32 level = 2 [default = 0]; + if (has_level()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->level(), target); + } + + // repeated string stage = 3; + for (int i = 0; i < this->stage_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->stage(i).data(), this->stage(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetState.stage"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->stage(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.NetState) + return target; +} + +size_t NetState::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.NetState) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .caffe.Phase phase = 1 [default = TEST]; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + // optional int32 level = 2 [default = 0]; + if (has_level()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->level()); + } + + } + // repeated string stage = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->stage_size()); + for (int i = 0; i < this->stage_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->stage(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.NetState) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NetState* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.NetState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.NetState) + UnsafeMergeFrom(*source); + } +} + +void NetState::MergeFrom(const NetState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.NetState) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NetState::UnsafeMergeFrom(const NetState& from) { + GOOGLE_DCHECK(&from != this); + stage_.UnsafeMergeFrom(from.stage_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_phase()) { + set_phase(from.phase()); + } + if (from.has_level()) { + set_level(from.level()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void NetState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.NetState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetState::CopyFrom(const NetState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.NetState) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NetState::IsInitialized() const { + + return true; +} + +void NetState::Swap(NetState* other) { + if (other == this) return; + InternalSwap(other); +} +void NetState::InternalSwap(NetState* other) { + std::swap(phase_, other->phase_); + std::swap(level_, other->level_); + stage_.UnsafeArenaSwap(&other->stage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NetState::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NetState_descriptor_; + metadata.reflection = NetState_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NetState + +// optional .caffe.Phase phase = 1 [default = TEST]; +bool NetState::has_phase() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void NetState::set_has_phase() { + _has_bits_[0] |= 0x00000001u; +} +void NetState::clear_has_phase() { + _has_bits_[0] &= ~0x00000001u; +} +void NetState::clear_phase() { + phase_ = 1; + clear_has_phase(); +} +::caffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:caffe.NetState.phase) + return static_cast< ::caffe::Phase >(phase_); +} +void NetState::set_phase(::caffe::Phase value) { + assert(::caffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:caffe.NetState.phase) +} + +// optional int32 level = 2 [default = 0]; +bool NetState::has_level() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void NetState::set_has_level() { + _has_bits_[0] |= 0x00000002u; +} +void NetState::clear_has_level() { + _has_bits_[0] &= ~0x00000002u; +} +void NetState::clear_level() { + level_ = 0; + clear_has_level(); +} +::google::protobuf::int32 NetState::level() const { + // @@protoc_insertion_point(field_get:caffe.NetState.level) + return level_; +} +void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:caffe.NetState.level) +} + +// repeated string stage = 3; +int NetState::stage_size() const { + return stage_.size(); +} +void NetState::clear_stage() { + stage_.Clear(); +} +const ::std::string& NetState::stage(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetState.stage) + return stage_.Get(index); +} +::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetState.stage) + return stage_.Mutable(index); +} +void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetState.stage) + stage_.Mutable(index)->assign(value); +} +void NetState::set_stage(int index, const char* value) { + stage_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetState.stage) +} +void NetState::set_stage(int index, const char* value, size_t size) { + stage_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetState.stage) +} +::std::string* NetState::add_stage() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetState.stage) + return stage_.Add(); +} +void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetState.stage) +} +void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetState.stage) +} +void NetState::add_stage(const char* value, size_t size) { + stage_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetState.stage) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:caffe.NetState.stage) + return stage_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetState.stage) + return &stage_; +} + +inline const NetState* NetState::internal_default_instance() { + return &NetState_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NetStateRule::kPhaseFieldNumber; +const int NetStateRule::kMinLevelFieldNumber; +const int NetStateRule::kMaxLevelFieldNumber; +const int NetStateRule::kStageFieldNumber; +const int NetStateRule::kNotStageFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NetStateRule::NetStateRule() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.NetStateRule) +} + +void NetStateRule::InitAsDefaultInstance() { +} + +NetStateRule::NetStateRule(const NetStateRule& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.NetStateRule) +} + +void NetStateRule::SharedCtor() { + _cached_size_ = 0; + ::memset(&phase_, 0, reinterpret_cast(&max_level_) - + reinterpret_cast(&phase_) + sizeof(max_level_)); +} + +NetStateRule::~NetStateRule() { + // @@protoc_insertion_point(destructor:caffe.NetStateRule) + SharedDtor(); +} + +void NetStateRule::SharedDtor() { +} + +void NetStateRule::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NetStateRule::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NetStateRule_descriptor_; +} + +const NetStateRule& NetStateRule::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NetStateRule_default_instance_; + +NetStateRule* NetStateRule::New(::google::protobuf::Arena* arena) const { + NetStateRule* n = new NetStateRule; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void NetStateRule::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.NetStateRule) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(NetStateRule, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(phase_, max_level_); + +#undef ZR_HELPER_ +#undef ZR_ + + stage_.Clear(); + not_stage_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool NetStateRule::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.NetStateRule) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.Phase phase = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::Phase_IsValid(value)) { + set_phase(static_cast< ::caffe::Phase >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_min_level; + break; + } + + // optional int32 min_level = 2; + case 2: { + if (tag == 16) { + parse_min_level: + set_has_min_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_level_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_max_level; + break; + } + + // optional int32 max_level = 3; + case 3: { + if (tag == 24) { + parse_max_level: + set_has_max_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_level_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_stage; + break; + } + + // repeated string stage = 4; + case 4: { + if (tag == 34) { + parse_stage: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_stage())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->stage(this->stage_size() - 1).data(), + this->stage(this->stage_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.NetStateRule.stage"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_stage; + if (input->ExpectTag(42)) goto parse_not_stage; + break; + } + + // repeated string not_stage = 5; + case 5: { + if (tag == 42) { + parse_not_stage: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_not_stage())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->not_stage(this->not_stage_size() - 1).data(), + this->not_stage(this->not_stage_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.NetStateRule.not_stage"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_not_stage; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.NetStateRule) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.NetStateRule) + return false; +#undef DO_ +} + +void NetStateRule::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.NetStateRule) + // optional .caffe.Phase phase = 1; + if (has_phase()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->phase(), output); + } + + // optional int32 min_level = 2; + if (has_min_level()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->min_level(), output); + } + + // optional int32 max_level = 3; + if (has_max_level()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->max_level(), output); + } + + // repeated string stage = 4; + for (int i = 0; i < this->stage_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->stage(i).data(), this->stage(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetStateRule.stage"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 4, this->stage(i), output); + } + + // repeated string not_stage = 5; + for (int i = 0; i < this->not_stage_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->not_stage(i).data(), this->not_stage(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetStateRule.not_stage"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->not_stage(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.NetStateRule) +} + +::google::protobuf::uint8* NetStateRule::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.NetStateRule) + // optional .caffe.Phase phase = 1; + if (has_phase()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->phase(), target); + } + + // optional int32 min_level = 2; + if (has_min_level()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->min_level(), target); + } + + // optional int32 max_level = 3; + if (has_max_level()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->max_level(), target); + } + + // repeated string stage = 4; + for (int i = 0; i < this->stage_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->stage(i).data(), this->stage(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetStateRule.stage"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(4, this->stage(i), target); + } + + // repeated string not_stage = 5; + for (int i = 0; i < this->not_stage_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->not_stage(i).data(), this->not_stage(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.NetStateRule.not_stage"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->not_stage(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.NetStateRule) + return target; +} + +size_t NetStateRule::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.NetStateRule) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .caffe.Phase phase = 1; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + // optional int32 min_level = 2; + if (has_min_level()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->min_level()); + } + + // optional int32 max_level = 3; + if (has_max_level()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->max_level()); + } + + } + // repeated string stage = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->stage_size()); + for (int i = 0; i < this->stage_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->stage(i)); + } + + // repeated string not_stage = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->not_stage_size()); + for (int i = 0; i < this->not_stage_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->not_stage(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetStateRule::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.NetStateRule) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NetStateRule* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.NetStateRule) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.NetStateRule) + UnsafeMergeFrom(*source); + } +} + +void NetStateRule::MergeFrom(const NetStateRule& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.NetStateRule) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NetStateRule::UnsafeMergeFrom(const NetStateRule& from) { + GOOGLE_DCHECK(&from != this); + stage_.UnsafeMergeFrom(from.stage_); + not_stage_.UnsafeMergeFrom(from.not_stage_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_phase()) { + set_phase(from.phase()); + } + if (from.has_min_level()) { + set_min_level(from.min_level()); + } + if (from.has_max_level()) { + set_max_level(from.max_level()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void NetStateRule::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.NetStateRule) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetStateRule::CopyFrom(const NetStateRule& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.NetStateRule) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NetStateRule::IsInitialized() const { + + return true; +} + +void NetStateRule::Swap(NetStateRule* other) { + if (other == this) return; + InternalSwap(other); +} +void NetStateRule::InternalSwap(NetStateRule* other) { + std::swap(phase_, other->phase_); + std::swap(min_level_, other->min_level_); + std::swap(max_level_, other->max_level_); + stage_.UnsafeArenaSwap(&other->stage_); + not_stage_.UnsafeArenaSwap(&other->not_stage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NetStateRule::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NetStateRule_descriptor_; + metadata.reflection = NetStateRule_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NetStateRule + +// optional .caffe.Phase phase = 1; +bool NetStateRule::has_phase() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void NetStateRule::set_has_phase() { + _has_bits_[0] |= 0x00000001u; +} +void NetStateRule::clear_has_phase() { + _has_bits_[0] &= ~0x00000001u; +} +void NetStateRule::clear_phase() { + phase_ = 0; + clear_has_phase(); +} +::caffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.phase) + return static_cast< ::caffe::Phase >(phase_); +} +void NetStateRule::set_phase(::caffe::Phase value) { + assert(::caffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:caffe.NetStateRule.phase) +} + +// optional int32 min_level = 2; +bool NetStateRule::has_min_level() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void NetStateRule::set_has_min_level() { + _has_bits_[0] |= 0x00000002u; +} +void NetStateRule::clear_has_min_level() { + _has_bits_[0] &= ~0x00000002u; +} +void NetStateRule::clear_min_level() { + min_level_ = 0; + clear_has_min_level(); +} +::google::protobuf::int32 NetStateRule::min_level() const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.min_level) + return min_level_; +} +void NetStateRule::set_min_level(::google::protobuf::int32 value) { + set_has_min_level(); + min_level_ = value; + // @@protoc_insertion_point(field_set:caffe.NetStateRule.min_level) +} + +// optional int32 max_level = 3; +bool NetStateRule::has_max_level() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void NetStateRule::set_has_max_level() { + _has_bits_[0] |= 0x00000004u; +} +void NetStateRule::clear_has_max_level() { + _has_bits_[0] &= ~0x00000004u; +} +void NetStateRule::clear_max_level() { + max_level_ = 0; + clear_has_max_level(); +} +::google::protobuf::int32 NetStateRule::max_level() const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.max_level) + return max_level_; +} +void NetStateRule::set_max_level(::google::protobuf::int32 value) { + set_has_max_level(); + max_level_ = value; + // @@protoc_insertion_point(field_set:caffe.NetStateRule.max_level) +} + +// repeated string stage = 4; +int NetStateRule::stage_size() const { + return stage_.size(); +} +void NetStateRule::clear_stage() { + stage_.Clear(); +} +const ::std::string& NetStateRule::stage(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.stage) + return stage_.Get(index); +} +::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetStateRule.stage) + return stage_.Mutable(index); +} +void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetStateRule.stage) + stage_.Mutable(index)->assign(value); +} +void NetStateRule::set_stage(int index, const char* value) { + stage_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetStateRule.stage) +} +void NetStateRule::set_stage(int index, const char* value, size_t size) { + stage_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetStateRule.stage) +} +::std::string* NetStateRule::add_stage() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetStateRule.stage) + return stage_.Add(); +} +void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetStateRule.stage) +} +void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetStateRule.stage) +} +void NetStateRule::add_stage(const char* value, size_t size) { + stage_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetStateRule.stage) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:caffe.NetStateRule.stage) + return stage_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetStateRule.stage) + return &stage_; +} + +// repeated string not_stage = 5; +int NetStateRule::not_stage_size() const { + return not_stage_.size(); +} +void NetStateRule::clear_not_stage() { + not_stage_.Clear(); +} +const ::std::string& NetStateRule::not_stage(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} +::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetStateRule.not_stage) + return not_stage_.Mutable(index); +} +void NetStateRule::set_not_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetStateRule.not_stage) + not_stage_.Mutable(index)->assign(value); +} +void NetStateRule::set_not_stage(int index, const char* value) { + not_stage_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetStateRule.not_stage) +} +void NetStateRule::set_not_stage(int index, const char* value, size_t size) { + not_stage_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetStateRule.not_stage) +} +::std::string* NetStateRule::add_not_stage() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetStateRule.not_stage) + return not_stage_.Add(); +} +void NetStateRule::add_not_stage(const ::std::string& value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetStateRule.not_stage) +} +void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetStateRule.not_stage) +} +void NetStateRule::add_not_stage(const char* value, size_t size) { + not_stage_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetStateRule.not_stage) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:caffe.NetStateRule.not_stage) + return not_stage_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetStateRule.not_stage) + return ¬_stage_; +} + +inline const NetStateRule* NetStateRule::internal_default_instance() { + return &NetStateRule_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* ParamSpec_DimCheckMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ParamSpec_DimCheckMode_descriptor_; +} +bool ParamSpec_DimCheckMode_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const ParamSpec_DimCheckMode ParamSpec::STRICT; +const ParamSpec_DimCheckMode ParamSpec::PERMISSIVE; +const ParamSpec_DimCheckMode ParamSpec::DimCheckMode_MIN; +const ParamSpec_DimCheckMode ParamSpec::DimCheckMode_MAX; +const int ParamSpec::DimCheckMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ParamSpec::kNameFieldNumber; +const int ParamSpec::kShareModeFieldNumber; +const int ParamSpec::kLrMultFieldNumber; +const int ParamSpec::kDecayMultFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ParamSpec::ParamSpec() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ParamSpec) +} + +void ParamSpec::InitAsDefaultInstance() { +} + +ParamSpec::ParamSpec(const ParamSpec& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ParamSpec) +} + +void ParamSpec::SharedCtor() { + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; +} + +ParamSpec::~ParamSpec() { + // @@protoc_insertion_point(destructor:caffe.ParamSpec) + SharedDtor(); +} + +void ParamSpec::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ParamSpec::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ParamSpec::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ParamSpec_descriptor_; +} + +const ParamSpec& ParamSpec::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ParamSpec_default_instance_; + +ParamSpec* ParamSpec::New(::google::protobuf::Arena* arena) const { + ParamSpec* n = new ParamSpec; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ParamSpec::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ParamSpec) + if (_has_bits_[0 / 32] & 15u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ParamSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ParamSpec) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.ParamSpec.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_share_mode; + break; + } + + // optional .caffe.ParamSpec.DimCheckMode share_mode = 2; + case 2: { + if (tag == 16) { + parse_share_mode: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::ParamSpec_DimCheckMode_IsValid(value)) { + set_share_mode(static_cast< ::caffe::ParamSpec_DimCheckMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_lr_mult; + break; + } + + // optional float lr_mult = 3 [default = 1]; + case 3: { + if (tag == 29) { + parse_lr_mult: + set_has_lr_mult(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_mult_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(37)) goto parse_decay_mult; + break; + } + + // optional float decay_mult = 4 [default = 1]; + case 4: { + if (tag == 37) { + parse_decay_mult: + set_has_decay_mult(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &decay_mult_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ParamSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ParamSpec) + return false; +#undef DO_ +} + +void ParamSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ParamSpec.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional .caffe.ParamSpec.DimCheckMode share_mode = 2; + if (has_share_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->share_mode(), output); + } + + // optional float lr_mult = 3 [default = 1]; + if (has_lr_mult()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->lr_mult(), output); + } + + // optional float decay_mult = 4 [default = 1]; + if (has_decay_mult()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->decay_mult(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ParamSpec) +} + +::google::protobuf::uint8* ParamSpec::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ParamSpec.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional .caffe.ParamSpec.DimCheckMode share_mode = 2; + if (has_share_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->share_mode(), target); + } + + // optional float lr_mult = 3 [default = 1]; + if (has_lr_mult()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->lr_mult(), target); + } + + // optional float decay_mult = 4 [default = 1]; + if (has_decay_mult()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->decay_mult(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ParamSpec) + return target; +} + +size_t ParamSpec::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ParamSpec) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 15u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .caffe.ParamSpec.DimCheckMode share_mode = 2; + if (has_share_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->share_mode()); + } + + // optional float lr_mult = 3 [default = 1]; + if (has_lr_mult()) { + total_size += 1 + 4; + } + + // optional float decay_mult = 4 [default = 1]; + if (has_decay_mult()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParamSpec::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ParamSpec) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ParamSpec* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ParamSpec) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ParamSpec) + UnsafeMergeFrom(*source); + } +} + +void ParamSpec::MergeFrom(const ParamSpec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ParamSpec) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ParamSpec::UnsafeMergeFrom(const ParamSpec& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_share_mode()) { + set_share_mode(from.share_mode()); + } + if (from.has_lr_mult()) { + set_lr_mult(from.lr_mult()); + } + if (from.has_decay_mult()) { + set_decay_mult(from.decay_mult()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ParamSpec::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ParamSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ParamSpec::CopyFrom(const ParamSpec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ParamSpec) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ParamSpec::IsInitialized() const { + + return true; +} + +void ParamSpec::Swap(ParamSpec* other) { + if (other == this) return; + InternalSwap(other); +} +void ParamSpec::InternalSwap(ParamSpec* other) { + name_.Swap(&other->name_); + std::swap(share_mode_, other->share_mode_); + std::swap(lr_mult_, other->lr_mult_); + std::swap(decay_mult_, other->decay_mult_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ParamSpec::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ParamSpec_descriptor_; + metadata.reflection = ParamSpec_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ParamSpec + +// optional string name = 1; +bool ParamSpec::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ParamSpec::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void ParamSpec::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void ParamSpec::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +const ::std::string& ParamSpec::name() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ParamSpec::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ParamSpec.name) +} +void ParamSpec::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ParamSpec.name) +} +void ParamSpec::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ParamSpec.name) +} +::std::string* ParamSpec::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.ParamSpec.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ParamSpec::release_name() { + // @@protoc_insertion_point(field_release:caffe.ParamSpec.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ParamSpec::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.ParamSpec.name) +} + +// optional .caffe.ParamSpec.DimCheckMode share_mode = 2; +bool ParamSpec::has_share_mode() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ParamSpec::set_has_share_mode() { + _has_bits_[0] |= 0x00000002u; +} +void ParamSpec::clear_has_share_mode() { + _has_bits_[0] &= ~0x00000002u; +} +void ParamSpec::clear_share_mode() { + share_mode_ = 0; + clear_has_share_mode(); +} +::caffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.share_mode) + return static_cast< ::caffe::ParamSpec_DimCheckMode >(share_mode_); +} +void ParamSpec::set_share_mode(::caffe::ParamSpec_DimCheckMode value) { + assert(::caffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:caffe.ParamSpec.share_mode) +} + +// optional float lr_mult = 3 [default = 1]; +bool ParamSpec::has_lr_mult() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ParamSpec::set_has_lr_mult() { + _has_bits_[0] |= 0x00000004u; +} +void ParamSpec::clear_has_lr_mult() { + _has_bits_[0] &= ~0x00000004u; +} +void ParamSpec::clear_lr_mult() { + lr_mult_ = 1; + clear_has_lr_mult(); +} +float ParamSpec::lr_mult() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.lr_mult) + return lr_mult_; +} +void ParamSpec::set_lr_mult(float value) { + set_has_lr_mult(); + lr_mult_ = value; + // @@protoc_insertion_point(field_set:caffe.ParamSpec.lr_mult) +} + +// optional float decay_mult = 4 [default = 1]; +bool ParamSpec::has_decay_mult() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void ParamSpec::set_has_decay_mult() { + _has_bits_[0] |= 0x00000008u; +} +void ParamSpec::clear_has_decay_mult() { + _has_bits_[0] &= ~0x00000008u; +} +void ParamSpec::clear_decay_mult() { + decay_mult_ = 1; + clear_has_decay_mult(); +} +float ParamSpec::decay_mult() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.decay_mult) + return decay_mult_; +} +void ParamSpec::set_decay_mult(float value) { + set_has_decay_mult(); + decay_mult_ = value; + // @@protoc_insertion_point(field_set:caffe.ParamSpec.decay_mult) +} + +inline const ParamSpec* ParamSpec::internal_default_instance() { + return &ParamSpec_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LayerParameter::kNameFieldNumber; +const int LayerParameter::kTypeFieldNumber; +const int LayerParameter::kBottomFieldNumber; +const int LayerParameter::kTopFieldNumber; +const int LayerParameter::kPhaseFieldNumber; +const int LayerParameter::kLossWeightFieldNumber; +const int LayerParameter::kParamFieldNumber; +const int LayerParameter::kBlobsFieldNumber; +const int LayerParameter::kPropagateDownFieldNumber; +const int LayerParameter::kIncludeFieldNumber; +const int LayerParameter::kExcludeFieldNumber; +const int LayerParameter::kTransformParamFieldNumber; +const int LayerParameter::kLossParamFieldNumber; +const int LayerParameter::kAccuracyParamFieldNumber; +const int LayerParameter::kArgmaxParamFieldNumber; +const int LayerParameter::kBatchNormParamFieldNumber; +const int LayerParameter::kBiasParamFieldNumber; +const int LayerParameter::kConcatParamFieldNumber; +const int LayerParameter::kContrastiveLossParamFieldNumber; +const int LayerParameter::kConvolutionParamFieldNumber; +const int LayerParameter::kCropParamFieldNumber; +const int LayerParameter::kDataParamFieldNumber; +const int LayerParameter::kDetectionOutputParamFieldNumber; +const int LayerParameter::kDropoutParamFieldNumber; +const int LayerParameter::kDummyDataParamFieldNumber; +const int LayerParameter::kEltwiseParamFieldNumber; +const int LayerParameter::kEluParamFieldNumber; +const int LayerParameter::kEmbedParamFieldNumber; +const int LayerParameter::kExpParamFieldNumber; +const int LayerParameter::kFlattenParamFieldNumber; +const int LayerParameter::kHdf5DataParamFieldNumber; +const int LayerParameter::kHdf5OutputParamFieldNumber; +const int LayerParameter::kHingeLossParamFieldNumber; +const int LayerParameter::kImageDataParamFieldNumber; +const int LayerParameter::kInfogainLossParamFieldNumber; +const int LayerParameter::kInnerProductParamFieldNumber; +const int LayerParameter::kInputParamFieldNumber; +const int LayerParameter::kLogParamFieldNumber; +const int LayerParameter::kLrnParamFieldNumber; +const int LayerParameter::kMemoryDataParamFieldNumber; +const int LayerParameter::kMvnParamFieldNumber; +const int LayerParameter::kNormParamFieldNumber; +const int LayerParameter::kPermuteParamFieldNumber; +const int LayerParameter::kParameterParamFieldNumber; +const int LayerParameter::kPoolingParamFieldNumber; +const int LayerParameter::kPowerParamFieldNumber; +const int LayerParameter::kPreluParamFieldNumber; +const int LayerParameter::kPriorBoxParamFieldNumber; +const int LayerParameter::kPythonParamFieldNumber; +const int LayerParameter::kRecurrentParamFieldNumber; +const int LayerParameter::kReductionParamFieldNumber; +const int LayerParameter::kReluParamFieldNumber; +const int LayerParameter::kReshapeParamFieldNumber; +const int LayerParameter::kScaleParamFieldNumber; +const int LayerParameter::kSigmoidParamFieldNumber; +const int LayerParameter::kSoftmaxParamFieldNumber; +const int LayerParameter::kSppParamFieldNumber; +const int LayerParameter::kSliceParamFieldNumber; +const int LayerParameter::kTanhParamFieldNumber; +const int LayerParameter::kThresholdParamFieldNumber; +const int LayerParameter::kTileParamFieldNumber; +const int LayerParameter::kWindowDataParamFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LayerParameter::LayerParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.LayerParameter) +} + +void LayerParameter::InitAsDefaultInstance() { + transform_param_ = const_cast< ::caffe::TransformationParameter*>( + ::caffe::TransformationParameter::internal_default_instance()); + loss_param_ = const_cast< ::caffe::LossParameter*>( + ::caffe::LossParameter::internal_default_instance()); + accuracy_param_ = const_cast< ::caffe::AccuracyParameter*>( + ::caffe::AccuracyParameter::internal_default_instance()); + argmax_param_ = const_cast< ::caffe::ArgMaxParameter*>( + ::caffe::ArgMaxParameter::internal_default_instance()); + batch_norm_param_ = const_cast< ::caffe::BatchNormParameter*>( + ::caffe::BatchNormParameter::internal_default_instance()); + bias_param_ = const_cast< ::caffe::BiasParameter*>( + ::caffe::BiasParameter::internal_default_instance()); + concat_param_ = const_cast< ::caffe::ConcatParameter*>( + ::caffe::ConcatParameter::internal_default_instance()); + contrastive_loss_param_ = const_cast< ::caffe::ContrastiveLossParameter*>( + ::caffe::ContrastiveLossParameter::internal_default_instance()); + convolution_param_ = const_cast< ::caffe::ConvolutionParameter*>( + ::caffe::ConvolutionParameter::internal_default_instance()); + crop_param_ = const_cast< ::caffe::CropParameter*>( + ::caffe::CropParameter::internal_default_instance()); + data_param_ = const_cast< ::caffe::DataParameter*>( + ::caffe::DataParameter::internal_default_instance()); + detection_output_param_ = const_cast< ::caffe::DetectionOutputParameter*>( + ::caffe::DetectionOutputParameter::internal_default_instance()); + dropout_param_ = const_cast< ::caffe::DropoutParameter*>( + ::caffe::DropoutParameter::internal_default_instance()); + dummy_data_param_ = const_cast< ::caffe::DummyDataParameter*>( + ::caffe::DummyDataParameter::internal_default_instance()); + eltwise_param_ = const_cast< ::caffe::EltwiseParameter*>( + ::caffe::EltwiseParameter::internal_default_instance()); + elu_param_ = const_cast< ::caffe::ELUParameter*>( + ::caffe::ELUParameter::internal_default_instance()); + embed_param_ = const_cast< ::caffe::EmbedParameter*>( + ::caffe::EmbedParameter::internal_default_instance()); + exp_param_ = const_cast< ::caffe::ExpParameter*>( + ::caffe::ExpParameter::internal_default_instance()); + flatten_param_ = const_cast< ::caffe::FlattenParameter*>( + ::caffe::FlattenParameter::internal_default_instance()); + hdf5_data_param_ = const_cast< ::caffe::HDF5DataParameter*>( + ::caffe::HDF5DataParameter::internal_default_instance()); + hdf5_output_param_ = const_cast< ::caffe::HDF5OutputParameter*>( + ::caffe::HDF5OutputParameter::internal_default_instance()); + hinge_loss_param_ = const_cast< ::caffe::HingeLossParameter*>( + ::caffe::HingeLossParameter::internal_default_instance()); + image_data_param_ = const_cast< ::caffe::ImageDataParameter*>( + ::caffe::ImageDataParameter::internal_default_instance()); + infogain_loss_param_ = const_cast< ::caffe::InfogainLossParameter*>( + ::caffe::InfogainLossParameter::internal_default_instance()); + inner_product_param_ = const_cast< ::caffe::InnerProductParameter*>( + ::caffe::InnerProductParameter::internal_default_instance()); + input_param_ = const_cast< ::caffe::InputParameter*>( + ::caffe::InputParameter::internal_default_instance()); + log_param_ = const_cast< ::caffe::LogParameter*>( + ::caffe::LogParameter::internal_default_instance()); + lrn_param_ = const_cast< ::caffe::LRNParameter*>( + ::caffe::LRNParameter::internal_default_instance()); + memory_data_param_ = const_cast< ::caffe::MemoryDataParameter*>( + ::caffe::MemoryDataParameter::internal_default_instance()); + mvn_param_ = const_cast< ::caffe::MVNParameter*>( + ::caffe::MVNParameter::internal_default_instance()); + norm_param_ = const_cast< ::caffe::NormalizeBBoxParameter*>( + ::caffe::NormalizeBBoxParameter::internal_default_instance()); + permute_param_ = const_cast< ::caffe::PermuteParameter*>( + ::caffe::PermuteParameter::internal_default_instance()); + parameter_param_ = const_cast< ::caffe::ParameterParameter*>( + ::caffe::ParameterParameter::internal_default_instance()); + pooling_param_ = const_cast< ::caffe::PoolingParameter*>( + ::caffe::PoolingParameter::internal_default_instance()); + power_param_ = const_cast< ::caffe::PowerParameter*>( + ::caffe::PowerParameter::internal_default_instance()); + prelu_param_ = const_cast< ::caffe::PReLUParameter*>( + ::caffe::PReLUParameter::internal_default_instance()); + prior_box_param_ = const_cast< ::caffe::PriorBoxParameter*>( + ::caffe::PriorBoxParameter::internal_default_instance()); + python_param_ = const_cast< ::caffe::PythonParameter*>( + ::caffe::PythonParameter::internal_default_instance()); + recurrent_param_ = const_cast< ::caffe::RecurrentParameter*>( + ::caffe::RecurrentParameter::internal_default_instance()); + reduction_param_ = const_cast< ::caffe::ReductionParameter*>( + ::caffe::ReductionParameter::internal_default_instance()); + relu_param_ = const_cast< ::caffe::ReLUParameter*>( + ::caffe::ReLUParameter::internal_default_instance()); + reshape_param_ = const_cast< ::caffe::ReshapeParameter*>( + ::caffe::ReshapeParameter::internal_default_instance()); + scale_param_ = const_cast< ::caffe::ScaleParameter*>( + ::caffe::ScaleParameter::internal_default_instance()); + sigmoid_param_ = const_cast< ::caffe::SigmoidParameter*>( + ::caffe::SigmoidParameter::internal_default_instance()); + softmax_param_ = const_cast< ::caffe::SoftmaxParameter*>( + ::caffe::SoftmaxParameter::internal_default_instance()); + spp_param_ = const_cast< ::caffe::SPPParameter*>( + ::caffe::SPPParameter::internal_default_instance()); + slice_param_ = const_cast< ::caffe::SliceParameter*>( + ::caffe::SliceParameter::internal_default_instance()); + tanh_param_ = const_cast< ::caffe::TanHParameter*>( + ::caffe::TanHParameter::internal_default_instance()); + threshold_param_ = const_cast< ::caffe::ThresholdParameter*>( + ::caffe::ThresholdParameter::internal_default_instance()); + tile_param_ = const_cast< ::caffe::TileParameter*>( + ::caffe::TileParameter::internal_default_instance()); + window_data_param_ = const_cast< ::caffe::WindowDataParameter*>( + ::caffe::WindowDataParameter::internal_default_instance()); +} + +LayerParameter::LayerParameter(const LayerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.LayerParameter) +} + +void LayerParameter::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + transform_param_ = NULL; + loss_param_ = NULL; + accuracy_param_ = NULL; + argmax_param_ = NULL; + batch_norm_param_ = NULL; + bias_param_ = NULL; + concat_param_ = NULL; + contrastive_loss_param_ = NULL; + convolution_param_ = NULL; + crop_param_ = NULL; + data_param_ = NULL; + detection_output_param_ = NULL; + dropout_param_ = NULL; + dummy_data_param_ = NULL; + eltwise_param_ = NULL; + elu_param_ = NULL; + embed_param_ = NULL; + exp_param_ = NULL; + flatten_param_ = NULL; + hdf5_data_param_ = NULL; + hdf5_output_param_ = NULL; + hinge_loss_param_ = NULL; + image_data_param_ = NULL; + infogain_loss_param_ = NULL; + inner_product_param_ = NULL; + input_param_ = NULL; + log_param_ = NULL; + lrn_param_ = NULL; + memory_data_param_ = NULL; + mvn_param_ = NULL; + norm_param_ = NULL; + permute_param_ = NULL; + parameter_param_ = NULL; + pooling_param_ = NULL; + power_param_ = NULL; + prelu_param_ = NULL; + prior_box_param_ = NULL; + python_param_ = NULL; + recurrent_param_ = NULL; + reduction_param_ = NULL; + relu_param_ = NULL; + reshape_param_ = NULL; + scale_param_ = NULL; + sigmoid_param_ = NULL; + softmax_param_ = NULL; + spp_param_ = NULL; + slice_param_ = NULL; + tanh_param_ = NULL; + threshold_param_ = NULL; + tile_param_ = NULL; + window_data_param_ = NULL; + phase_ = 0; + _cached_size_ = 0; +} + +LayerParameter::~LayerParameter() { + // @@protoc_insertion_point(destructor:caffe.LayerParameter) + SharedDtor(); +} + +void LayerParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != &LayerParameter_default_instance_.get()) { + delete transform_param_; + delete loss_param_; + delete accuracy_param_; + delete argmax_param_; + delete batch_norm_param_; + delete bias_param_; + delete concat_param_; + delete contrastive_loss_param_; + delete convolution_param_; + delete crop_param_; + delete data_param_; + delete detection_output_param_; + delete dropout_param_; + delete dummy_data_param_; + delete eltwise_param_; + delete elu_param_; + delete embed_param_; + delete exp_param_; + delete flatten_param_; + delete hdf5_data_param_; + delete hdf5_output_param_; + delete hinge_loss_param_; + delete image_data_param_; + delete infogain_loss_param_; + delete inner_product_param_; + delete input_param_; + delete log_param_; + delete lrn_param_; + delete memory_data_param_; + delete mvn_param_; + delete norm_param_; + delete permute_param_; + delete parameter_param_; + delete pooling_param_; + delete power_param_; + delete prelu_param_; + delete prior_box_param_; + delete python_param_; + delete recurrent_param_; + delete reduction_param_; + delete relu_param_; + delete reshape_param_; + delete scale_param_; + delete sigmoid_param_; + delete softmax_param_; + delete spp_param_; + delete slice_param_; + delete tanh_param_; + delete threshold_param_; + delete tile_param_; + delete window_data_param_; + } +} + +void LayerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LayerParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LayerParameter_descriptor_; +} + +const LayerParameter& LayerParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed LayerParameter_default_instance_; + +LayerParameter* LayerParameter::New(::google::protobuf::Arena* arena) const { + LayerParameter* n = new LayerParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void LayerParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.LayerParameter) + if (_has_bits_[0 / 32] & 19u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_type()) { + type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + phase_ = 0; + } + if (_has_bits_[8 / 32] & 63488u) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::caffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::caffe::LossParameter::Clear(); + } + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::caffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::caffe::ArgMaxParameter::Clear(); + } + if (has_batch_norm_param()) { + if (batch_norm_param_ != NULL) batch_norm_param_->::caffe::BatchNormParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680u) { + if (has_bias_param()) { + if (bias_param_ != NULL) bias_param_->::caffe::BiasParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::caffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::caffe::ContrastiveLossParameter::Clear(); + } + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::caffe::ConvolutionParameter::Clear(); + } + if (has_crop_param()) { + if (crop_param_ != NULL) crop_param_->::caffe::CropParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::caffe::DataParameter::Clear(); + } + if (has_detection_output_param()) { + if (detection_output_param_ != NULL) detection_output_param_->::caffe::DetectionOutputParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::caffe::DropoutParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080u) { + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::caffe::DummyDataParameter::Clear(); + } + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::caffe::EltwiseParameter::Clear(); + } + if (has_elu_param()) { + if (elu_param_ != NULL) elu_param_->::caffe::ELUParameter::Clear(); + } + if (has_embed_param()) { + if (embed_param_ != NULL) embed_param_->::caffe::EmbedParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::caffe::ExpParameter::Clear(); + } + if (has_flatten_param()) { + if (flatten_param_ != NULL) flatten_param_->::caffe::FlattenParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::caffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255u) { + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::caffe::HingeLossParameter::Clear(); + } + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::caffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::caffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::caffe::InnerProductParameter::Clear(); + } + if (has_input_param()) { + if (input_param_ != NULL) input_param_->::caffe::InputParameter::Clear(); + } + if (has_log_param()) { + if (log_param_ != NULL) log_param_->::caffe::LogParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::caffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::caffe::MemoryDataParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 65280u) { + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::caffe::MVNParameter::Clear(); + } + if (has_norm_param()) { + if (norm_param_ != NULL) norm_param_->::caffe::NormalizeBBoxParameter::Clear(); + } + if (has_permute_param()) { + if (permute_param_ != NULL) permute_param_->::caffe::PermuteParameter::Clear(); + } + if (has_parameter_param()) { + if (parameter_param_ != NULL) parameter_param_->::caffe::ParameterParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::caffe::PoolingParameter::Clear(); + } + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); + } + if (has_prelu_param()) { + if (prelu_param_ != NULL) prelu_param_->::caffe::PReLUParameter::Clear(); + } + if (has_prior_box_param()) { + if (prior_box_param_ != NULL) prior_box_param_->::caffe::PriorBoxParameter::Clear(); + } + } + if (_has_bits_[48 / 32] & 16711680u) { + if (has_python_param()) { + if (python_param_ != NULL) python_param_->::caffe::PythonParameter::Clear(); + } + if (has_recurrent_param()) { + if (recurrent_param_ != NULL) recurrent_param_->::caffe::RecurrentParameter::Clear(); + } + if (has_reduction_param()) { + if (reduction_param_ != NULL) reduction_param_->::caffe::ReductionParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); + } + if (has_reshape_param()) { + if (reshape_param_ != NULL) reshape_param_->::caffe::ReshapeParameter::Clear(); + } + if (has_scale_param()) { + if (scale_param_ != NULL) scale_param_->::caffe::ScaleParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); + } + } + if (_has_bits_[56 / 32] & 1056964608u) { + if (has_spp_param()) { + if (spp_param_ != NULL) spp_param_->::caffe::SPPParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); + } + if (has_tile_param()) { + if (tile_param_ != NULL) tile_param_->::caffe::TileParameter::Clear(); + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); + } + } + bottom_.Clear(); + top_.Clear(); + loss_weight_.Clear(); + param_.Clear(); + blobs_.Clear(); + propagate_down_.Clear(); + include_.Clear(); + exclude_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.LayerParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.LayerParameter.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_type; + break; + } + + // optional string type = 2; + case 2: { + if (tag == 18) { + parse_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.LayerParameter.type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_bottom; + break; + } + + // repeated string bottom = 3; + case 3: { + if (tag == 26) { + parse_bottom: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_bottom())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->bottom(this->bottom_size() - 1).data(), + this->bottom(this->bottom_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.LayerParameter.bottom"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_bottom; + if (input->ExpectTag(34)) goto parse_top; + break; + } + + // repeated string top = 4; + case 4: { + if (tag == 34) { + parse_top: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_top())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->top(this->top_size() - 1).data(), + this->top(this->top_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.LayerParameter.top"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_top; + if (input->ExpectTag(45)) goto parse_loss_weight; + break; + } + + // repeated float loss_weight = 5; + case 5: { + if (tag == 45) { + parse_loss_weight: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 45, input, this->mutable_loss_weight()))); + } else if (tag == 42) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_loss_weight()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(45)) goto parse_loss_weight; + if (input->ExpectTag(50)) goto parse_param; + break; + } + + // repeated .caffe.ParamSpec param = 6; + case 6: { + if (tag == 50) { + parse_param: + DO_(input->IncrementRecursionDepth()); + parse_loop_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_loop_param; + if (input->ExpectTag(58)) goto parse_loop_blobs; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .caffe.BlobProto blobs = 7; + case 7: { + if (tag == 58) { + DO_(input->IncrementRecursionDepth()); + parse_loop_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_loop_blobs; + if (input->ExpectTag(66)) goto parse_loop_include; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .caffe.NetStateRule include = 8; + case 8: { + if (tag == 66) { + DO_(input->IncrementRecursionDepth()); + parse_loop_include: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_include())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_loop_include; + if (input->ExpectTag(74)) goto parse_loop_exclude; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .caffe.NetStateRule exclude = 9; + case 9: { + if (tag == 74) { + DO_(input->IncrementRecursionDepth()); + parse_loop_exclude: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_exclude())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_loop_exclude; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(80)) goto parse_phase; + break; + } + + // optional .caffe.Phase phase = 10; + case 10: { + if (tag == 80) { + parse_phase: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::Phase_IsValid(value)) { + set_phase(static_cast< ::caffe::Phase >(value)); + } else { + mutable_unknown_fields()->AddVarint(10, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_propagate_down; + break; + } + + // repeated bool propagate_down = 11; + case 11: { + if (tag == 88) { + parse_propagate_down: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 88, input, this->mutable_propagate_down()))); + } else if (tag == 90) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_propagate_down()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_propagate_down; + if (input->ExpectTag(802)) goto parse_transform_param; + break; + } + + // optional .caffe.TransformationParameter transform_param = 100; + case 100: { + if (tag == 802) { + parse_transform_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_transform_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(810)) goto parse_loss_param; + break; + } + + // optional .caffe.LossParameter loss_param = 101; + case 101: { + if (tag == 810) { + parse_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(818)) goto parse_accuracy_param; + break; + } + + // optional .caffe.AccuracyParameter accuracy_param = 102; + case 102: { + if (tag == 818) { + parse_accuracy_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_accuracy_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(826)) goto parse_argmax_param; + break; + } + + // optional .caffe.ArgMaxParameter argmax_param = 103; + case 103: { + if (tag == 826) { + parse_argmax_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_argmax_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(834)) goto parse_concat_param; + break; + } + + // optional .caffe.ConcatParameter concat_param = 104; + case 104: { + if (tag == 834) { + parse_concat_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_concat_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(842)) goto parse_contrastive_loss_param; + break; + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; + case 105: { + if (tag == 842) { + parse_contrastive_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_contrastive_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(850)) goto parse_convolution_param; + break; + } + + // optional .caffe.ConvolutionParameter convolution_param = 106; + case 106: { + if (tag == 850) { + parse_convolution_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_convolution_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(858)) goto parse_data_param; + break; + } + + // optional .caffe.DataParameter data_param = 107; + case 107: { + if (tag == 858) { + parse_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(866)) goto parse_dropout_param; + break; + } + + // optional .caffe.DropoutParameter dropout_param = 108; + case 108: { + if (tag == 866) { + parse_dropout_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dropout_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(874)) goto parse_dummy_data_param; + break; + } + + // optional .caffe.DummyDataParameter dummy_data_param = 109; + case 109: { + if (tag == 874) { + parse_dummy_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dummy_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(882)) goto parse_eltwise_param; + break; + } + + // optional .caffe.EltwiseParameter eltwise_param = 110; + case 110: { + if (tag == 882) { + parse_eltwise_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_eltwise_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(890)) goto parse_exp_param; + break; + } + + // optional .caffe.ExpParameter exp_param = 111; + case 111: { + if (tag == 890) { + parse_exp_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_exp_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(898)) goto parse_hdf5_data_param; + break; + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 112; + case 112: { + if (tag == 898) { + parse_hdf5_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hdf5_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(906)) goto parse_hdf5_output_param; + break; + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 113; + case 113: { + if (tag == 906) { + parse_hdf5_output_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hdf5_output_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(914)) goto parse_hinge_loss_param; + break; + } + + // optional .caffe.HingeLossParameter hinge_loss_param = 114; + case 114: { + if (tag == 914) { + parse_hinge_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hinge_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(922)) goto parse_image_data_param; + break; + } + + // optional .caffe.ImageDataParameter image_data_param = 115; + case 115: { + if (tag == 922) { + parse_image_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(930)) goto parse_infogain_loss_param; + break; + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 116; + case 116: { + if (tag == 930) { + parse_infogain_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_infogain_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(938)) goto parse_inner_product_param; + break; + } + + // optional .caffe.InnerProductParameter inner_product_param = 117; + case 117: { + if (tag == 938) { + parse_inner_product_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_inner_product_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(946)) goto parse_lrn_param; + break; + } + + // optional .caffe.LRNParameter lrn_param = 118; + case 118: { + if (tag == 946) { + parse_lrn_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_lrn_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(954)) goto parse_memory_data_param; + break; + } + + // optional .caffe.MemoryDataParameter memory_data_param = 119; + case 119: { + if (tag == 954) { + parse_memory_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_memory_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(962)) goto parse_mvn_param; + break; + } + + // optional .caffe.MVNParameter mvn_param = 120; + case 120: { + if (tag == 962) { + parse_mvn_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_mvn_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(970)) goto parse_pooling_param; + break; + } + + // optional .caffe.PoolingParameter pooling_param = 121; + case 121: { + if (tag == 970) { + parse_pooling_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_pooling_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(978)) goto parse_power_param; + break; + } + + // optional .caffe.PowerParameter power_param = 122; + case 122: { + if (tag == 978) { + parse_power_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_power_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(986)) goto parse_relu_param; + break; + } + + // optional .caffe.ReLUParameter relu_param = 123; + case 123: { + if (tag == 986) { + parse_relu_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_relu_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(994)) goto parse_sigmoid_param; + break; + } + + // optional .caffe.SigmoidParameter sigmoid_param = 124; + case 124: { + if (tag == 994) { + parse_sigmoid_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_sigmoid_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1002)) goto parse_softmax_param; + break; + } + + // optional .caffe.SoftmaxParameter softmax_param = 125; + case 125: { + if (tag == 1002) { + parse_softmax_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_softmax_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1010)) goto parse_slice_param; + break; + } + + // optional .caffe.SliceParameter slice_param = 126; + case 126: { + if (tag == 1010) { + parse_slice_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_slice_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1018)) goto parse_tanh_param; + break; + } + + // optional .caffe.TanHParameter tanh_param = 127; + case 127: { + if (tag == 1018) { + parse_tanh_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tanh_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1026)) goto parse_threshold_param; + break; + } + + // optional .caffe.ThresholdParameter threshold_param = 128; + case 128: { + if (tag == 1026) { + parse_threshold_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_threshold_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1034)) goto parse_window_data_param; + break; + } + + // optional .caffe.WindowDataParameter window_data_param = 129; + case 129: { + if (tag == 1034) { + parse_window_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_window_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1042)) goto parse_python_param; + break; + } + + // optional .caffe.PythonParameter python_param = 130; + case 130: { + if (tag == 1042) { + parse_python_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_python_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1050)) goto parse_prelu_param; + break; + } + + // optional .caffe.PReLUParameter prelu_param = 131; + case 131: { + if (tag == 1050) { + parse_prelu_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_prelu_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1058)) goto parse_spp_param; + break; + } + + // optional .caffe.SPPParameter spp_param = 132; + case 132: { + if (tag == 1058) { + parse_spp_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_spp_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1066)) goto parse_reshape_param; + break; + } + + // optional .caffe.ReshapeParameter reshape_param = 133; + case 133: { + if (tag == 1066) { + parse_reshape_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_reshape_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1074)) goto parse_log_param; + break; + } + + // optional .caffe.LogParameter log_param = 134; + case 134: { + if (tag == 1074) { + parse_log_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_log_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1082)) goto parse_flatten_param; + break; + } + + // optional .caffe.FlattenParameter flatten_param = 135; + case 135: { + if (tag == 1082) { + parse_flatten_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_flatten_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1090)) goto parse_reduction_param; + break; + } + + // optional .caffe.ReductionParameter reduction_param = 136; + case 136: { + if (tag == 1090) { + parse_reduction_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_reduction_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1098)) goto parse_embed_param; + break; + } + + // optional .caffe.EmbedParameter embed_param = 137; + case 137: { + if (tag == 1098) { + parse_embed_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_embed_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1106)) goto parse_tile_param; + break; + } + + // optional .caffe.TileParameter tile_param = 138; + case 138: { + if (tag == 1106) { + parse_tile_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tile_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1114)) goto parse_batch_norm_param; + break; + } + + // optional .caffe.BatchNormParameter batch_norm_param = 139; + case 139: { + if (tag == 1114) { + parse_batch_norm_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_batch_norm_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1122)) goto parse_elu_param; + break; + } + + // optional .caffe.ELUParameter elu_param = 140; + case 140: { + if (tag == 1122) { + parse_elu_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_elu_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1130)) goto parse_bias_param; + break; + } + + // optional .caffe.BiasParameter bias_param = 141; + case 141: { + if (tag == 1130) { + parse_bias_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1138)) goto parse_scale_param; + break; + } + + // optional .caffe.ScaleParameter scale_param = 142; + case 142: { + if (tag == 1138) { + parse_scale_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_scale_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1146)) goto parse_input_param; + break; + } + + // optional .caffe.InputParameter input_param = 143; + case 143: { + if (tag == 1146) { + parse_input_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_input_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1154)) goto parse_crop_param; + break; + } + + // optional .caffe.CropParameter crop_param = 144; + case 144: { + if (tag == 1154) { + parse_crop_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_crop_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1162)) goto parse_parameter_param; + break; + } + + // optional .caffe.ParameterParameter parameter_param = 145; + case 145: { + if (tag == 1162) { + parse_parameter_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_parameter_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1170)) goto parse_recurrent_param; + break; + } + + // optional .caffe.RecurrentParameter recurrent_param = 146; + case 146: { + if (tag == 1170) { + parse_recurrent_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_recurrent_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1178)) goto parse_detection_output_param; + break; + } + + // optional .caffe.DetectionOutputParameter detection_output_param = 147; + case 147: { + if (tag == 1178) { + parse_detection_output_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_detection_output_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1186)) goto parse_permute_param; + break; + } + + // optional .caffe.PermuteParameter permute_param = 148; + case 148: { + if (tag == 1186) { + parse_permute_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_permute_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1194)) goto parse_norm_param; + break; + } + + // optional .caffe.NormalizeBBoxParameter norm_param = 149; + case 149: { + if (tag == 1194) { + parse_norm_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_norm_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(1202)) goto parse_prior_box_param; + break; + } + + // optional .caffe.PriorBoxParameter prior_box_param = 150; + case 150: { + if (tag == 1202) { + parse_prior_box_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_prior_box_param())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.LayerParameter) + return false; +#undef DO_ +} + +void LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->type(), output); + } + + // repeated string bottom = 3; + for (int i = 0; i < this->bottom_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->bottom(i).data(), this->bottom(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.bottom"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->bottom(i), output); + } + + // repeated string top = 4; + for (int i = 0; i < this->top_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->top(i).data(), this->top(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.top"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 4, this->top(i), output); + } + + // repeated float loss_weight = 5; + for (int i = 0; i < this->loss_weight_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 5, this->loss_weight(i), output); + } + + // repeated .caffe.ParamSpec param = 6; + for (unsigned int i = 0, n = this->param_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->param(i), output); + } + + // repeated .caffe.BlobProto blobs = 7; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->blobs(i), output); + } + + // repeated .caffe.NetStateRule include = 8; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->include(i), output); + } + + // repeated .caffe.NetStateRule exclude = 9; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->exclude(i), output); + } + + // optional .caffe.Phase phase = 10; + if (has_phase()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 10, this->phase(), output); + } + + // repeated bool propagate_down = 11; + for (int i = 0; i < this->propagate_down_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 11, this->propagate_down(i), output); + } + + // optional .caffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 100, *this->transform_param_, output); + } + + // optional .caffe.LossParameter loss_param = 101; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 101, *this->loss_param_, output); + } + + // optional .caffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 102, *this->accuracy_param_, output); + } + + // optional .caffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 103, *this->argmax_param_, output); + } + + // optional .caffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 104, *this->concat_param_, output); + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 105, *this->contrastive_loss_param_, output); + } + + // optional .caffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 106, *this->convolution_param_, output); + } + + // optional .caffe.DataParameter data_param = 107; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 107, *this->data_param_, output); + } + + // optional .caffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 108, *this->dropout_param_, output); + } + + // optional .caffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 109, *this->dummy_data_param_, output); + } + + // optional .caffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 110, *this->eltwise_param_, output); + } + + // optional .caffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 111, *this->exp_param_, output); + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 112, *this->hdf5_data_param_, output); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 113, *this->hdf5_output_param_, output); + } + + // optional .caffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 114, *this->hinge_loss_param_, output); + } + + // optional .caffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 115, *this->image_data_param_, output); + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 116, *this->infogain_loss_param_, output); + } + + // optional .caffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 117, *this->inner_product_param_, output); + } + + // optional .caffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 118, *this->lrn_param_, output); + } + + // optional .caffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 119, *this->memory_data_param_, output); + } + + // optional .caffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 120, *this->mvn_param_, output); + } + + // optional .caffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 121, *this->pooling_param_, output); + } + + // optional .caffe.PowerParameter power_param = 122; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 122, *this->power_param_, output); + } + + // optional .caffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 123, *this->relu_param_, output); + } + + // optional .caffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 124, *this->sigmoid_param_, output); + } + + // optional .caffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 125, *this->softmax_param_, output); + } + + // optional .caffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 126, *this->slice_param_, output); + } + + // optional .caffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 127, *this->tanh_param_, output); + } + + // optional .caffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 128, *this->threshold_param_, output); + } + + // optional .caffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 129, *this->window_data_param_, output); + } + + // optional .caffe.PythonParameter python_param = 130; + if (has_python_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 130, *this->python_param_, output); + } + + // optional .caffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 131, *this->prelu_param_, output); + } + + // optional .caffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 132, *this->spp_param_, output); + } + + // optional .caffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 133, *this->reshape_param_, output); + } + + // optional .caffe.LogParameter log_param = 134; + if (has_log_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 134, *this->log_param_, output); + } + + // optional .caffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 135, *this->flatten_param_, output); + } + + // optional .caffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 136, *this->reduction_param_, output); + } + + // optional .caffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 137, *this->embed_param_, output); + } + + // optional .caffe.TileParameter tile_param = 138; + if (has_tile_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 138, *this->tile_param_, output); + } + + // optional .caffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 139, *this->batch_norm_param_, output); + } + + // optional .caffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 140, *this->elu_param_, output); + } + + // optional .caffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 141, *this->bias_param_, output); + } + + // optional .caffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 142, *this->scale_param_, output); + } + + // optional .caffe.InputParameter input_param = 143; + if (has_input_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 143, *this->input_param_, output); + } + + // optional .caffe.CropParameter crop_param = 144; + if (has_crop_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 144, *this->crop_param_, output); + } + + // optional .caffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 145, *this->parameter_param_, output); + } + + // optional .caffe.RecurrentParameter recurrent_param = 146; + if (has_recurrent_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 146, *this->recurrent_param_, output); + } + + // optional .caffe.DetectionOutputParameter detection_output_param = 147; + if (has_detection_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 147, *this->detection_output_param_, output); + } + + // optional .caffe.PermuteParameter permute_param = 148; + if (has_permute_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 148, *this->permute_param_, output); + } + + // optional .caffe.NormalizeBBoxParameter norm_param = 149; + if (has_norm_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 149, *this->norm_param_, output); + } + + // optional .caffe.PriorBoxParameter prior_box_param = 150; + if (has_prior_box_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 150, *this->prior_box_param_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.LayerParameter) +} + +::google::protobuf::uint8* LayerParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->type(), target); + } + + // repeated string bottom = 3; + for (int i = 0; i < this->bottom_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->bottom(i).data(), this->bottom(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.bottom"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->bottom(i), target); + } + + // repeated string top = 4; + for (int i = 0; i < this->top_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->top(i).data(), this->top(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.LayerParameter.top"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(4, this->top(i), target); + } + + // repeated float loss_weight = 5; + for (int i = 0; i < this->loss_weight_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(5, this->loss_weight(i), target); + } + + // repeated .caffe.ParamSpec param = 6; + for (unsigned int i = 0, n = this->param_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, this->param(i), false, target); + } + + // repeated .caffe.BlobProto blobs = 7; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, this->blobs(i), false, target); + } + + // repeated .caffe.NetStateRule include = 8; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, this->include(i), false, target); + } + + // repeated .caffe.NetStateRule exclude = 9; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, this->exclude(i), false, target); + } + + // optional .caffe.Phase phase = 10; + if (has_phase()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 10, this->phase(), target); + } + + // repeated bool propagate_down = 11; + for (int i = 0; i < this->propagate_down_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolToArray(11, this->propagate_down(i), target); + } + + // optional .caffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 100, *this->transform_param_, false, target); + } + + // optional .caffe.LossParameter loss_param = 101; + if (has_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 101, *this->loss_param_, false, target); + } + + // optional .caffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 102, *this->accuracy_param_, false, target); + } + + // optional .caffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 103, *this->argmax_param_, false, target); + } + + // optional .caffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 104, *this->concat_param_, false, target); + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 105, *this->contrastive_loss_param_, false, target); + } + + // optional .caffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 106, *this->convolution_param_, false, target); + } + + // optional .caffe.DataParameter data_param = 107; + if (has_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 107, *this->data_param_, false, target); + } + + // optional .caffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 108, *this->dropout_param_, false, target); + } + + // optional .caffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 109, *this->dummy_data_param_, false, target); + } + + // optional .caffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 110, *this->eltwise_param_, false, target); + } + + // optional .caffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 111, *this->exp_param_, false, target); + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 112, *this->hdf5_data_param_, false, target); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 113, *this->hdf5_output_param_, false, target); + } + + // optional .caffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 114, *this->hinge_loss_param_, false, target); + } + + // optional .caffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 115, *this->image_data_param_, false, target); + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 116, *this->infogain_loss_param_, false, target); + } + + // optional .caffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 117, *this->inner_product_param_, false, target); + } + + // optional .caffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 118, *this->lrn_param_, false, target); + } + + // optional .caffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 119, *this->memory_data_param_, false, target); + } + + // optional .caffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 120, *this->mvn_param_, false, target); + } + + // optional .caffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 121, *this->pooling_param_, false, target); + } + + // optional .caffe.PowerParameter power_param = 122; + if (has_power_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 122, *this->power_param_, false, target); + } + + // optional .caffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 123, *this->relu_param_, false, target); + } + + // optional .caffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 124, *this->sigmoid_param_, false, target); + } + + // optional .caffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 125, *this->softmax_param_, false, target); + } + + // optional .caffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 126, *this->slice_param_, false, target); + } + + // optional .caffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 127, *this->tanh_param_, false, target); + } + + // optional .caffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 128, *this->threshold_param_, false, target); + } + + // optional .caffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 129, *this->window_data_param_, false, target); + } + + // optional .caffe.PythonParameter python_param = 130; + if (has_python_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 130, *this->python_param_, false, target); + } + + // optional .caffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 131, *this->prelu_param_, false, target); + } + + // optional .caffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 132, *this->spp_param_, false, target); + } + + // optional .caffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 133, *this->reshape_param_, false, target); + } + + // optional .caffe.LogParameter log_param = 134; + if (has_log_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 134, *this->log_param_, false, target); + } + + // optional .caffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 135, *this->flatten_param_, false, target); + } + + // optional .caffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 136, *this->reduction_param_, false, target); + } + + // optional .caffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 137, *this->embed_param_, false, target); + } + + // optional .caffe.TileParameter tile_param = 138; + if (has_tile_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 138, *this->tile_param_, false, target); + } + + // optional .caffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 139, *this->batch_norm_param_, false, target); + } + + // optional .caffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 140, *this->elu_param_, false, target); + } + + // optional .caffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 141, *this->bias_param_, false, target); + } + + // optional .caffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 142, *this->scale_param_, false, target); + } + + // optional .caffe.InputParameter input_param = 143; + if (has_input_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 143, *this->input_param_, false, target); + } + + // optional .caffe.CropParameter crop_param = 144; + if (has_crop_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 144, *this->crop_param_, false, target); + } + + // optional .caffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 145, *this->parameter_param_, false, target); + } + + // optional .caffe.RecurrentParameter recurrent_param = 146; + if (has_recurrent_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 146, *this->recurrent_param_, false, target); + } + + // optional .caffe.DetectionOutputParameter detection_output_param = 147; + if (has_detection_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 147, *this->detection_output_param_, false, target); + } + + // optional .caffe.PermuteParameter permute_param = 148; + if (has_permute_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 148, *this->permute_param_, false, target); + } + + // optional .caffe.NormalizeBBoxParameter norm_param = 149; + if (has_norm_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 149, *this->norm_param_, false, target); + } + + // optional .caffe.PriorBoxParameter prior_box_param = 150; + if (has_prior_box_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 150, *this->prior_box_param_, false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.LayerParameter) + return target; +} + +size_t LayerParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.LayerParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 19u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // optional .caffe.Phase phase = 10; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + } + if (_has_bits_[11 / 32] & 63488u) { + // optional .caffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->transform_param_); + } + + // optional .caffe.LossParameter loss_param = 101; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->loss_param_); + } + + // optional .caffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->accuracy_param_); + } + + // optional .caffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->argmax_param_); + } + + // optional .caffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->batch_norm_param_); + } + + } + if (_has_bits_[16 / 32] & 16711680u) { + // optional .caffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_param_); + } + + // optional .caffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->concat_param_); + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->contrastive_loss_param_); + } + + // optional .caffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->convolution_param_); + } + + // optional .caffe.CropParameter crop_param = 144; + if (has_crop_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->crop_param_); + } + + // optional .caffe.DataParameter data_param = 107; + if (has_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->data_param_); + } + + // optional .caffe.DetectionOutputParameter detection_output_param = 147; + if (has_detection_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->detection_output_param_); + } + + // optional .caffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dropout_param_); + } + + } + if (_has_bits_[24 / 32] & 4278190080u) { + // optional .caffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dummy_data_param_); + } + + // optional .caffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->eltwise_param_); + } + + // optional .caffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->elu_param_); + } + + // optional .caffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->embed_param_); + } + + // optional .caffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->exp_param_); + } + + // optional .caffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->flatten_param_); + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_data_param_); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + } + if (_has_bits_[32 / 32] & 255u) { + // optional .caffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hinge_loss_param_); + } + + // optional .caffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->image_data_param_); + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->infogain_loss_param_); + } + + // optional .caffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->inner_product_param_); + } + + // optional .caffe.InputParameter input_param = 143; + if (has_input_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->input_param_); + } + + // optional .caffe.LogParameter log_param = 134; + if (has_log_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->log_param_); + } + + // optional .caffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lrn_param_); + } + + // optional .caffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->memory_data_param_); + } + + } + if (_has_bits_[40 / 32] & 65280u) { + // optional .caffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->mvn_param_); + } + + // optional .caffe.NormalizeBBoxParameter norm_param = 149; + if (has_norm_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->norm_param_); + } + + // optional .caffe.PermuteParameter permute_param = 148; + if (has_permute_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->permute_param_); + } + + // optional .caffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->parameter_param_); + } + + // optional .caffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->pooling_param_); + } + + // optional .caffe.PowerParameter power_param = 122; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->power_param_); + } + + // optional .caffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->prelu_param_); + } + + // optional .caffe.PriorBoxParameter prior_box_param = 150; + if (has_prior_box_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->prior_box_param_); + } + + } + if (_has_bits_[48 / 32] & 16711680u) { + // optional .caffe.PythonParameter python_param = 130; + if (has_python_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->python_param_); + } + + // optional .caffe.RecurrentParameter recurrent_param = 146; + if (has_recurrent_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->recurrent_param_); + } + + // optional .caffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reduction_param_); + } + + // optional .caffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->relu_param_); + } + + // optional .caffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reshape_param_); + } + + // optional .caffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->scale_param_); + } + + // optional .caffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->sigmoid_param_); + } + + // optional .caffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->softmax_param_); + } + + } + if (_has_bits_[56 / 32] & 1056964608u) { + // optional .caffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->spp_param_); + } + + // optional .caffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->slice_param_); + } + + // optional .caffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tanh_param_); + } + + // optional .caffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->threshold_param_); + } + + // optional .caffe.TileParameter tile_param = 138; + if (has_tile_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tile_param_); + } + + // optional .caffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->window_data_param_); + } + + } + // repeated string bottom = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->bottom_size()); + for (int i = 0; i < this->bottom_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->bottom(i)); + } + + // repeated string top = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->top_size()); + for (int i = 0; i < this->top_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->top(i)); + } + + // repeated float loss_weight = 5; + { + size_t data_size = 0; + unsigned int count = this->loss_weight_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->loss_weight_size()); + total_size += data_size; + } + + // repeated .caffe.ParamSpec param = 6; + { + unsigned int count = this->param_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->param(i)); + } + } + + // repeated .caffe.BlobProto blobs = 7; + { + unsigned int count = this->blobs_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + } + + // repeated bool propagate_down = 11; + { + size_t data_size = 0; + unsigned int count = this->propagate_down_size(); + data_size = 1UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->propagate_down_size()); + total_size += data_size; + } + + // repeated .caffe.NetStateRule include = 8; + { + unsigned int count = this->include_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + } + + // repeated .caffe.NetStateRule exclude = 9; + { + unsigned int count = this->exclude_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const LayerParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.LayerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.LayerParameter) + UnsafeMergeFrom(*source); + } +} + +void LayerParameter::MergeFrom(const LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.LayerParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void LayerParameter::UnsafeMergeFrom(const LayerParameter& from) { + GOOGLE_DCHECK(&from != this); + bottom_.UnsafeMergeFrom(from.bottom_); + top_.UnsafeMergeFrom(from.top_); + loss_weight_.UnsafeMergeFrom(from.loss_weight_); + param_.MergeFrom(from.param_); + blobs_.MergeFrom(from.blobs_); + propagate_down_.UnsafeMergeFrom(from.propagate_down_); + include_.MergeFrom(from.include_); + exclude_.MergeFrom(from.exclude_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_type()) { + set_has_type(); + type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_); + } + if (from.has_phase()) { + set_phase(from.phase()); + } + } + if (from._has_bits_[11 / 32] & (0xffu << (11 % 32))) { + if (from.has_transform_param()) { + mutable_transform_param()->::caffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::caffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_accuracy_param()) { + mutable_accuracy_param()->::caffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::caffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_batch_norm_param()) { + mutable_batch_norm_param()->::caffe::BatchNormParameter::MergeFrom(from.batch_norm_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_bias_param()) { + mutable_bias_param()->::caffe::BiasParameter::MergeFrom(from.bias_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::caffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::caffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + if (from.has_convolution_param()) { + mutable_convolution_param()->::caffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_crop_param()) { + mutable_crop_param()->::caffe::CropParameter::MergeFrom(from.crop_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::caffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_detection_output_param()) { + mutable_detection_output_param()->::caffe::DetectionOutputParameter::MergeFrom(from.detection_output_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::caffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::caffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::caffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_elu_param()) { + mutable_elu_param()->::caffe::ELUParameter::MergeFrom(from.elu_param()); + } + if (from.has_embed_param()) { + mutable_embed_param()->::caffe::EmbedParameter::MergeFrom(from.embed_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::caffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_flatten_param()) { + mutable_flatten_param()->::caffe::FlattenParameter::MergeFrom(from.flatten_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::caffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::caffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_hinge_loss_param()) { + mutable_hinge_loss_param()->::caffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + if (from.has_image_data_param()) { + mutable_image_data_param()->::caffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::caffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::caffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_input_param()) { + mutable_input_param()->::caffe::InputParameter::MergeFrom(from.input_param()); + } + if (from.has_log_param()) { + mutable_log_param()->::caffe::LogParameter::MergeFrom(from.log_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::caffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::caffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_mvn_param()) { + mutable_mvn_param()->::caffe::MVNParameter::MergeFrom(from.mvn_param()); + } + if (from.has_norm_param()) { + mutable_norm_param()->::caffe::NormalizeBBoxParameter::MergeFrom(from.norm_param()); + } + if (from.has_permute_param()) { + mutable_permute_param()->::caffe::PermuteParameter::MergeFrom(from.permute_param()); + } + if (from.has_parameter_param()) { + mutable_parameter_param()->::caffe::ParameterParameter::MergeFrom(from.parameter_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::caffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + if (from.has_power_param()) { + mutable_power_param()->::caffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_prelu_param()) { + mutable_prelu_param()->::caffe::PReLUParameter::MergeFrom(from.prelu_param()); + } + if (from.has_prior_box_param()) { + mutable_prior_box_param()->::caffe::PriorBoxParameter::MergeFrom(from.prior_box_param()); + } + } + if (from._has_bits_[48 / 32] & (0xffu << (48 % 32))) { + if (from.has_python_param()) { + mutable_python_param()->::caffe::PythonParameter::MergeFrom(from.python_param()); + } + if (from.has_recurrent_param()) { + mutable_recurrent_param()->::caffe::RecurrentParameter::MergeFrom(from.recurrent_param()); + } + if (from.has_reduction_param()) { + mutable_reduction_param()->::caffe::ReductionParameter::MergeFrom(from.reduction_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::caffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_reshape_param()) { + mutable_reshape_param()->::caffe::ReshapeParameter::MergeFrom(from.reshape_param()); + } + if (from.has_scale_param()) { + mutable_scale_param()->::caffe::ScaleParameter::MergeFrom(from.scale_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::caffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::caffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + } + if (from._has_bits_[56 / 32] & (0xffu << (56 % 32))) { + if (from.has_spp_param()) { + mutable_spp_param()->::caffe::SPPParameter::MergeFrom(from.spp_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::caffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::caffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::caffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_tile_param()) { + mutable_tile_param()->::caffe::TileParameter::MergeFrom(from.tile_param()); + } + if (from.has_window_data_param()) { + mutable_window_data_param()->::caffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LayerParameter::CopyFrom(const LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.LayerParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool LayerParameter::IsInitialized() const { + + return true; +} + +void LayerParameter::Swap(LayerParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void LayerParameter::InternalSwap(LayerParameter* other) { + name_.Swap(&other->name_); + type_.Swap(&other->type_); + bottom_.UnsafeArenaSwap(&other->bottom_); + top_.UnsafeArenaSwap(&other->top_); + std::swap(phase_, other->phase_); + loss_weight_.UnsafeArenaSwap(&other->loss_weight_); + param_.UnsafeArenaSwap(&other->param_); + blobs_.UnsafeArenaSwap(&other->blobs_); + propagate_down_.UnsafeArenaSwap(&other->propagate_down_); + include_.UnsafeArenaSwap(&other->include_); + exclude_.UnsafeArenaSwap(&other->exclude_); + std::swap(transform_param_, other->transform_param_); + std::swap(loss_param_, other->loss_param_); + std::swap(accuracy_param_, other->accuracy_param_); + std::swap(argmax_param_, other->argmax_param_); + std::swap(batch_norm_param_, other->batch_norm_param_); + std::swap(bias_param_, other->bias_param_); + std::swap(concat_param_, other->concat_param_); + std::swap(contrastive_loss_param_, other->contrastive_loss_param_); + std::swap(convolution_param_, other->convolution_param_); + std::swap(crop_param_, other->crop_param_); + std::swap(data_param_, other->data_param_); + std::swap(detection_output_param_, other->detection_output_param_); + std::swap(dropout_param_, other->dropout_param_); + std::swap(dummy_data_param_, other->dummy_data_param_); + std::swap(eltwise_param_, other->eltwise_param_); + std::swap(elu_param_, other->elu_param_); + std::swap(embed_param_, other->embed_param_); + std::swap(exp_param_, other->exp_param_); + std::swap(flatten_param_, other->flatten_param_); + std::swap(hdf5_data_param_, other->hdf5_data_param_); + std::swap(hdf5_output_param_, other->hdf5_output_param_); + std::swap(hinge_loss_param_, other->hinge_loss_param_); + std::swap(image_data_param_, other->image_data_param_); + std::swap(infogain_loss_param_, other->infogain_loss_param_); + std::swap(inner_product_param_, other->inner_product_param_); + std::swap(input_param_, other->input_param_); + std::swap(log_param_, other->log_param_); + std::swap(lrn_param_, other->lrn_param_); + std::swap(memory_data_param_, other->memory_data_param_); + std::swap(mvn_param_, other->mvn_param_); + std::swap(norm_param_, other->norm_param_); + std::swap(permute_param_, other->permute_param_); + std::swap(parameter_param_, other->parameter_param_); + std::swap(pooling_param_, other->pooling_param_); + std::swap(power_param_, other->power_param_); + std::swap(prelu_param_, other->prelu_param_); + std::swap(prior_box_param_, other->prior_box_param_); + std::swap(python_param_, other->python_param_); + std::swap(recurrent_param_, other->recurrent_param_); + std::swap(reduction_param_, other->reduction_param_); + std::swap(relu_param_, other->relu_param_); + std::swap(reshape_param_, other->reshape_param_); + std::swap(scale_param_, other->scale_param_); + std::swap(sigmoid_param_, other->sigmoid_param_); + std::swap(softmax_param_, other->softmax_param_); + std::swap(spp_param_, other->spp_param_); + std::swap(slice_param_, other->slice_param_); + std::swap(tanh_param_, other->tanh_param_); + std::swap(threshold_param_, other->threshold_param_); + std::swap(tile_param_, other->tile_param_); + std::swap(window_data_param_, other->window_data_param_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_has_bits_[1], other->_has_bits_[1]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata LayerParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LayerParameter_descriptor_; + metadata.reflection = LayerParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// LayerParameter + +// optional string name = 1; +bool LayerParameter::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void LayerParameter::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void LayerParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void LayerParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +const ::std::string& LayerParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.name) +} +void LayerParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.name) +} +void LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.name) +} +::std::string* LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void LayerParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.name) +} + +// optional string type = 2; +bool LayerParameter::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void LayerParameter::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +void LayerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +void LayerParameter::clear_type() { + type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); +} +const ::std::string& LayerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.type) + return type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.type) +} +void LayerParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.type) +} +void LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.type) +} +::std::string* LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void LayerParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.type) +} + +// repeated string bottom = 3; +int LayerParameter::bottom_size() const { + return bottom_.size(); +} +void LayerParameter::clear_bottom() { + bottom_.Clear(); +} +const ::std::string& LayerParameter::bottom(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.bottom) + return bottom_.Get(index); +} +::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} +void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.LayerParameter.bottom) + bottom_.Mutable(index)->assign(value); +} +void LayerParameter::set_bottom(int index, const char* value) { + bottom_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.bottom) +} +void LayerParameter::set_bottom(int index, const char* value, size_t size) { + bottom_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.bottom) +} +::std::string* LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:caffe.LayerParameter.bottom) + return bottom_.Add(); +} +void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.bottom) +} +void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.LayerParameter.bottom) +} +void LayerParameter::add_bottom(const char* value, size_t size) { + bottom_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.LayerParameter.bottom) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.bottom) + return bottom_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.bottom) + return &bottom_; +} + +// repeated string top = 4; +int LayerParameter::top_size() const { + return top_.size(); +} +void LayerParameter::clear_top() { + top_.Clear(); +} +const ::std::string& LayerParameter::top(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.top) + return top_.Get(index); +} +::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.top) + return top_.Mutable(index); +} +void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.LayerParameter.top) + top_.Mutable(index)->assign(value); +} +void LayerParameter::set_top(int index, const char* value) { + top_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.top) +} +void LayerParameter::set_top(int index, const char* value, size_t size) { + top_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.top) +} +::std::string* LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:caffe.LayerParameter.top) + return top_.Add(); +} +void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.top) +} +void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.LayerParameter.top) +} +void LayerParameter::add_top(const char* value, size_t size) { + top_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.LayerParameter.top) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.top) + return top_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.top) + return &top_; +} + +// optional .caffe.Phase phase = 10; +bool LayerParameter::has_phase() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void LayerParameter::set_has_phase() { + _has_bits_[0] |= 0x00000010u; +} +void LayerParameter::clear_has_phase() { + _has_bits_[0] &= ~0x00000010u; +} +void LayerParameter::clear_phase() { + phase_ = 0; + clear_has_phase(); +} +::caffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.phase) + return static_cast< ::caffe::Phase >(phase_); +} +void LayerParameter::set_phase(::caffe::Phase value) { + assert(::caffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:caffe.LayerParameter.phase) +} + +// repeated float loss_weight = 5; +int LayerParameter::loss_weight_size() const { + return loss_weight_.size(); +} +void LayerParameter::clear_loss_weight() { + loss_weight_.Clear(); +} +float LayerParameter::loss_weight(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.loss_weight) + return loss_weight_.Get(index); +} +void LayerParameter::set_loss_weight(int index, float value) { + loss_weight_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.loss_weight) +} +void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.loss_weight) +} +const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.loss_weight) + return loss_weight_; +} +::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .caffe.ParamSpec param = 6; +int LayerParameter::param_size() const { + return param_.size(); +} +void LayerParameter::clear_param() { + param_.Clear(); +} +const ::caffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.param) + return param_.Get(index); +} +::caffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.param) + return param_.Mutable(index); +} +::caffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.param) + return param_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.param) + return ¶m_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.param) + return param_; +} + +// repeated .caffe.BlobProto blobs = 7; +int LayerParameter::blobs_size() const { + return blobs_.size(); +} +void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::caffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.blobs) + return blobs_.Get(index); +} +::caffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +::caffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.blobs) + return blobs_; +} + +// repeated bool propagate_down = 11; +int LayerParameter::propagate_down_size() const { + return propagate_down_.size(); +} +void LayerParameter::clear_propagate_down() { + propagate_down_.Clear(); +} +bool LayerParameter::propagate_down(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.propagate_down) + return propagate_down_.Get(index); +} +void LayerParameter::set_propagate_down(int index, bool value) { + propagate_down_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.propagate_down) +} +void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.propagate_down) +} +const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.propagate_down) + return propagate_down_; +} +::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .caffe.NetStateRule include = 8; +int LayerParameter::include_size() const { + return include_.size(); +} +void LayerParameter::clear_include() { + include_.Clear(); +} +const ::caffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.include) + return include_.Get(index); +} +::caffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.include) + return include_.Mutable(index); +} +::caffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.include) + return include_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.include) + return &include_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.include) + return include_; +} + +// repeated .caffe.NetStateRule exclude = 9; +int LayerParameter::exclude_size() const { + return exclude_.size(); +} +void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +const ::caffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.exclude) + return exclude_.Get(index); +} +::caffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +::caffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.exclude) + return exclude_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.exclude) + return &exclude_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.exclude) + return exclude_; +} + +// optional .caffe.TransformationParameter transform_param = 100; +bool LayerParameter::has_transform_param() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void LayerParameter::set_has_transform_param() { + _has_bits_[0] |= 0x00000800u; +} +void LayerParameter::clear_has_transform_param() { + _has_bits_[0] &= ~0x00000800u; +} +void LayerParameter::clear_transform_param() { + if (transform_param_ != NULL) transform_param_->::caffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +const ::caffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ + : *::caffe::TransformationParameter::internal_default_instance(); +} +::caffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::caffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.transform_param) + return transform_param_; +} +::caffe::TransformationParameter* LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.transform_param) + clear_has_transform_param(); + ::caffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_transform_param(::caffe::TransformationParameter* transform_param) { + delete transform_param_; + transform_param_ = transform_param; + if (transform_param) { + set_has_transform_param(); + } else { + clear_has_transform_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.transform_param) +} + +// optional .caffe.LossParameter loss_param = 101; +bool LayerParameter::has_loss_param() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void LayerParameter::set_has_loss_param() { + _has_bits_[0] |= 0x00001000u; +} +void LayerParameter::clear_has_loss_param() { + _has_bits_[0] &= ~0x00001000u; +} +void LayerParameter::clear_loss_param() { + if (loss_param_ != NULL) loss_param_->::caffe::LossParameter::Clear(); + clear_has_loss_param(); +} +const ::caffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ + : *::caffe::LossParameter::internal_default_instance(); +} +::caffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::caffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.loss_param) + return loss_param_; +} +::caffe::LossParameter* LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.loss_param) + clear_has_loss_param(); + ::caffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_loss_param(::caffe::LossParameter* loss_param) { + delete loss_param_; + loss_param_ = loss_param; + if (loss_param) { + set_has_loss_param(); + } else { + clear_has_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.loss_param) +} + +// optional .caffe.AccuracyParameter accuracy_param = 102; +bool LayerParameter::has_accuracy_param() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +void LayerParameter::set_has_accuracy_param() { + _has_bits_[0] |= 0x00002000u; +} +void LayerParameter::clear_has_accuracy_param() { + _has_bits_[0] &= ~0x00002000u; +} +void LayerParameter::clear_accuracy_param() { + if (accuracy_param_ != NULL) accuracy_param_->::caffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +const ::caffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ + : *::caffe::AccuracyParameter::internal_default_instance(); +} +::caffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::caffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +::caffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::caffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_accuracy_param(::caffe::AccuracyParameter* accuracy_param) { + delete accuracy_param_; + accuracy_param_ = accuracy_param; + if (accuracy_param) { + set_has_accuracy_param(); + } else { + clear_has_accuracy_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.accuracy_param) +} + +// optional .caffe.ArgMaxParameter argmax_param = 103; +bool LayerParameter::has_argmax_param() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +void LayerParameter::set_has_argmax_param() { + _has_bits_[0] |= 0x00004000u; +} +void LayerParameter::clear_has_argmax_param() { + _has_bits_[0] &= ~0x00004000u; +} +void LayerParameter::clear_argmax_param() { + if (argmax_param_ != NULL) argmax_param_->::caffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +const ::caffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ + : *::caffe::ArgMaxParameter::internal_default_instance(); +} +::caffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::caffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.argmax_param) + return argmax_param_; +} +::caffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.argmax_param) + clear_has_argmax_param(); + ::caffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_argmax_param(::caffe::ArgMaxParameter* argmax_param) { + delete argmax_param_; + argmax_param_ = argmax_param; + if (argmax_param) { + set_has_argmax_param(); + } else { + clear_has_argmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.argmax_param) +} + +// optional .caffe.BatchNormParameter batch_norm_param = 139; +bool LayerParameter::has_batch_norm_param() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +void LayerParameter::set_has_batch_norm_param() { + _has_bits_[0] |= 0x00008000u; +} +void LayerParameter::clear_has_batch_norm_param() { + _has_bits_[0] &= ~0x00008000u; +} +void LayerParameter::clear_batch_norm_param() { + if (batch_norm_param_ != NULL) batch_norm_param_->::caffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +const ::caffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.batch_norm_param) + return batch_norm_param_ != NULL ? *batch_norm_param_ + : *::caffe::BatchNormParameter::internal_default_instance(); +} +::caffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) { + batch_norm_param_ = new ::caffe::BatchNormParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +::caffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.batch_norm_param) + clear_has_batch_norm_param(); + ::caffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_batch_norm_param(::caffe::BatchNormParameter* batch_norm_param) { + delete batch_norm_param_; + batch_norm_param_ = batch_norm_param; + if (batch_norm_param) { + set_has_batch_norm_param(); + } else { + clear_has_batch_norm_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.batch_norm_param) +} + +// optional .caffe.BiasParameter bias_param = 141; +bool LayerParameter::has_bias_param() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +void LayerParameter::set_has_bias_param() { + _has_bits_[0] |= 0x00010000u; +} +void LayerParameter::clear_has_bias_param() { + _has_bits_[0] &= ~0x00010000u; +} +void LayerParameter::clear_bias_param() { + if (bias_param_ != NULL) bias_param_->::caffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +const ::caffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.bias_param) + return bias_param_ != NULL ? *bias_param_ + : *::caffe::BiasParameter::internal_default_instance(); +} +::caffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) { + bias_param_ = new ::caffe::BiasParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.bias_param) + return bias_param_; +} +::caffe::BiasParameter* LayerParameter::release_bias_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.bias_param) + clear_has_bias_param(); + ::caffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_bias_param(::caffe::BiasParameter* bias_param) { + delete bias_param_; + bias_param_ = bias_param; + if (bias_param) { + set_has_bias_param(); + } else { + clear_has_bias_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.bias_param) +} + +// optional .caffe.ConcatParameter concat_param = 104; +bool LayerParameter::has_concat_param() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +void LayerParameter::set_has_concat_param() { + _has_bits_[0] |= 0x00020000u; +} +void LayerParameter::clear_has_concat_param() { + _has_bits_[0] &= ~0x00020000u; +} +void LayerParameter::clear_concat_param() { + if (concat_param_ != NULL) concat_param_->::caffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +const ::caffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ + : *::caffe::ConcatParameter::internal_default_instance(); +} +::caffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::caffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.concat_param) + return concat_param_; +} +::caffe::ConcatParameter* LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.concat_param) + clear_has_concat_param(); + ::caffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_concat_param(::caffe::ConcatParameter* concat_param) { + delete concat_param_; + concat_param_ = concat_param; + if (concat_param) { + set_has_concat_param(); + } else { + clear_has_concat_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.concat_param) +} + +// optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; +bool LayerParameter::has_contrastive_loss_param() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +void LayerParameter::set_has_contrastive_loss_param() { + _has_bits_[0] |= 0x00040000u; +} +void LayerParameter::clear_has_contrastive_loss_param() { + _has_bits_[0] &= ~0x00040000u; +} +void LayerParameter::clear_contrastive_loss_param() { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::caffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +const ::caffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ + : *::caffe::ContrastiveLossParameter::internal_default_instance(); +} +::caffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::caffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +::caffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::caffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_contrastive_loss_param(::caffe::ContrastiveLossParameter* contrastive_loss_param) { + delete contrastive_loss_param_; + contrastive_loss_param_ = contrastive_loss_param; + if (contrastive_loss_param) { + set_has_contrastive_loss_param(); + } else { + clear_has_contrastive_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.contrastive_loss_param) +} + +// optional .caffe.ConvolutionParameter convolution_param = 106; +bool LayerParameter::has_convolution_param() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +void LayerParameter::set_has_convolution_param() { + _has_bits_[0] |= 0x00080000u; +} +void LayerParameter::clear_has_convolution_param() { + _has_bits_[0] &= ~0x00080000u; +} +void LayerParameter::clear_convolution_param() { + if (convolution_param_ != NULL) convolution_param_->::caffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +const ::caffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ + : *::caffe::ConvolutionParameter::internal_default_instance(); +} +::caffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::caffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.convolution_param) + return convolution_param_; +} +::caffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.convolution_param) + clear_has_convolution_param(); + ::caffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_convolution_param(::caffe::ConvolutionParameter* convolution_param) { + delete convolution_param_; + convolution_param_ = convolution_param; + if (convolution_param) { + set_has_convolution_param(); + } else { + clear_has_convolution_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.convolution_param) +} + +// optional .caffe.CropParameter crop_param = 144; +bool LayerParameter::has_crop_param() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +void LayerParameter::set_has_crop_param() { + _has_bits_[0] |= 0x00100000u; +} +void LayerParameter::clear_has_crop_param() { + _has_bits_[0] &= ~0x00100000u; +} +void LayerParameter::clear_crop_param() { + if (crop_param_ != NULL) crop_param_->::caffe::CropParameter::Clear(); + clear_has_crop_param(); +} +const ::caffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.crop_param) + return crop_param_ != NULL ? *crop_param_ + : *::caffe::CropParameter::internal_default_instance(); +} +::caffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) { + crop_param_ = new ::caffe::CropParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.crop_param) + return crop_param_; +} +::caffe::CropParameter* LayerParameter::release_crop_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.crop_param) + clear_has_crop_param(); + ::caffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_crop_param(::caffe::CropParameter* crop_param) { + delete crop_param_; + crop_param_ = crop_param; + if (crop_param) { + set_has_crop_param(); + } else { + clear_has_crop_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.crop_param) +} + +// optional .caffe.DataParameter data_param = 107; +bool LayerParameter::has_data_param() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +void LayerParameter::set_has_data_param() { + _has_bits_[0] |= 0x00200000u; +} +void LayerParameter::clear_has_data_param() { + _has_bits_[0] &= ~0x00200000u; +} +void LayerParameter::clear_data_param() { + if (data_param_ != NULL) data_param_->::caffe::DataParameter::Clear(); + clear_has_data_param(); +} +const ::caffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ + : *::caffe::DataParameter::internal_default_instance(); +} +::caffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::caffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.data_param) + return data_param_; +} +::caffe::DataParameter* LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.data_param) + clear_has_data_param(); + ::caffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_data_param(::caffe::DataParameter* data_param) { + delete data_param_; + data_param_ = data_param; + if (data_param) { + set_has_data_param(); + } else { + clear_has_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.data_param) +} + +// optional .caffe.DetectionOutputParameter detection_output_param = 147; +bool LayerParameter::has_detection_output_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +void LayerParameter::set_has_detection_output_param() { + _has_bits_[0] |= 0x00400000u; +} +void LayerParameter::clear_has_detection_output_param() { + _has_bits_[0] &= ~0x00400000u; +} +void LayerParameter::clear_detection_output_param() { + if (detection_output_param_ != NULL) detection_output_param_->::caffe::DetectionOutputParameter::Clear(); + clear_has_detection_output_param(); +} +const ::caffe::DetectionOutputParameter& LayerParameter::detection_output_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.detection_output_param) + return detection_output_param_ != NULL ? *detection_output_param_ + : *::caffe::DetectionOutputParameter::internal_default_instance(); +} +::caffe::DetectionOutputParameter* LayerParameter::mutable_detection_output_param() { + set_has_detection_output_param(); + if (detection_output_param_ == NULL) { + detection_output_param_ = new ::caffe::DetectionOutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.detection_output_param) + return detection_output_param_; +} +::caffe::DetectionOutputParameter* LayerParameter::release_detection_output_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.detection_output_param) + clear_has_detection_output_param(); + ::caffe::DetectionOutputParameter* temp = detection_output_param_; + detection_output_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_detection_output_param(::caffe::DetectionOutputParameter* detection_output_param) { + delete detection_output_param_; + detection_output_param_ = detection_output_param; + if (detection_output_param) { + set_has_detection_output_param(); + } else { + clear_has_detection_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.detection_output_param) +} + +// optional .caffe.DropoutParameter dropout_param = 108; +bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00800000u; +} +void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00800000u; +} +void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::caffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +const ::caffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ + : *::caffe::DropoutParameter::internal_default_instance(); +} +::caffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::caffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.dropout_param) + return dropout_param_; +} +::caffe::DropoutParameter* LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.dropout_param) + clear_has_dropout_param(); + ::caffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_dropout_param(::caffe::DropoutParameter* dropout_param) { + delete dropout_param_; + dropout_param_ = dropout_param; + if (dropout_param) { + set_has_dropout_param(); + } else { + clear_has_dropout_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.dropout_param) +} + +// optional .caffe.DummyDataParameter dummy_data_param = 109; +bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x01000000u; +} +void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x01000000u; +} +void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::caffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +const ::caffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ + : *::caffe::DummyDataParameter::internal_default_instance(); +} +::caffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::caffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +::caffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::caffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_dummy_data_param(::caffe::DummyDataParameter* dummy_data_param) { + delete dummy_data_param_; + dummy_data_param_ = dummy_data_param; + if (dummy_data_param) { + set_has_dummy_data_param(); + } else { + clear_has_dummy_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.dummy_data_param) +} + +// optional .caffe.EltwiseParameter eltwise_param = 110; +bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x02000000u; +} +void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x02000000u; +} +void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::caffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +const ::caffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ + : *::caffe::EltwiseParameter::internal_default_instance(); +} +::caffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::caffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +::caffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::caffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_eltwise_param(::caffe::EltwiseParameter* eltwise_param) { + delete eltwise_param_; + eltwise_param_ = eltwise_param; + if (eltwise_param) { + set_has_eltwise_param(); + } else { + clear_has_eltwise_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.eltwise_param) +} + +// optional .caffe.ELUParameter elu_param = 140; +bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x04000000u; +} +void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x04000000u; +} +void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::caffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +const ::caffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.elu_param) + return elu_param_ != NULL ? *elu_param_ + : *::caffe::ELUParameter::internal_default_instance(); +} +::caffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) { + elu_param_ = new ::caffe::ELUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.elu_param) + return elu_param_; +} +::caffe::ELUParameter* LayerParameter::release_elu_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.elu_param) + clear_has_elu_param(); + ::caffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_elu_param(::caffe::ELUParameter* elu_param) { + delete elu_param_; + elu_param_ = elu_param; + if (elu_param) { + set_has_elu_param(); + } else { + clear_has_elu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.elu_param) +} + +// optional .caffe.EmbedParameter embed_param = 137; +bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x08000000u; +} +void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x08000000u; +} +void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::caffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +const ::caffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.embed_param) + return embed_param_ != NULL ? *embed_param_ + : *::caffe::EmbedParameter::internal_default_instance(); +} +::caffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) { + embed_param_ = new ::caffe::EmbedParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.embed_param) + return embed_param_; +} +::caffe::EmbedParameter* LayerParameter::release_embed_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.embed_param) + clear_has_embed_param(); + ::caffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_embed_param(::caffe::EmbedParameter* embed_param) { + delete embed_param_; + embed_param_ = embed_param; + if (embed_param) { + set_has_embed_param(); + } else { + clear_has_embed_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.embed_param) +} + +// optional .caffe.ExpParameter exp_param = 111; +bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x10000000u; +} +void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x10000000u; +} +void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::caffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +const ::caffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ + : *::caffe::ExpParameter::internal_default_instance(); +} +::caffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::caffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.exp_param) + return exp_param_; +} +::caffe::ExpParameter* LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.exp_param) + clear_has_exp_param(); + ::caffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_exp_param(::caffe::ExpParameter* exp_param) { + delete exp_param_; + exp_param_ = exp_param; + if (exp_param) { + set_has_exp_param(); + } else { + clear_has_exp_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.exp_param) +} + +// optional .caffe.FlattenParameter flatten_param = 135; +bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x20000000u; +} +void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x20000000u; +} +void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::caffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +const ::caffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.flatten_param) + return flatten_param_ != NULL ? *flatten_param_ + : *::caffe::FlattenParameter::internal_default_instance(); +} +::caffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) { + flatten_param_ = new ::caffe::FlattenParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.flatten_param) + return flatten_param_; +} +::caffe::FlattenParameter* LayerParameter::release_flatten_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.flatten_param) + clear_has_flatten_param(); + ::caffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_flatten_param(::caffe::FlattenParameter* flatten_param) { + delete flatten_param_; + flatten_param_ = flatten_param; + if (flatten_param) { + set_has_flatten_param(); + } else { + clear_has_flatten_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.flatten_param) +} + +// optional .caffe.HDF5DataParameter hdf5_data_param = 112; +bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x40000000u; +} +void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x40000000u; +} +void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::caffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +const ::caffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ + : *::caffe::HDF5DataParameter::internal_default_instance(); +} +::caffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::caffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +::caffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::caffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hdf5_data_param(::caffe::HDF5DataParameter* hdf5_data_param) { + delete hdf5_data_param_; + hdf5_data_param_ = hdf5_data_param; + if (hdf5_data_param) { + set_has_hdf5_data_param(); + } else { + clear_has_hdf5_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.hdf5_data_param) +} + +// optional .caffe.HDF5OutputParameter hdf5_output_param = 113; +bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x80000000u; +} +void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x80000000u; +} +void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::caffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ + : *::caffe::HDF5OutputParameter::internal_default_instance(); +} +::caffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::caffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::caffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::caffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param) { + delete hdf5_output_param_; + hdf5_output_param_ = hdf5_output_param; + if (hdf5_output_param) { + set_has_hdf5_output_param(); + } else { + clear_has_hdf5_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.hdf5_output_param) +} + +// optional .caffe.HingeLossParameter hinge_loss_param = 114; +bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[1] |= 0x00000001u; +} +void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[1] &= ~0x00000001u; +} +void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::caffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +const ::caffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ + : *::caffe::HingeLossParameter::internal_default_instance(); +} +::caffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::caffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +::caffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::caffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hinge_loss_param(::caffe::HingeLossParameter* hinge_loss_param) { + delete hinge_loss_param_; + hinge_loss_param_ = hinge_loss_param; + if (hinge_loss_param) { + set_has_hinge_loss_param(); + } else { + clear_has_hinge_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.hinge_loss_param) +} + +// optional .caffe.ImageDataParameter image_data_param = 115; +bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000002u; +} +void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000002u; +} +void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::caffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +const ::caffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ + : *::caffe::ImageDataParameter::internal_default_instance(); +} +::caffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::caffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.image_data_param) + return image_data_param_; +} +::caffe::ImageDataParameter* LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.image_data_param) + clear_has_image_data_param(); + ::caffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_image_data_param(::caffe::ImageDataParameter* image_data_param) { + delete image_data_param_; + image_data_param_ = image_data_param; + if (image_data_param) { + set_has_image_data_param(); + } else { + clear_has_image_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.image_data_param) +} + +// optional .caffe.InfogainLossParameter infogain_loss_param = 116; +bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000004u; +} +void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000004u; +} +void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::caffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +const ::caffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ + : *::caffe::InfogainLossParameter::internal_default_instance(); +} +::caffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::caffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +::caffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::caffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_infogain_loss_param(::caffe::InfogainLossParameter* infogain_loss_param) { + delete infogain_loss_param_; + infogain_loss_param_ = infogain_loss_param; + if (infogain_loss_param) { + set_has_infogain_loss_param(); + } else { + clear_has_infogain_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.infogain_loss_param) +} + +// optional .caffe.InnerProductParameter inner_product_param = 117; +bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000008u; +} +void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000008u; +} +void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::caffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +const ::caffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ + : *::caffe::InnerProductParameter::internal_default_instance(); +} +::caffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::caffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +::caffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::caffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_inner_product_param(::caffe::InnerProductParameter* inner_product_param) { + delete inner_product_param_; + inner_product_param_ = inner_product_param; + if (inner_product_param) { + set_has_inner_product_param(); + } else { + clear_has_inner_product_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.inner_product_param) +} + +// optional .caffe.InputParameter input_param = 143; +bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000010u; +} +void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000010u; +} +void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::caffe::InputParameter::Clear(); + clear_has_input_param(); +} +const ::caffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.input_param) + return input_param_ != NULL ? *input_param_ + : *::caffe::InputParameter::internal_default_instance(); +} +::caffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) { + input_param_ = new ::caffe::InputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.input_param) + return input_param_; +} +::caffe::InputParameter* LayerParameter::release_input_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.input_param) + clear_has_input_param(); + ::caffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_input_param(::caffe::InputParameter* input_param) { + delete input_param_; + input_param_ = input_param; + if (input_param) { + set_has_input_param(); + } else { + clear_has_input_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.input_param) +} + +// optional .caffe.LogParameter log_param = 134; +bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000020u; +} +void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000020u; +} +void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::caffe::LogParameter::Clear(); + clear_has_log_param(); +} +const ::caffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.log_param) + return log_param_ != NULL ? *log_param_ + : *::caffe::LogParameter::internal_default_instance(); +} +::caffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) { + log_param_ = new ::caffe::LogParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.log_param) + return log_param_; +} +::caffe::LogParameter* LayerParameter::release_log_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.log_param) + clear_has_log_param(); + ::caffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_log_param(::caffe::LogParameter* log_param) { + delete log_param_; + log_param_ = log_param; + if (log_param) { + set_has_log_param(); + } else { + clear_has_log_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.log_param) +} + +// optional .caffe.LRNParameter lrn_param = 118; +bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000040u; +} +void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000040u; +} +void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::caffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +const ::caffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ + : *::caffe::LRNParameter::internal_default_instance(); +} +::caffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::caffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.lrn_param) + return lrn_param_; +} +::caffe::LRNParameter* LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.lrn_param) + clear_has_lrn_param(); + ::caffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_lrn_param(::caffe::LRNParameter* lrn_param) { + delete lrn_param_; + lrn_param_ = lrn_param; + if (lrn_param) { + set_has_lrn_param(); + } else { + clear_has_lrn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.lrn_param) +} + +// optional .caffe.MemoryDataParameter memory_data_param = 119; +bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000080u; +} +void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000080u; +} +void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::caffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +const ::caffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ + : *::caffe::MemoryDataParameter::internal_default_instance(); +} +::caffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::caffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +::caffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::caffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_memory_data_param(::caffe::MemoryDataParameter* memory_data_param) { + delete memory_data_param_; + memory_data_param_ = memory_data_param; + if (memory_data_param) { + set_has_memory_data_param(); + } else { + clear_has_memory_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.memory_data_param) +} + +// optional .caffe.MVNParameter mvn_param = 120; +bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000100u; +} +void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000100u; +} +void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::caffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +const ::caffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ + : *::caffe::MVNParameter::internal_default_instance(); +} +::caffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::caffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.mvn_param) + return mvn_param_; +} +::caffe::MVNParameter* LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.mvn_param) + clear_has_mvn_param(); + ::caffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_mvn_param(::caffe::MVNParameter* mvn_param) { + delete mvn_param_; + mvn_param_ = mvn_param; + if (mvn_param) { + set_has_mvn_param(); + } else { + clear_has_mvn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.mvn_param) +} + +// optional .caffe.NormalizeBBoxParameter norm_param = 149; +bool LayerParameter::has_norm_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +void LayerParameter::set_has_norm_param() { + _has_bits_[1] |= 0x00000200u; +} +void LayerParameter::clear_has_norm_param() { + _has_bits_[1] &= ~0x00000200u; +} +void LayerParameter::clear_norm_param() { + if (norm_param_ != NULL) norm_param_->::caffe::NormalizeBBoxParameter::Clear(); + clear_has_norm_param(); +} +const ::caffe::NormalizeBBoxParameter& LayerParameter::norm_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.norm_param) + return norm_param_ != NULL ? *norm_param_ + : *::caffe::NormalizeBBoxParameter::internal_default_instance(); +} +::caffe::NormalizeBBoxParameter* LayerParameter::mutable_norm_param() { + set_has_norm_param(); + if (norm_param_ == NULL) { + norm_param_ = new ::caffe::NormalizeBBoxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.norm_param) + return norm_param_; +} +::caffe::NormalizeBBoxParameter* LayerParameter::release_norm_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.norm_param) + clear_has_norm_param(); + ::caffe::NormalizeBBoxParameter* temp = norm_param_; + norm_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_norm_param(::caffe::NormalizeBBoxParameter* norm_param) { + delete norm_param_; + norm_param_ = norm_param; + if (norm_param) { + set_has_norm_param(); + } else { + clear_has_norm_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.norm_param) +} + +// optional .caffe.PermuteParameter permute_param = 148; +bool LayerParameter::has_permute_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +void LayerParameter::set_has_permute_param() { + _has_bits_[1] |= 0x00000400u; +} +void LayerParameter::clear_has_permute_param() { + _has_bits_[1] &= ~0x00000400u; +} +void LayerParameter::clear_permute_param() { + if (permute_param_ != NULL) permute_param_->::caffe::PermuteParameter::Clear(); + clear_has_permute_param(); +} +const ::caffe::PermuteParameter& LayerParameter::permute_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.permute_param) + return permute_param_ != NULL ? *permute_param_ + : *::caffe::PermuteParameter::internal_default_instance(); +} +::caffe::PermuteParameter* LayerParameter::mutable_permute_param() { + set_has_permute_param(); + if (permute_param_ == NULL) { + permute_param_ = new ::caffe::PermuteParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.permute_param) + return permute_param_; +} +::caffe::PermuteParameter* LayerParameter::release_permute_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.permute_param) + clear_has_permute_param(); + ::caffe::PermuteParameter* temp = permute_param_; + permute_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_permute_param(::caffe::PermuteParameter* permute_param) { + delete permute_param_; + permute_param_ = permute_param; + if (permute_param) { + set_has_permute_param(); + } else { + clear_has_permute_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.permute_param) +} + +// optional .caffe.ParameterParameter parameter_param = 145; +bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000800u; +} +void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000800u; +} +void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::caffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +const ::caffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.parameter_param) + return parameter_param_ != NULL ? *parameter_param_ + : *::caffe::ParameterParameter::internal_default_instance(); +} +::caffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) { + parameter_param_ = new ::caffe::ParameterParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.parameter_param) + return parameter_param_; +} +::caffe::ParameterParameter* LayerParameter::release_parameter_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.parameter_param) + clear_has_parameter_param(); + ::caffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_parameter_param(::caffe::ParameterParameter* parameter_param) { + delete parameter_param_; + parameter_param_ = parameter_param; + if (parameter_param) { + set_has_parameter_param(); + } else { + clear_has_parameter_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.parameter_param) +} + +// optional .caffe.PoolingParameter pooling_param = 121; +bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00001000u; +} +void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00001000u; +} +void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::caffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +const ::caffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ + : *::caffe::PoolingParameter::internal_default_instance(); +} +::caffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::caffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.pooling_param) + return pooling_param_; +} +::caffe::PoolingParameter* LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.pooling_param) + clear_has_pooling_param(); + ::caffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_pooling_param(::caffe::PoolingParameter* pooling_param) { + delete pooling_param_; + pooling_param_ = pooling_param; + if (pooling_param) { + set_has_pooling_param(); + } else { + clear_has_pooling_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.pooling_param) +} + +// optional .caffe.PowerParameter power_param = 122; +bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00002000u; +} +void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00002000u; +} +void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); + clear_has_power_param(); +} +const ::caffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ + : *::caffe::PowerParameter::internal_default_instance(); +} +::caffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::caffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.power_param) + return power_param_; +} +::caffe::PowerParameter* LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.power_param) + clear_has_power_param(); + ::caffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_power_param(::caffe::PowerParameter* power_param) { + delete power_param_; + power_param_ = power_param; + if (power_param) { + set_has_power_param(); + } else { + clear_has_power_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.power_param) +} + +// optional .caffe.PReLUParameter prelu_param = 131; +bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00004000u; +} +void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00004000u; +} +void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::caffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +const ::caffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.prelu_param) + return prelu_param_ != NULL ? *prelu_param_ + : *::caffe::PReLUParameter::internal_default_instance(); +} +::caffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) { + prelu_param_ = new ::caffe::PReLUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.prelu_param) + return prelu_param_; +} +::caffe::PReLUParameter* LayerParameter::release_prelu_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.prelu_param) + clear_has_prelu_param(); + ::caffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_prelu_param(::caffe::PReLUParameter* prelu_param) { + delete prelu_param_; + prelu_param_ = prelu_param; + if (prelu_param) { + set_has_prelu_param(); + } else { + clear_has_prelu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.prelu_param) +} + +// optional .caffe.PriorBoxParameter prior_box_param = 150; +bool LayerParameter::has_prior_box_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +void LayerParameter::set_has_prior_box_param() { + _has_bits_[1] |= 0x00008000u; +} +void LayerParameter::clear_has_prior_box_param() { + _has_bits_[1] &= ~0x00008000u; +} +void LayerParameter::clear_prior_box_param() { + if (prior_box_param_ != NULL) prior_box_param_->::caffe::PriorBoxParameter::Clear(); + clear_has_prior_box_param(); +} +const ::caffe::PriorBoxParameter& LayerParameter::prior_box_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.prior_box_param) + return prior_box_param_ != NULL ? *prior_box_param_ + : *::caffe::PriorBoxParameter::internal_default_instance(); +} +::caffe::PriorBoxParameter* LayerParameter::mutable_prior_box_param() { + set_has_prior_box_param(); + if (prior_box_param_ == NULL) { + prior_box_param_ = new ::caffe::PriorBoxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.prior_box_param) + return prior_box_param_; +} +::caffe::PriorBoxParameter* LayerParameter::release_prior_box_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.prior_box_param) + clear_has_prior_box_param(); + ::caffe::PriorBoxParameter* temp = prior_box_param_; + prior_box_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_prior_box_param(::caffe::PriorBoxParameter* prior_box_param) { + delete prior_box_param_; + prior_box_param_ = prior_box_param; + if (prior_box_param) { + set_has_prior_box_param(); + } else { + clear_has_prior_box_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.prior_box_param) +} + +// optional .caffe.PythonParameter python_param = 130; +bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00010000u; +} +void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00010000u; +} +void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::caffe::PythonParameter::Clear(); + clear_has_python_param(); +} +const ::caffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.python_param) + return python_param_ != NULL ? *python_param_ + : *::caffe::PythonParameter::internal_default_instance(); +} +::caffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) { + python_param_ = new ::caffe::PythonParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.python_param) + return python_param_; +} +::caffe::PythonParameter* LayerParameter::release_python_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.python_param) + clear_has_python_param(); + ::caffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_python_param(::caffe::PythonParameter* python_param) { + delete python_param_; + python_param_ = python_param; + if (python_param) { + set_has_python_param(); + } else { + clear_has_python_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.python_param) +} + +// optional .caffe.RecurrentParameter recurrent_param = 146; +bool LayerParameter::has_recurrent_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +void LayerParameter::set_has_recurrent_param() { + _has_bits_[1] |= 0x00020000u; +} +void LayerParameter::clear_has_recurrent_param() { + _has_bits_[1] &= ~0x00020000u; +} +void LayerParameter::clear_recurrent_param() { + if (recurrent_param_ != NULL) recurrent_param_->::caffe::RecurrentParameter::Clear(); + clear_has_recurrent_param(); +} +const ::caffe::RecurrentParameter& LayerParameter::recurrent_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.recurrent_param) + return recurrent_param_ != NULL ? *recurrent_param_ + : *::caffe::RecurrentParameter::internal_default_instance(); +} +::caffe::RecurrentParameter* LayerParameter::mutable_recurrent_param() { + set_has_recurrent_param(); + if (recurrent_param_ == NULL) { + recurrent_param_ = new ::caffe::RecurrentParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.recurrent_param) + return recurrent_param_; +} +::caffe::RecurrentParameter* LayerParameter::release_recurrent_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.recurrent_param) + clear_has_recurrent_param(); + ::caffe::RecurrentParameter* temp = recurrent_param_; + recurrent_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_recurrent_param(::caffe::RecurrentParameter* recurrent_param) { + delete recurrent_param_; + recurrent_param_ = recurrent_param; + if (recurrent_param) { + set_has_recurrent_param(); + } else { + clear_has_recurrent_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.recurrent_param) +} + +// optional .caffe.ReductionParameter reduction_param = 136; +bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00040000u; +} +void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00040000u; +} +void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::caffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +const ::caffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.reduction_param) + return reduction_param_ != NULL ? *reduction_param_ + : *::caffe::ReductionParameter::internal_default_instance(); +} +::caffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) { + reduction_param_ = new ::caffe::ReductionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.reduction_param) + return reduction_param_; +} +::caffe::ReductionParameter* LayerParameter::release_reduction_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.reduction_param) + clear_has_reduction_param(); + ::caffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_reduction_param(::caffe::ReductionParameter* reduction_param) { + delete reduction_param_; + reduction_param_ = reduction_param; + if (reduction_param) { + set_has_reduction_param(); + } else { + clear_has_reduction_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.reduction_param) +} + +// optional .caffe.ReLUParameter relu_param = 123; +bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00080000u; +} +void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00080000u; +} +void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +const ::caffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ + : *::caffe::ReLUParameter::internal_default_instance(); +} +::caffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::caffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.relu_param) + return relu_param_; +} +::caffe::ReLUParameter* LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.relu_param) + clear_has_relu_param(); + ::caffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_relu_param(::caffe::ReLUParameter* relu_param) { + delete relu_param_; + relu_param_ = relu_param; + if (relu_param) { + set_has_relu_param(); + } else { + clear_has_relu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.relu_param) +} + +// optional .caffe.ReshapeParameter reshape_param = 133; +bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00100000u; +} +void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00100000u; +} +void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::caffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +const ::caffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.reshape_param) + return reshape_param_ != NULL ? *reshape_param_ + : *::caffe::ReshapeParameter::internal_default_instance(); +} +::caffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) { + reshape_param_ = new ::caffe::ReshapeParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.reshape_param) + return reshape_param_; +} +::caffe::ReshapeParameter* LayerParameter::release_reshape_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.reshape_param) + clear_has_reshape_param(); + ::caffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_reshape_param(::caffe::ReshapeParameter* reshape_param) { + delete reshape_param_; + reshape_param_ = reshape_param; + if (reshape_param) { + set_has_reshape_param(); + } else { + clear_has_reshape_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.reshape_param) +} + +// optional .caffe.ScaleParameter scale_param = 142; +bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00200000u; +} +void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00200000u; +} +void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::caffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +const ::caffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.scale_param) + return scale_param_ != NULL ? *scale_param_ + : *::caffe::ScaleParameter::internal_default_instance(); +} +::caffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) { + scale_param_ = new ::caffe::ScaleParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.scale_param) + return scale_param_; +} +::caffe::ScaleParameter* LayerParameter::release_scale_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.scale_param) + clear_has_scale_param(); + ::caffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_scale_param(::caffe::ScaleParameter* scale_param) { + delete scale_param_; + scale_param_ = scale_param; + if (scale_param) { + set_has_scale_param(); + } else { + clear_has_scale_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.scale_param) +} + +// optional .caffe.SigmoidParameter sigmoid_param = 124; +bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00400000u; +} +void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00400000u; +} +void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +const ::caffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ + : *::caffe::SigmoidParameter::internal_default_instance(); +} +::caffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::caffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +::caffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::caffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_sigmoid_param(::caffe::SigmoidParameter* sigmoid_param) { + delete sigmoid_param_; + sigmoid_param_ = sigmoid_param; + if (sigmoid_param) { + set_has_sigmoid_param(); + } else { + clear_has_sigmoid_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.sigmoid_param) +} + +// optional .caffe.SoftmaxParameter softmax_param = 125; +bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00800000u; +} +void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00800000u; +} +void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +const ::caffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ + : *::caffe::SoftmaxParameter::internal_default_instance(); +} +::caffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::caffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.softmax_param) + return softmax_param_; +} +::caffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.softmax_param) + clear_has_softmax_param(); + ::caffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_softmax_param(::caffe::SoftmaxParameter* softmax_param) { + delete softmax_param_; + softmax_param_ = softmax_param; + if (softmax_param) { + set_has_softmax_param(); + } else { + clear_has_softmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.softmax_param) +} + +// optional .caffe.SPPParameter spp_param = 132; +bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x01000000u; +} +void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x01000000u; +} +void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::caffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +const ::caffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.spp_param) + return spp_param_ != NULL ? *spp_param_ + : *::caffe::SPPParameter::internal_default_instance(); +} +::caffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) { + spp_param_ = new ::caffe::SPPParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.spp_param) + return spp_param_; +} +::caffe::SPPParameter* LayerParameter::release_spp_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.spp_param) + clear_has_spp_param(); + ::caffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_spp_param(::caffe::SPPParameter* spp_param) { + delete spp_param_; + spp_param_ = spp_param; + if (spp_param) { + set_has_spp_param(); + } else { + clear_has_spp_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.spp_param) +} + +// optional .caffe.SliceParameter slice_param = 126; +bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x02000000u) != 0; +} +void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x02000000u; +} +void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x02000000u; +} +void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +const ::caffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ + : *::caffe::SliceParameter::internal_default_instance(); +} +::caffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::caffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.slice_param) + return slice_param_; +} +::caffe::SliceParameter* LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.slice_param) + clear_has_slice_param(); + ::caffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_slice_param(::caffe::SliceParameter* slice_param) { + delete slice_param_; + slice_param_ = slice_param; + if (slice_param) { + set_has_slice_param(); + } else { + clear_has_slice_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.slice_param) +} + +// optional .caffe.TanHParameter tanh_param = 127; +bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x04000000u) != 0; +} +void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x04000000u; +} +void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x04000000u; +} +void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +const ::caffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ + : *::caffe::TanHParameter::internal_default_instance(); +} +::caffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::caffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.tanh_param) + return tanh_param_; +} +::caffe::TanHParameter* LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.tanh_param) + clear_has_tanh_param(); + ::caffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_tanh_param(::caffe::TanHParameter* tanh_param) { + delete tanh_param_; + tanh_param_ = tanh_param; + if (tanh_param) { + set_has_tanh_param(); + } else { + clear_has_tanh_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.tanh_param) +} + +// optional .caffe.ThresholdParameter threshold_param = 128; +bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x08000000u) != 0; +} +void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x08000000u; +} +void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x08000000u; +} +void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +const ::caffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ + : *::caffe::ThresholdParameter::internal_default_instance(); +} +::caffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::caffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.threshold_param) + return threshold_param_; +} +::caffe::ThresholdParameter* LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.threshold_param) + clear_has_threshold_param(); + ::caffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_threshold_param(::caffe::ThresholdParameter* threshold_param) { + delete threshold_param_; + threshold_param_ = threshold_param; + if (threshold_param) { + set_has_threshold_param(); + } else { + clear_has_threshold_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.threshold_param) +} + +// optional .caffe.TileParameter tile_param = 138; +bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x10000000u) != 0; +} +void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x10000000u; +} +void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x10000000u; +} +void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::caffe::TileParameter::Clear(); + clear_has_tile_param(); +} +const ::caffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.tile_param) + return tile_param_ != NULL ? *tile_param_ + : *::caffe::TileParameter::internal_default_instance(); +} +::caffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) { + tile_param_ = new ::caffe::TileParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.tile_param) + return tile_param_; +} +::caffe::TileParameter* LayerParameter::release_tile_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.tile_param) + clear_has_tile_param(); + ::caffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_tile_param(::caffe::TileParameter* tile_param) { + delete tile_param_; + tile_param_ = tile_param; + if (tile_param) { + set_has_tile_param(); + } else { + clear_has_tile_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.tile_param) +} + +// optional .caffe.WindowDataParameter window_data_param = 129; +bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x20000000u) != 0; +} +void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x20000000u; +} +void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x20000000u; +} +void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +const ::caffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ + : *::caffe::WindowDataParameter::internal_default_instance(); +} +::caffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::caffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.window_data_param) + return window_data_param_; +} +::caffe::WindowDataParameter* LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.window_data_param) + clear_has_window_data_param(); + ::caffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_window_data_param(::caffe::WindowDataParameter* window_data_param) { + delete window_data_param_; + window_data_param_ = window_data_param; + if (window_data_param) { + set_has_window_data_param(); + } else { + clear_has_window_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.window_data_param) +} + +inline const LayerParameter* LayerParameter::internal_default_instance() { + return &LayerParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TransformationParameter::kScaleFieldNumber; +const int TransformationParameter::kMirrorFieldNumber; +const int TransformationParameter::kCropSizeFieldNumber; +const int TransformationParameter::kMeanFileFieldNumber; +const int TransformationParameter::kMeanValueFieldNumber; +const int TransformationParameter::kForceColorFieldNumber; +const int TransformationParameter::kForceGrayFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TransformationParameter::TransformationParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.TransformationParameter) +} + +void TransformationParameter::InitAsDefaultInstance() { +} + +TransformationParameter::TransformationParameter(const TransformationParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.TransformationParameter) +} + +void TransformationParameter::SharedCtor() { + _cached_size_ = 0; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&crop_size_, 0, reinterpret_cast(&force_gray_) - + reinterpret_cast(&crop_size_) + sizeof(force_gray_)); + scale_ = 1; +} + +TransformationParameter::~TransformationParameter() { + // @@protoc_insertion_point(destructor:caffe.TransformationParameter) + SharedDtor(); +} + +void TransformationParameter::SharedDtor() { + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void TransformationParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TransformationParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TransformationParameter_descriptor_; +} + +const TransformationParameter& TransformationParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed TransformationParameter_default_instance_; + +TransformationParameter* TransformationParameter::New(::google::protobuf::Arena* arena) const { + TransformationParameter* n = new TransformationParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void TransformationParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.TransformationParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(TransformationParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 111u) { + ZR_(crop_size_, force_gray_); + scale_ = 1; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + mean_value_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool TransformationParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.TransformationParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float scale = 1 [default = 1]; + case 1: { + if (tag == 13) { + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_mirror; + break; + } + + // optional bool mirror = 2 [default = false]; + case 2: { + if (tag == 16) { + parse_mirror: + set_has_mirror(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_crop_size; + break; + } + + // optional uint32 crop_size = 3 [default = 0]; + case 3: { + if (tag == 24) { + parse_crop_size: + set_has_crop_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_mean_file; + break; + } + + // optional string mean_file = 4; + case 4: { + if (tag == 34) { + parse_mean_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_mean_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.TransformationParameter.mean_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(45)) goto parse_mean_value; + break; + } + + // repeated float mean_value = 5; + case 5: { + if (tag == 45) { + parse_mean_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 45, input, this->mutable_mean_value()))); + } else if (tag == 42) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_mean_value()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(45)) goto parse_mean_value; + if (input->ExpectTag(48)) goto parse_force_color; + break; + } + + // optional bool force_color = 6 [default = false]; + case 6: { + if (tag == 48) { + parse_force_color: + set_has_force_color(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_color_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_force_gray; + break; + } + + // optional bool force_gray = 7 [default = false]; + case 7: { + if (tag == 56) { + parse_force_gray: + set_has_force_gray(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_gray_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.TransformationParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.TransformationParameter) + return false; +#undef DO_ +} + +void TransformationParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.TransformationParameter) + // optional float scale = 1 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->scale(), output); + } + + // optional bool mirror = 2 [default = false]; + if (has_mirror()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->mirror(), output); + } + + // optional uint32 crop_size = 3 [default = 0]; + if (has_crop_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->crop_size(), output); + } + + // optional string mean_file = 4; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.TransformationParameter.mean_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->mean_file(), output); + } + + // repeated float mean_value = 5; + for (int i = 0; i < this->mean_value_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 5, this->mean_value(i), output); + } + + // optional bool force_color = 6 [default = false]; + if (has_force_color()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->force_color(), output); + } + + // optional bool force_gray = 7 [default = false]; + if (has_force_gray()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->force_gray(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.TransformationParameter) +} + +::google::protobuf::uint8* TransformationParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.TransformationParameter) + // optional float scale = 1 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->scale(), target); + } + + // optional bool mirror = 2 [default = false]; + if (has_mirror()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->mirror(), target); + } + + // optional uint32 crop_size = 3 [default = 0]; + if (has_crop_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->crop_size(), target); + } + + // optional string mean_file = 4; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.TransformationParameter.mean_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->mean_file(), target); + } + + // repeated float mean_value = 5; + for (int i = 0; i < this->mean_value_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(5, this->mean_value(i), target); + } + + // optional bool force_color = 6 [default = false]; + if (has_force_color()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->force_color(), target); + } + + // optional bool force_gray = 7 [default = false]; + if (has_force_gray()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->force_gray(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.TransformationParameter) + return target; +} + +size_t TransformationParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.TransformationParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 111u) { + // optional float scale = 1 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + // optional bool mirror = 2 [default = false]; + if (has_mirror()) { + total_size += 1 + 1; + } + + // optional uint32 crop_size = 3 [default = 0]; + if (has_crop_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->crop_size()); + } + + // optional string mean_file = 4; + if (has_mean_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->mean_file()); + } + + // optional bool force_color = 6 [default = false]; + if (has_force_color()) { + total_size += 1 + 1; + } + + // optional bool force_gray = 7 [default = false]; + if (has_force_gray()) { + total_size += 1 + 1; + } + + } + // repeated float mean_value = 5; + { + size_t data_size = 0; + unsigned int count = this->mean_value_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->mean_value_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TransformationParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.TransformationParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const TransformationParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.TransformationParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.TransformationParameter) + UnsafeMergeFrom(*source); + } +} + +void TransformationParameter::MergeFrom(const TransformationParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.TransformationParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void TransformationParameter::UnsafeMergeFrom(const TransformationParameter& from) { + GOOGLE_DCHECK(&from != this); + mean_value_.UnsafeMergeFrom(from.mean_value_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_mirror()) { + set_mirror(from.mirror()); + } + if (from.has_crop_size()) { + set_crop_size(from.crop_size()); + } + if (from.has_mean_file()) { + set_has_mean_file(); + mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_); + } + if (from.has_force_color()) { + set_force_color(from.force_color()); + } + if (from.has_force_gray()) { + set_force_gray(from.force_gray()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void TransformationParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.TransformationParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransformationParameter::CopyFrom(const TransformationParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.TransformationParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool TransformationParameter::IsInitialized() const { + + return true; +} + +void TransformationParameter::Swap(TransformationParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void TransformationParameter::InternalSwap(TransformationParameter* other) { + std::swap(scale_, other->scale_); + std::swap(mirror_, other->mirror_); + std::swap(crop_size_, other->crop_size_); + mean_file_.Swap(&other->mean_file_); + mean_value_.UnsafeArenaSwap(&other->mean_value_); + std::swap(force_color_, other->force_color_); + std::swap(force_gray_, other->force_gray_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata TransformationParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TransformationParameter_descriptor_; + metadata.reflection = TransformationParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// TransformationParameter + +// optional float scale = 1 [default = 1]; +bool TransformationParameter::has_scale() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void TransformationParameter::set_has_scale() { + _has_bits_[0] |= 0x00000001u; +} +void TransformationParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000001u; +} +void TransformationParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float TransformationParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.scale) + return scale_; +} +void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.scale) +} + +// optional bool mirror = 2 [default = false]; +bool TransformationParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void TransformationParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000002u; +} +void TransformationParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000002u; +} +void TransformationParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +bool TransformationParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.mirror) + return mirror_; +} +void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.mirror) +} + +// optional uint32 crop_size = 3 [default = 0]; +bool TransformationParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void TransformationParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000004u; +} +void TransformationParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000004u; +} +void TransformationParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +::google::protobuf::uint32 TransformationParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.crop_size) + return crop_size_; +} +void TransformationParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.crop_size) +} + +// optional string mean_file = 4; +bool TransformationParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void TransformationParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000008u; +} +void TransformationParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000008u; +} +void TransformationParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +const ::std::string& TransformationParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void TransformationParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.mean_file) +} +void TransformationParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.TransformationParameter.mean_file) +} +void TransformationParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.TransformationParameter.mean_file) +} +::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.TransformationParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* TransformationParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.TransformationParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void TransformationParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.TransformationParameter.mean_file) +} + +// repeated float mean_value = 5; +int TransformationParameter::mean_value_size() const { + return mean_value_.size(); +} +void TransformationParameter::clear_mean_value() { + mean_value_.Clear(); +} +float TransformationParameter::mean_value(int index) const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.mean_value) + return mean_value_.Get(index); +} +void TransformationParameter::set_mean_value(int index, float value) { + mean_value_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.mean_value) +} +void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:caffe.TransformationParameter.mean_value) +} +const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:caffe.TransformationParameter.mean_value) + return mean_value_; +} +::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:caffe.TransformationParameter.mean_value) + return &mean_value_; +} + +// optional bool force_color = 6 [default = false]; +bool TransformationParameter::has_force_color() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void TransformationParameter::set_has_force_color() { + _has_bits_[0] |= 0x00000020u; +} +void TransformationParameter::clear_has_force_color() { + _has_bits_[0] &= ~0x00000020u; +} +void TransformationParameter::clear_force_color() { + force_color_ = false; + clear_has_force_color(); +} +bool TransformationParameter::force_color() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.force_color) + return force_color_; +} +void TransformationParameter::set_force_color(bool value) { + set_has_force_color(); + force_color_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.force_color) +} + +// optional bool force_gray = 7 [default = false]; +bool TransformationParameter::has_force_gray() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void TransformationParameter::set_has_force_gray() { + _has_bits_[0] |= 0x00000040u; +} +void TransformationParameter::clear_has_force_gray() { + _has_bits_[0] &= ~0x00000040u; +} +void TransformationParameter::clear_force_gray() { + force_gray_ = false; + clear_has_force_gray(); +} +bool TransformationParameter::force_gray() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.force_gray) + return force_gray_; +} +void TransformationParameter::set_force_gray(bool value) { + set_has_force_gray(); + force_gray_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.force_gray) +} + +inline const TransformationParameter* TransformationParameter::internal_default_instance() { + return &TransformationParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* LossParameter_NormalizationMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LossParameter_NormalizationMode_descriptor_; +} +bool LossParameter_NormalizationMode_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LossParameter_NormalizationMode LossParameter::FULL; +const LossParameter_NormalizationMode LossParameter::VALID; +const LossParameter_NormalizationMode LossParameter::BATCH_SIZE; +const LossParameter_NormalizationMode LossParameter::NONE; +const LossParameter_NormalizationMode LossParameter::NormalizationMode_MIN; +const LossParameter_NormalizationMode LossParameter::NormalizationMode_MAX; +const int LossParameter::NormalizationMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LossParameter::kIgnoreLabelFieldNumber; +const int LossParameter::kNormalizationFieldNumber; +const int LossParameter::kNormalizeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LossParameter::LossParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.LossParameter) +} + +void LossParameter::InitAsDefaultInstance() { +} + +LossParameter::LossParameter(const LossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.LossParameter) +} + +void LossParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&ignore_label_, 0, reinterpret_cast(&normalize_) - + reinterpret_cast(&ignore_label_) + sizeof(normalize_)); + normalization_ = 1; +} + +LossParameter::~LossParameter() { + // @@protoc_insertion_point(destructor:caffe.LossParameter) + SharedDtor(); +} + +void LossParameter::SharedDtor() { +} + +void LossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LossParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LossParameter_descriptor_; +} + +const LossParameter& LossParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed LossParameter_default_instance_; + +LossParameter* LossParameter::New(::google::protobuf::Arena* arena) const { + LossParameter* n = new LossParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void LossParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.LossParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(LossParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 7u) { + ZR_(ignore_label_, normalize_); + normalization_ = 1; + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool LossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.LossParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 ignore_label = 1; + case 1: { + if (tag == 8) { + set_has_ignore_label(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_normalize; + break; + } + + // optional bool normalize = 2; + case 2: { + if (tag == 16) { + parse_normalize: + set_has_normalize(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_normalization; + break; + } + + // optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + case 3: { + if (tag == 24) { + parse_normalization: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::LossParameter_NormalizationMode_IsValid(value)) { + set_normalization(static_cast< ::caffe::LossParameter_NormalizationMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(3, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.LossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.LossParameter) + return false; +#undef DO_ +} + +void LossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.LossParameter) + // optional int32 ignore_label = 1; + if (has_ignore_label()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ignore_label(), output); + } + + // optional bool normalize = 2; + if (has_normalize()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->normalize(), output); + } + + // optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->normalization(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.LossParameter) +} + +::google::protobuf::uint8* LossParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.LossParameter) + // optional int32 ignore_label = 1; + if (has_ignore_label()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ignore_label(), target); + } + + // optional bool normalize = 2; + if (has_normalize()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->normalize(), target); + } + + // optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->normalization(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.LossParameter) + return target; +} + +size_t LossParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.LossParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional int32 ignore_label = 1; + if (has_ignore_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->ignore_label()); + } + + // optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->normalization()); + } + + // optional bool normalize = 2; + if (has_normalize()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.LossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const LossParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.LossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.LossParameter) + UnsafeMergeFrom(*source); + } +} + +void LossParameter::MergeFrom(const LossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.LossParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void LossParameter::UnsafeMergeFrom(const LossParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_ignore_label()) { + set_ignore_label(from.ignore_label()); + } + if (from.has_normalization()) { + set_normalization(from.normalization()); + } + if (from.has_normalize()) { + set_normalize(from.normalize()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void LossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.LossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LossParameter::CopyFrom(const LossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.LossParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool LossParameter::IsInitialized() const { + + return true; +} + +void LossParameter::Swap(LossParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void LossParameter::InternalSwap(LossParameter* other) { + std::swap(ignore_label_, other->ignore_label_); + std::swap(normalization_, other->normalization_); + std::swap(normalize_, other->normalize_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata LossParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LossParameter_descriptor_; + metadata.reflection = LossParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// LossParameter + +// optional int32 ignore_label = 1; +bool LossParameter::has_ignore_label() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void LossParameter::set_has_ignore_label() { + _has_bits_[0] |= 0x00000001u; +} +void LossParameter::clear_has_ignore_label() { + _has_bits_[0] &= ~0x00000001u; +} +void LossParameter::clear_ignore_label() { + ignore_label_ = 0; + clear_has_ignore_label(); +} +::google::protobuf::int32 LossParameter::ignore_label() const { + // @@protoc_insertion_point(field_get:caffe.LossParameter.ignore_label) + return ignore_label_; +} +void LossParameter::set_ignore_label(::google::protobuf::int32 value) { + set_has_ignore_label(); + ignore_label_ = value; + // @@protoc_insertion_point(field_set:caffe.LossParameter.ignore_label) +} + +// optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; +bool LossParameter::has_normalization() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void LossParameter::set_has_normalization() { + _has_bits_[0] |= 0x00000002u; +} +void LossParameter::clear_has_normalization() { + _has_bits_[0] &= ~0x00000002u; +} +void LossParameter::clear_normalization() { + normalization_ = 1; + clear_has_normalization(); +} +::caffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:caffe.LossParameter.normalization) + return static_cast< ::caffe::LossParameter_NormalizationMode >(normalization_); +} +void LossParameter::set_normalization(::caffe::LossParameter_NormalizationMode value) { + assert(::caffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:caffe.LossParameter.normalization) +} + +// optional bool normalize = 2; +bool LossParameter::has_normalize() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void LossParameter::set_has_normalize() { + _has_bits_[0] |= 0x00000004u; +} +void LossParameter::clear_has_normalize() { + _has_bits_[0] &= ~0x00000004u; +} +void LossParameter::clear_normalize() { + normalize_ = false; + clear_has_normalize(); +} +bool LossParameter::normalize() const { + // @@protoc_insertion_point(field_get:caffe.LossParameter.normalize) + return normalize_; +} +void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:caffe.LossParameter.normalize) +} + +inline const LossParameter* LossParameter::internal_default_instance() { + return &LossParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AccuracyParameter::kTopKFieldNumber; +const int AccuracyParameter::kAxisFieldNumber; +const int AccuracyParameter::kIgnoreLabelFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AccuracyParameter::AccuracyParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.AccuracyParameter) +} + +void AccuracyParameter::InitAsDefaultInstance() { +} + +AccuracyParameter::AccuracyParameter(const AccuracyParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.AccuracyParameter) +} + +void AccuracyParameter::SharedCtor() { + _cached_size_ = 0; + ignore_label_ = 0; + top_k_ = 1u; + axis_ = 1; +} + +AccuracyParameter::~AccuracyParameter() { + // @@protoc_insertion_point(destructor:caffe.AccuracyParameter) + SharedDtor(); +} + +void AccuracyParameter::SharedDtor() { +} + +void AccuracyParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* AccuracyParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return AccuracyParameter_descriptor_; +} + +const AccuracyParameter& AccuracyParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed AccuracyParameter_default_instance_; + +AccuracyParameter* AccuracyParameter::New(::google::protobuf::Arena* arena) const { + AccuracyParameter* n = new AccuracyParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void AccuracyParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.AccuracyParameter) + if (_has_bits_[0 / 32] & 7u) { + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool AccuracyParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.AccuracyParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 top_k = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_top_k(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_axis; + break; + } + + // optional int32 axis = 2 [default = 1]; + case 2: { + if (tag == 16) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_ignore_label; + break; + } + + // optional int32 ignore_label = 3; + case 3: { + if (tag == 24) { + parse_ignore_label: + set_has_ignore_label(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.AccuracyParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.AccuracyParameter) + return false; +#undef DO_ +} + +void AccuracyParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.AccuracyParameter) + // optional uint32 top_k = 1 [default = 1]; + if (has_top_k()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->top_k(), output); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output); + } + + // optional int32 ignore_label = 3; + if (has_ignore_label()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->ignore_label(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.AccuracyParameter) +} + +::google::protobuf::uint8* AccuracyParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.AccuracyParameter) + // optional uint32 top_k = 1 [default = 1]; + if (has_top_k()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->top_k(), target); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target); + } + + // optional int32 ignore_label = 3; + if (has_ignore_label()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->ignore_label(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.AccuracyParameter) + return target; +} + +size_t AccuracyParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.AccuracyParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional uint32 top_k = 1 [default = 1]; + if (has_top_k()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->top_k()); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional int32 ignore_label = 3; + if (has_ignore_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->ignore_label()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AccuracyParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.AccuracyParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const AccuracyParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.AccuracyParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.AccuracyParameter) + UnsafeMergeFrom(*source); + } +} + +void AccuracyParameter::MergeFrom(const AccuracyParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.AccuracyParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void AccuracyParameter::UnsafeMergeFrom(const AccuracyParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_top_k()) { + set_top_k(from.top_k()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_ignore_label()) { + set_ignore_label(from.ignore_label()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void AccuracyParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.AccuracyParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AccuracyParameter::CopyFrom(const AccuracyParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.AccuracyParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool AccuracyParameter::IsInitialized() const { + + return true; +} + +void AccuracyParameter::Swap(AccuracyParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void AccuracyParameter::InternalSwap(AccuracyParameter* other) { + std::swap(top_k_, other->top_k_); + std::swap(axis_, other->axis_); + std::swap(ignore_label_, other->ignore_label_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata AccuracyParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = AccuracyParameter_descriptor_; + metadata.reflection = AccuracyParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// AccuracyParameter + +// optional uint32 top_k = 1 [default = 1]; +bool AccuracyParameter::has_top_k() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void AccuracyParameter::set_has_top_k() { + _has_bits_[0] |= 0x00000001u; +} +void AccuracyParameter::clear_has_top_k() { + _has_bits_[0] &= ~0x00000001u; +} +void AccuracyParameter::clear_top_k() { + top_k_ = 1u; + clear_has_top_k(); +} +::google::protobuf::uint32 AccuracyParameter::top_k() const { + // @@protoc_insertion_point(field_get:caffe.AccuracyParameter.top_k) + return top_k_; +} +void AccuracyParameter::set_top_k(::google::protobuf::uint32 value) { + set_has_top_k(); + top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.AccuracyParameter.top_k) +} + +// optional int32 axis = 2 [default = 1]; +bool AccuracyParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void AccuracyParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +void AccuracyParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +void AccuracyParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 AccuracyParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.AccuracyParameter.axis) + return axis_; +} +void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.AccuracyParameter.axis) +} + +// optional int32 ignore_label = 3; +bool AccuracyParameter::has_ignore_label() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void AccuracyParameter::set_has_ignore_label() { + _has_bits_[0] |= 0x00000004u; +} +void AccuracyParameter::clear_has_ignore_label() { + _has_bits_[0] &= ~0x00000004u; +} +void AccuracyParameter::clear_ignore_label() { + ignore_label_ = 0; + clear_has_ignore_label(); +} +::google::protobuf::int32 AccuracyParameter::ignore_label() const { + // @@protoc_insertion_point(field_get:caffe.AccuracyParameter.ignore_label) + return ignore_label_; +} +void AccuracyParameter::set_ignore_label(::google::protobuf::int32 value) { + set_has_ignore_label(); + ignore_label_ = value; + // @@protoc_insertion_point(field_set:caffe.AccuracyParameter.ignore_label) +} + +inline const AccuracyParameter* AccuracyParameter::internal_default_instance() { + return &AccuracyParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ArgMaxParameter::kOutMaxValFieldNumber; +const int ArgMaxParameter::kTopKFieldNumber; +const int ArgMaxParameter::kAxisFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ArgMaxParameter::ArgMaxParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ArgMaxParameter) +} + +void ArgMaxParameter::InitAsDefaultInstance() { +} + +ArgMaxParameter::ArgMaxParameter(const ArgMaxParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ArgMaxParameter) +} + +void ArgMaxParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&out_max_val_, 0, reinterpret_cast(&axis_) - + reinterpret_cast(&out_max_val_) + sizeof(axis_)); + top_k_ = 1u; +} + +ArgMaxParameter::~ArgMaxParameter() { + // @@protoc_insertion_point(destructor:caffe.ArgMaxParameter) + SharedDtor(); +} + +void ArgMaxParameter::SharedDtor() { +} + +void ArgMaxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ArgMaxParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ArgMaxParameter_descriptor_; +} + +const ArgMaxParameter& ArgMaxParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ArgMaxParameter_default_instance_; + +ArgMaxParameter* ArgMaxParameter::New(::google::protobuf::Arena* arena) const { + ArgMaxParameter* n = new ArgMaxParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ArgMaxParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ArgMaxParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(ArgMaxParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 7u) { + ZR_(out_max_val_, axis_); + top_k_ = 1u; + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ArgMaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ArgMaxParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool out_max_val = 1 [default = false]; + case 1: { + if (tag == 8) { + set_has_out_max_val(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &out_max_val_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_top_k; + break; + } + + // optional uint32 top_k = 2 [default = 1]; + case 2: { + if (tag == 16) { + parse_top_k: + set_has_top_k(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_axis; + break; + } + + // optional int32 axis = 3; + case 3: { + if (tag == 24) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ArgMaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ArgMaxParameter) + return false; +#undef DO_ +} + +void ArgMaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ArgMaxParameter) + // optional bool out_max_val = 1 [default = false]; + if (has_out_max_val()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->out_max_val(), output); + } + + // optional uint32 top_k = 2 [default = 1]; + if (has_top_k()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->top_k(), output); + } + + // optional int32 axis = 3; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->axis(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ArgMaxParameter) +} + +::google::protobuf::uint8* ArgMaxParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ArgMaxParameter) + // optional bool out_max_val = 1 [default = false]; + if (has_out_max_val()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->out_max_val(), target); + } + + // optional uint32 top_k = 2 [default = 1]; + if (has_top_k()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->top_k(), target); + } + + // optional int32 axis = 3; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->axis(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ArgMaxParameter) + return target; +} + +size_t ArgMaxParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ArgMaxParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional bool out_max_val = 1 [default = false]; + if (has_out_max_val()) { + total_size += 1 + 1; + } + + // optional uint32 top_k = 2 [default = 1]; + if (has_top_k()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->top_k()); + } + + // optional int32 axis = 3; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ArgMaxParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ArgMaxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ArgMaxParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ArgMaxParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ArgMaxParameter) + UnsafeMergeFrom(*source); + } +} + +void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ArgMaxParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ArgMaxParameter::UnsafeMergeFrom(const ArgMaxParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_out_max_val()) { + set_out_max_val(from.out_max_val()); + } + if (from.has_top_k()) { + set_top_k(from.top_k()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ArgMaxParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ArgMaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ArgMaxParameter::CopyFrom(const ArgMaxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ArgMaxParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ArgMaxParameter::IsInitialized() const { + + return true; +} + +void ArgMaxParameter::Swap(ArgMaxParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ArgMaxParameter::InternalSwap(ArgMaxParameter* other) { + std::swap(out_max_val_, other->out_max_val_); + std::swap(top_k_, other->top_k_); + std::swap(axis_, other->axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ArgMaxParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ArgMaxParameter_descriptor_; + metadata.reflection = ArgMaxParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ArgMaxParameter + +// optional bool out_max_val = 1 [default = false]; +bool ArgMaxParameter::has_out_max_val() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ArgMaxParameter::set_has_out_max_val() { + _has_bits_[0] |= 0x00000001u; +} +void ArgMaxParameter::clear_has_out_max_val() { + _has_bits_[0] &= ~0x00000001u; +} +void ArgMaxParameter::clear_out_max_val() { + out_max_val_ = false; + clear_has_out_max_val(); +} +bool ArgMaxParameter::out_max_val() const { + // @@protoc_insertion_point(field_get:caffe.ArgMaxParameter.out_max_val) + return out_max_val_; +} +void ArgMaxParameter::set_out_max_val(bool value) { + set_has_out_max_val(); + out_max_val_ = value; + // @@protoc_insertion_point(field_set:caffe.ArgMaxParameter.out_max_val) +} + +// optional uint32 top_k = 2 [default = 1]; +bool ArgMaxParameter::has_top_k() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ArgMaxParameter::set_has_top_k() { + _has_bits_[0] |= 0x00000002u; +} +void ArgMaxParameter::clear_has_top_k() { + _has_bits_[0] &= ~0x00000002u; +} +void ArgMaxParameter::clear_top_k() { + top_k_ = 1u; + clear_has_top_k(); +} +::google::protobuf::uint32 ArgMaxParameter::top_k() const { + // @@protoc_insertion_point(field_get:caffe.ArgMaxParameter.top_k) + return top_k_; +} +void ArgMaxParameter::set_top_k(::google::protobuf::uint32 value) { + set_has_top_k(); + top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.ArgMaxParameter.top_k) +} + +// optional int32 axis = 3; +bool ArgMaxParameter::has_axis() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ArgMaxParameter::set_has_axis() { + _has_bits_[0] |= 0x00000004u; +} +void ArgMaxParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000004u; +} +void ArgMaxParameter::clear_axis() { + axis_ = 0; + clear_has_axis(); +} +::google::protobuf::int32 ArgMaxParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ArgMaxParameter.axis) + return axis_; +} +void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ArgMaxParameter.axis) +} + +inline const ArgMaxParameter* ArgMaxParameter::internal_default_instance() { + return &ArgMaxParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ConcatParameter::kAxisFieldNumber; +const int ConcatParameter::kConcatDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ConcatParameter::ConcatParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ConcatParameter) +} + +void ConcatParameter::InitAsDefaultInstance() { +} + +ConcatParameter::ConcatParameter(const ConcatParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ConcatParameter) +} + +void ConcatParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + concat_dim_ = 1u; +} + +ConcatParameter::~ConcatParameter() { + // @@protoc_insertion_point(destructor:caffe.ConcatParameter) + SharedDtor(); +} + +void ConcatParameter::SharedDtor() { +} + +void ConcatParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ConcatParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ConcatParameter_descriptor_; +} + +const ConcatParameter& ConcatParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ConcatParameter_default_instance_; + +ConcatParameter* ConcatParameter::New(::google::protobuf::Arena* arena) const { + ConcatParameter* n = new ConcatParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ConcatParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ConcatParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + concat_dim_ = 1u; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ConcatParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ConcatParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 concat_dim = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_concat_dim(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_axis; + break; + } + + // optional int32 axis = 2 [default = 1]; + case 2: { + if (tag == 16) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ConcatParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ConcatParameter) + return false; +#undef DO_ +} + +void ConcatParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ConcatParameter) + // optional uint32 concat_dim = 1 [default = 1]; + if (has_concat_dim()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->concat_dim(), output); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ConcatParameter) +} + +::google::protobuf::uint8* ConcatParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ConcatParameter) + // optional uint32 concat_dim = 1 [default = 1]; + if (has_concat_dim()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->concat_dim(), target); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ConcatParameter) + return target; +} + +size_t ConcatParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ConcatParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional uint32 concat_dim = 1 [default = 1]; + if (has_concat_dim()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->concat_dim()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConcatParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ConcatParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ConcatParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ConcatParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ConcatParameter) + UnsafeMergeFrom(*source); + } +} + +void ConcatParameter::MergeFrom(const ConcatParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ConcatParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ConcatParameter::UnsafeMergeFrom(const ConcatParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_concat_dim()) { + set_concat_dim(from.concat_dim()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ConcatParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ConcatParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConcatParameter::CopyFrom(const ConcatParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ConcatParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ConcatParameter::IsInitialized() const { + + return true; +} + +void ConcatParameter::Swap(ConcatParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ConcatParameter::InternalSwap(ConcatParameter* other) { + std::swap(axis_, other->axis_); + std::swap(concat_dim_, other->concat_dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ConcatParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ConcatParameter_descriptor_; + metadata.reflection = ConcatParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ConcatParameter + +// optional int32 axis = 2 [default = 1]; +bool ConcatParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ConcatParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void ConcatParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void ConcatParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 ConcatParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ConcatParameter.axis) + return axis_; +} +void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ConcatParameter.axis) +} + +// optional uint32 concat_dim = 1 [default = 1]; +bool ConcatParameter::has_concat_dim() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ConcatParameter::set_has_concat_dim() { + _has_bits_[0] |= 0x00000002u; +} +void ConcatParameter::clear_has_concat_dim() { + _has_bits_[0] &= ~0x00000002u; +} +void ConcatParameter::clear_concat_dim() { + concat_dim_ = 1u; + clear_has_concat_dim(); +} +::google::protobuf::uint32 ConcatParameter::concat_dim() const { + // @@protoc_insertion_point(field_get:caffe.ConcatParameter.concat_dim) + return concat_dim_; +} +void ConcatParameter::set_concat_dim(::google::protobuf::uint32 value) { + set_has_concat_dim(); + concat_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.ConcatParameter.concat_dim) +} + +inline const ConcatParameter* ConcatParameter::internal_default_instance() { + return &ConcatParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BatchNormParameter::kUseGlobalStatsFieldNumber; +const int BatchNormParameter::kMovingAverageFractionFieldNumber; +const int BatchNormParameter::kEpsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BatchNormParameter::BatchNormParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.BatchNormParameter) +} + +void BatchNormParameter::InitAsDefaultInstance() { +} + +BatchNormParameter::BatchNormParameter(const BatchNormParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.BatchNormParameter) +} + +void BatchNormParameter::SharedCtor() { + _cached_size_ = 0; + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; +} + +BatchNormParameter::~BatchNormParameter() { + // @@protoc_insertion_point(destructor:caffe.BatchNormParameter) + SharedDtor(); +} + +void BatchNormParameter::SharedDtor() { +} + +void BatchNormParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BatchNormParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BatchNormParameter_descriptor_; +} + +const BatchNormParameter& BatchNormParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed BatchNormParameter_default_instance_; + +BatchNormParameter* BatchNormParameter::New(::google::protobuf::Arena* arena) const { + BatchNormParameter* n = new BatchNormParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void BatchNormParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.BatchNormParameter) + if (_has_bits_[0 / 32] & 7u) { + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool BatchNormParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.BatchNormParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool use_global_stats = 1; + case 1: { + if (tag == 8) { + set_has_use_global_stats(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_global_stats_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_moving_average_fraction; + break; + } + + // optional float moving_average_fraction = 2 [default = 0.999]; + case 2: { + if (tag == 21) { + parse_moving_average_fraction: + set_has_moving_average_fraction(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &moving_average_fraction_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_eps; + break; + } + + // optional float eps = 3 [default = 1e-05]; + case 3: { + if (tag == 29) { + parse_eps: + set_has_eps(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.BatchNormParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.BatchNormParameter) + return false; +#undef DO_ +} + +void BatchNormParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.BatchNormParameter) + // optional bool use_global_stats = 1; + if (has_use_global_stats()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->use_global_stats(), output); + } + + // optional float moving_average_fraction = 2 [default = 0.999]; + if (has_moving_average_fraction()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->moving_average_fraction(), output); + } + + // optional float eps = 3 [default = 1e-05]; + if (has_eps()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->eps(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.BatchNormParameter) +} + +::google::protobuf::uint8* BatchNormParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.BatchNormParameter) + // optional bool use_global_stats = 1; + if (has_use_global_stats()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->use_global_stats(), target); + } + + // optional float moving_average_fraction = 2 [default = 0.999]; + if (has_moving_average_fraction()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->moving_average_fraction(), target); + } + + // optional float eps = 3 [default = 1e-05]; + if (has_eps()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->eps(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.BatchNormParameter) + return target; +} + +size_t BatchNormParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.BatchNormParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional bool use_global_stats = 1; + if (has_use_global_stats()) { + total_size += 1 + 1; + } + + // optional float moving_average_fraction = 2 [default = 0.999]; + if (has_moving_average_fraction()) { + total_size += 1 + 4; + } + + // optional float eps = 3 [default = 1e-05]; + if (has_eps()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BatchNormParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.BatchNormParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const BatchNormParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.BatchNormParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.BatchNormParameter) + UnsafeMergeFrom(*source); + } +} + +void BatchNormParameter::MergeFrom(const BatchNormParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.BatchNormParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void BatchNormParameter::UnsafeMergeFrom(const BatchNormParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_use_global_stats()) { + set_use_global_stats(from.use_global_stats()); + } + if (from.has_moving_average_fraction()) { + set_moving_average_fraction(from.moving_average_fraction()); + } + if (from.has_eps()) { + set_eps(from.eps()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void BatchNormParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.BatchNormParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BatchNormParameter::CopyFrom(const BatchNormParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.BatchNormParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool BatchNormParameter::IsInitialized() const { + + return true; +} + +void BatchNormParameter::Swap(BatchNormParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void BatchNormParameter::InternalSwap(BatchNormParameter* other) { + std::swap(use_global_stats_, other->use_global_stats_); + std::swap(moving_average_fraction_, other->moving_average_fraction_); + std::swap(eps_, other->eps_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata BatchNormParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BatchNormParameter_descriptor_; + metadata.reflection = BatchNormParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BatchNormParameter + +// optional bool use_global_stats = 1; +bool BatchNormParameter::has_use_global_stats() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void BatchNormParameter::set_has_use_global_stats() { + _has_bits_[0] |= 0x00000001u; +} +void BatchNormParameter::clear_has_use_global_stats() { + _has_bits_[0] &= ~0x00000001u; +} +void BatchNormParameter::clear_use_global_stats() { + use_global_stats_ = false; + clear_has_use_global_stats(); +} +bool BatchNormParameter::use_global_stats() const { + // @@protoc_insertion_point(field_get:caffe.BatchNormParameter.use_global_stats) + return use_global_stats_; +} +void BatchNormParameter::set_use_global_stats(bool value) { + set_has_use_global_stats(); + use_global_stats_ = value; + // @@protoc_insertion_point(field_set:caffe.BatchNormParameter.use_global_stats) +} + +// optional float moving_average_fraction = 2 [default = 0.999]; +bool BatchNormParameter::has_moving_average_fraction() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void BatchNormParameter::set_has_moving_average_fraction() { + _has_bits_[0] |= 0x00000002u; +} +void BatchNormParameter::clear_has_moving_average_fraction() { + _has_bits_[0] &= ~0x00000002u; +} +void BatchNormParameter::clear_moving_average_fraction() { + moving_average_fraction_ = 0.999f; + clear_has_moving_average_fraction(); +} +float BatchNormParameter::moving_average_fraction() const { + // @@protoc_insertion_point(field_get:caffe.BatchNormParameter.moving_average_fraction) + return moving_average_fraction_; +} +void BatchNormParameter::set_moving_average_fraction(float value) { + set_has_moving_average_fraction(); + moving_average_fraction_ = value; + // @@protoc_insertion_point(field_set:caffe.BatchNormParameter.moving_average_fraction) +} + +// optional float eps = 3 [default = 1e-05]; +bool BatchNormParameter::has_eps() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void BatchNormParameter::set_has_eps() { + _has_bits_[0] |= 0x00000004u; +} +void BatchNormParameter::clear_has_eps() { + _has_bits_[0] &= ~0x00000004u; +} +void BatchNormParameter::clear_eps() { + eps_ = 1e-05f; + clear_has_eps(); +} +float BatchNormParameter::eps() const { + // @@protoc_insertion_point(field_get:caffe.BatchNormParameter.eps) + return eps_; +} +void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:caffe.BatchNormParameter.eps) +} + +inline const BatchNormParameter* BatchNormParameter::internal_default_instance() { + return &BatchNormParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BiasParameter::kAxisFieldNumber; +const int BiasParameter::kNumAxesFieldNumber; +const int BiasParameter::kFillerFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BiasParameter::BiasParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.BiasParameter) +} + +void BiasParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +BiasParameter::BiasParameter(const BiasParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.BiasParameter) +} + +void BiasParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + axis_ = 1; + num_axes_ = 1; +} + +BiasParameter::~BiasParameter() { + // @@protoc_insertion_point(destructor:caffe.BiasParameter) + SharedDtor(); +} + +void BiasParameter::SharedDtor() { + if (this != &BiasParameter_default_instance_.get()) { + delete filler_; + } +} + +void BiasParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BiasParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BiasParameter_descriptor_; +} + +const BiasParameter& BiasParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed BiasParameter_default_instance_; + +BiasParameter* BiasParameter::New(::google::protobuf::Arena* arena) const { + BiasParameter* n = new BiasParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void BiasParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.BiasParameter) + if (_has_bits_[0 / 32] & 7u) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + } + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool BiasParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.BiasParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 axis = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_num_axes; + break; + } + + // optional int32 num_axes = 2 [default = 1]; + case 2: { + if (tag == 16) { + parse_num_axes: + set_has_num_axes(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .caffe.FillerParameter filler = 3; + case 3: { + if (tag == 26) { + parse_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.BiasParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.BiasParameter) + return false; +#undef DO_ +} + +void BiasParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.BiasParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output); + } + + // optional int32 num_axes = 2 [default = 1]; + if (has_num_axes()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_axes(), output); + } + + // optional .caffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->filler_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.BiasParameter) +} + +::google::protobuf::uint8* BiasParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.BiasParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target); + } + + // optional int32 num_axes = 2 [default = 1]; + if (has_num_axes()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_axes(), target); + } + + // optional .caffe.FillerParameter filler = 3; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *this->filler_, false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.BiasParameter) + return target; +} + +size_t BiasParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.BiasParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional int32 num_axes = 2 [default = 1]; + if (has_num_axes()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_axes()); + } + + // optional .caffe.FillerParameter filler = 3; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->filler_); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BiasParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.BiasParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const BiasParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.BiasParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.BiasParameter) + UnsafeMergeFrom(*source); + } +} + +void BiasParameter::MergeFrom(const BiasParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.BiasParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void BiasParameter::UnsafeMergeFrom(const BiasParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_num_axes()) { + set_num_axes(from.num_axes()); + } + if (from.has_filler()) { + mutable_filler()->::caffe::FillerParameter::MergeFrom(from.filler()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void BiasParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.BiasParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BiasParameter::CopyFrom(const BiasParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.BiasParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool BiasParameter::IsInitialized() const { + + return true; +} + +void BiasParameter::Swap(BiasParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void BiasParameter::InternalSwap(BiasParameter* other) { + std::swap(axis_, other->axis_); + std::swap(num_axes_, other->num_axes_); + std::swap(filler_, other->filler_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata BiasParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BiasParameter_descriptor_; + metadata.reflection = BiasParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BiasParameter + +// optional int32 axis = 1 [default = 1]; +bool BiasParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void BiasParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void BiasParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void BiasParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 BiasParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.BiasParameter.axis) + return axis_; +} +void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.BiasParameter.axis) +} + +// optional int32 num_axes = 2 [default = 1]; +bool BiasParameter::has_num_axes() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void BiasParameter::set_has_num_axes() { + _has_bits_[0] |= 0x00000002u; +} +void BiasParameter::clear_has_num_axes() { + _has_bits_[0] &= ~0x00000002u; +} +void BiasParameter::clear_num_axes() { + num_axes_ = 1; + clear_has_num_axes(); +} +::google::protobuf::int32 BiasParameter::num_axes() const { + // @@protoc_insertion_point(field_get:caffe.BiasParameter.num_axes) + return num_axes_; +} +void BiasParameter::set_num_axes(::google::protobuf::int32 value) { + set_has_num_axes(); + num_axes_ = value; + // @@protoc_insertion_point(field_set:caffe.BiasParameter.num_axes) +} + +// optional .caffe.FillerParameter filler = 3; +bool BiasParameter::has_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void BiasParameter::set_has_filler() { + _has_bits_[0] |= 0x00000004u; +} +void BiasParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000004u; +} +void BiasParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::caffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:caffe.BiasParameter.filler) + return filler_ != NULL ? *filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.BiasParameter.filler) + return filler_; +} +::caffe::FillerParameter* BiasParameter::release_filler() { + // @@protoc_insertion_point(field_release:caffe.BiasParameter.filler) + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void BiasParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.BiasParameter.filler) +} + +inline const BiasParameter* BiasParameter::internal_default_instance() { + return &BiasParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ContrastiveLossParameter::kMarginFieldNumber; +const int ContrastiveLossParameter::kLegacyVersionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ContrastiveLossParameter::ContrastiveLossParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::InitAsDefaultInstance() { +} + +ContrastiveLossParameter::ContrastiveLossParameter(const ContrastiveLossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::SharedCtor() { + _cached_size_ = 0; + legacy_version_ = false; + margin_ = 1; +} + +ContrastiveLossParameter::~ContrastiveLossParameter() { + // @@protoc_insertion_point(destructor:caffe.ContrastiveLossParameter) + SharedDtor(); +} + +void ContrastiveLossParameter::SharedDtor() { +} + +void ContrastiveLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ContrastiveLossParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ContrastiveLossParameter_descriptor_; +} + +const ContrastiveLossParameter& ContrastiveLossParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ContrastiveLossParameter_default_instance_; + +ContrastiveLossParameter* ContrastiveLossParameter::New(::google::protobuf::Arena* arena) const { + ContrastiveLossParameter* n = new ContrastiveLossParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ContrastiveLossParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ContrastiveLossParameter) + if (_has_bits_[0 / 32] & 3u) { + margin_ = 1; + legacy_version_ = false; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ContrastiveLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ContrastiveLossParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float margin = 1 [default = 1]; + case 1: { + if (tag == 13) { + set_has_margin(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &margin_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_legacy_version; + break; + } + + // optional bool legacy_version = 2 [default = false]; + case 2: { + if (tag == 16) { + parse_legacy_version: + set_has_legacy_version(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &legacy_version_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ContrastiveLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ContrastiveLossParameter) + return false; +#undef DO_ +} + +void ContrastiveLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ContrastiveLossParameter) + // optional float margin = 1 [default = 1]; + if (has_margin()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->margin(), output); + } + + // optional bool legacy_version = 2 [default = false]; + if (has_legacy_version()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->legacy_version(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ContrastiveLossParameter) +} + +::google::protobuf::uint8* ContrastiveLossParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ContrastiveLossParameter) + // optional float margin = 1 [default = 1]; + if (has_margin()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->margin(), target); + } + + // optional bool legacy_version = 2 [default = false]; + if (has_legacy_version()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->legacy_version(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ContrastiveLossParameter) + return target; +} + +size_t ContrastiveLossParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ContrastiveLossParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional float margin = 1 [default = 1]; + if (has_margin()) { + total_size += 1 + 4; + } + + // optional bool legacy_version = 2 [default = false]; + if (has_legacy_version()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ContrastiveLossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ContrastiveLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ContrastiveLossParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ContrastiveLossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ContrastiveLossParameter) + UnsafeMergeFrom(*source); + } +} + +void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ContrastiveLossParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ContrastiveLossParameter::UnsafeMergeFrom(const ContrastiveLossParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_margin()) { + set_margin(from.margin()); + } + if (from.has_legacy_version()) { + set_legacy_version(from.legacy_version()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ContrastiveLossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ContrastiveLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ContrastiveLossParameter::CopyFrom(const ContrastiveLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ContrastiveLossParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ContrastiveLossParameter::IsInitialized() const { + + return true; +} + +void ContrastiveLossParameter::Swap(ContrastiveLossParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ContrastiveLossParameter::InternalSwap(ContrastiveLossParameter* other) { + std::swap(margin_, other->margin_); + std::swap(legacy_version_, other->legacy_version_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ContrastiveLossParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ContrastiveLossParameter_descriptor_; + metadata.reflection = ContrastiveLossParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ContrastiveLossParameter + +// optional float margin = 1 [default = 1]; +bool ContrastiveLossParameter::has_margin() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ContrastiveLossParameter::set_has_margin() { + _has_bits_[0] |= 0x00000001u; +} +void ContrastiveLossParameter::clear_has_margin() { + _has_bits_[0] &= ~0x00000001u; +} +void ContrastiveLossParameter::clear_margin() { + margin_ = 1; + clear_has_margin(); +} +float ContrastiveLossParameter::margin() const { + // @@protoc_insertion_point(field_get:caffe.ContrastiveLossParameter.margin) + return margin_; +} +void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:caffe.ContrastiveLossParameter.margin) +} + +// optional bool legacy_version = 2 [default = false]; +bool ContrastiveLossParameter::has_legacy_version() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ContrastiveLossParameter::set_has_legacy_version() { + _has_bits_[0] |= 0x00000002u; +} +void ContrastiveLossParameter::clear_has_legacy_version() { + _has_bits_[0] &= ~0x00000002u; +} +void ContrastiveLossParameter::clear_legacy_version() { + legacy_version_ = false; + clear_has_legacy_version(); +} +bool ContrastiveLossParameter::legacy_version() const { + // @@protoc_insertion_point(field_get:caffe.ContrastiveLossParameter.legacy_version) + return legacy_version_; +} +void ContrastiveLossParameter::set_legacy_version(bool value) { + set_has_legacy_version(); + legacy_version_ = value; + // @@protoc_insertion_point(field_set:caffe.ContrastiveLossParameter.legacy_version) +} + +inline const ContrastiveLossParameter* ContrastiveLossParameter::internal_default_instance() { + return &ContrastiveLossParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* ConvolutionParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ConvolutionParameter_Engine_descriptor_; +} +bool ConvolutionParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const ConvolutionParameter_Engine ConvolutionParameter::DEFAULT; +const ConvolutionParameter_Engine ConvolutionParameter::CAFFE; +const ConvolutionParameter_Engine ConvolutionParameter::CUDNN; +const ConvolutionParameter_Engine ConvolutionParameter::Engine_MIN; +const ConvolutionParameter_Engine ConvolutionParameter::Engine_MAX; +const int ConvolutionParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ConvolutionParameter::kNumOutputFieldNumber; +const int ConvolutionParameter::kBiasTermFieldNumber; +const int ConvolutionParameter::kPadFieldNumber; +const int ConvolutionParameter::kKernelSizeFieldNumber; +const int ConvolutionParameter::kStrideFieldNumber; +const int ConvolutionParameter::kDilationFieldNumber; +const int ConvolutionParameter::kPadHFieldNumber; +const int ConvolutionParameter::kPadWFieldNumber; +const int ConvolutionParameter::kKernelHFieldNumber; +const int ConvolutionParameter::kKernelWFieldNumber; +const int ConvolutionParameter::kStrideHFieldNumber; +const int ConvolutionParameter::kStrideWFieldNumber; +const int ConvolutionParameter::kGroupFieldNumber; +const int ConvolutionParameter::kWeightFillerFieldNumber; +const int ConvolutionParameter::kBiasFillerFieldNumber; +const int ConvolutionParameter::kEngineFieldNumber; +const int ConvolutionParameter::kAxisFieldNumber; +const int ConvolutionParameter::kForceNdIm2ColFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ConvolutionParameter::ConvolutionParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ConvolutionParameter) +} + +void ConvolutionParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + bias_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ConvolutionParameter) +} + +void ConvolutionParameter::SharedCtor() { + _cached_size_ = 0; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(&num_output_, 0, reinterpret_cast(&force_nd_im2col_) - + reinterpret_cast(&num_output_) + sizeof(force_nd_im2col_)); + axis_ = 1; + bias_term_ = true; + group_ = 1u; +} + +ConvolutionParameter::~ConvolutionParameter() { + // @@protoc_insertion_point(destructor:caffe.ConvolutionParameter) + SharedDtor(); +} + +void ConvolutionParameter::SharedDtor() { + if (this != &ConvolutionParameter_default_instance_.get()) { + delete weight_filler_; + delete bias_filler_; + } +} + +void ConvolutionParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ConvolutionParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ConvolutionParameter_descriptor_; +} + +const ConvolutionParameter& ConvolutionParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ConvolutionParameter_default_instance_; + +ConvolutionParameter* ConvolutionParameter::New(::google::protobuf::Arena* arena) const { + ConvolutionParameter* n = new ConvolutionParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ConvolutionParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ConvolutionParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(ConvolutionParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 195u) { + ZR_(num_output_, pad_w_); + bias_term_ = true; + } + if (_has_bits_[8 / 32] & 65280u) { + ZR_(kernel_h_, engine_); + group_ = 1u; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 196608u) { + axis_ = 1; + force_nd_im2col_ = false; + } + +#undef ZR_HELPER_ +#undef ZR_ + + pad_.Clear(); + kernel_size_.Clear(); + stride_.Clear(); + dilation_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ConvolutionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ConvolutionParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 num_output = 1; + case 1: { + if (tag == 8) { + set_has_num_output(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_bias_term; + break; + } + + // optional bool bias_term = 2 [default = true]; + case 2: { + if (tag == 16) { + parse_bias_term: + set_has_bias_term(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_pad; + break; + } + + // repeated uint32 pad = 3; + case 3: { + if (tag == 24) { + parse_pad: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 24, input, this->mutable_pad()))); + } else if (tag == 26) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_pad()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_pad; + if (input->ExpectTag(32)) goto parse_kernel_size; + break; + } + + // repeated uint32 kernel_size = 4; + case 4: { + if (tag == 32) { + parse_kernel_size: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 32, input, this->mutable_kernel_size()))); + } else if (tag == 34) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_kernel_size()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_kernel_size; + if (input->ExpectTag(40)) goto parse_group; + break; + } + + // optional uint32 group = 5 [default = 1]; + case 5: { + if (tag == 40) { + parse_group: + set_has_group(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_stride; + break; + } + + // repeated uint32 stride = 6; + case 6: { + if (tag == 48) { + parse_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 48, input, this->mutable_stride()))); + } else if (tag == 50) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_stride()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_stride; + if (input->ExpectTag(58)) goto parse_weight_filler; + break; + } + + // optional .caffe.FillerParameter weight_filler = 7; + case 7: { + if (tag == 58) { + parse_weight_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_weight_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_bias_filler; + break; + } + + // optional .caffe.FillerParameter bias_filler = 8; + case 8: { + if (tag == 66) { + parse_bias_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_pad_h; + break; + } + + // optional uint32 pad_h = 9 [default = 0]; + case 9: { + if (tag == 72) { + parse_pad_h: + set_has_pad_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_pad_w; + break; + } + + // optional uint32 pad_w = 10 [default = 0]; + case 10: { + if (tag == 80) { + parse_pad_w: + set_has_pad_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_kernel_h; + break; + } + + // optional uint32 kernel_h = 11; + case 11: { + if (tag == 88) { + parse_kernel_h: + set_has_kernel_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_kernel_w; + break; + } + + // optional uint32 kernel_w = 12; + case 12: { + if (tag == 96) { + parse_kernel_w: + set_has_kernel_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_stride_h; + break; + } + + // optional uint32 stride_h = 13; + case 13: { + if (tag == 104) { + parse_stride_h: + set_has_stride_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_stride_w; + break; + } + + // optional uint32 stride_w = 14; + case 14: { + if (tag == 112) { + parse_stride_w: + set_has_stride_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_engine; + break; + } + + // optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + case 15: { + if (tag == 120) { + parse_engine: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::ConvolutionParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::ConvolutionParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(15, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_axis; + break; + } + + // optional int32 axis = 16 [default = 1]; + case 16: { + if (tag == 128) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_force_nd_im2col; + break; + } + + // optional bool force_nd_im2col = 17 [default = false]; + case 17: { + if (tag == 136) { + parse_force_nd_im2col: + set_has_force_nd_im2col(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_nd_im2col_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_dilation; + break; + } + + // repeated uint32 dilation = 18; + case 18: { + if (tag == 144) { + parse_dilation: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 2, 144, input, this->mutable_dilation()))); + } else if (tag == 146) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_dilation()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_dilation; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ConvolutionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ConvolutionParameter) + return false; +#undef DO_ +} + +void ConvolutionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ConvolutionParameter) + // optional uint32 num_output = 1; + if (has_num_output()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output); + } + + // optional bool bias_term = 2 [default = true]; + if (has_bias_term()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->bias_term(), output); + } + + // repeated uint32 pad = 3; + for (int i = 0; i < this->pad_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 3, this->pad(i), output); + } + + // repeated uint32 kernel_size = 4; + for (int i = 0; i < this->kernel_size_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 4, this->kernel_size(i), output); + } + + // optional uint32 group = 5 [default = 1]; + if (has_group()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->group(), output); + } + + // repeated uint32 stride = 6; + for (int i = 0; i < this->stride_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 6, this->stride(i), output); + } + + // optional .caffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *this->weight_filler_, output); + } + + // optional .caffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *this->bias_filler_, output); + } + + // optional uint32 pad_h = 9 [default = 0]; + if (has_pad_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->pad_h(), output); + } + + // optional uint32 pad_w = 10 [default = 0]; + if (has_pad_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->pad_w(), output); + } + + // optional uint32 kernel_h = 11; + if (has_kernel_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->kernel_h(), output); + } + + // optional uint32 kernel_w = 12; + if (has_kernel_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->kernel_w(), output); + } + + // optional uint32 stride_h = 13; + if (has_stride_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->stride_h(), output); + } + + // optional uint32 stride_w = 14; + if (has_stride_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(14, this->stride_w(), output); + } + + // optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 15, this->engine(), output); + } + + // optional int32 axis = 16 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->axis(), output); + } + + // optional bool force_nd_im2col = 17 [default = false]; + if (has_force_nd_im2col()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->force_nd_im2col(), output); + } + + // repeated uint32 dilation = 18; + for (int i = 0; i < this->dilation_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 18, this->dilation(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ConvolutionParameter) +} + +::google::protobuf::uint8* ConvolutionParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ConvolutionParameter) + // optional uint32 num_output = 1; + if (has_num_output()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target); + } + + // optional bool bias_term = 2 [default = true]; + if (has_bias_term()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->bias_term(), target); + } + + // repeated uint32 pad = 3; + for (int i = 0; i < this->pad_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(3, this->pad(i), target); + } + + // repeated uint32 kernel_size = 4; + for (int i = 0; i < this->kernel_size_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(4, this->kernel_size(i), target); + } + + // optional uint32 group = 5 [default = 1]; + if (has_group()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->group(), target); + } + + // repeated uint32 stride = 6; + for (int i = 0; i < this->stride_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(6, this->stride(i), target); + } + + // optional .caffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *this->weight_filler_, false, target); + } + + // optional .caffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *this->bias_filler_, false, target); + } + + // optional uint32 pad_h = 9 [default = 0]; + if (has_pad_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->pad_h(), target); + } + + // optional uint32 pad_w = 10 [default = 0]; + if (has_pad_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->pad_w(), target); + } + + // optional uint32 kernel_h = 11; + if (has_kernel_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->kernel_h(), target); + } + + // optional uint32 kernel_w = 12; + if (has_kernel_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(12, this->kernel_w(), target); + } + + // optional uint32 stride_h = 13; + if (has_stride_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->stride_h(), target); + } + + // optional uint32 stride_w = 14; + if (has_stride_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(14, this->stride_w(), target); + } + + // optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 15, this->engine(), target); + } + + // optional int32 axis = 16 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->axis(), target); + } + + // optional bool force_nd_im2col = 17 [default = false]; + if (has_force_nd_im2col()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->force_nd_im2col(), target); + } + + // repeated uint32 dilation = 18; + for (int i = 0; i < this->dilation_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(18, this->dilation(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ConvolutionParameter) + return target; +} + +size_t ConvolutionParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ConvolutionParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 195u) { + // optional uint32 num_output = 1; + if (has_num_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_output()); + } + + // optional bool bias_term = 2 [default = true]; + if (has_bias_term()) { + total_size += 1 + 1; + } + + // optional uint32 pad_h = 9 [default = 0]; + if (has_pad_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_h()); + } + + // optional uint32 pad_w = 10 [default = 0]; + if (has_pad_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_w()); + } + + } + if (_has_bits_[8 / 32] & 65280u) { + // optional uint32 kernel_h = 11; + if (has_kernel_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_h()); + } + + // optional uint32 kernel_w = 12; + if (has_kernel_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_w()); + } + + // optional uint32 stride_h = 13; + if (has_stride_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_h()); + } + + // optional uint32 stride_w = 14; + if (has_stride_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_w()); + } + + // optional uint32 group = 5 [default = 1]; + if (has_group()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->group()); + } + + // optional .caffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .caffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + // optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (_has_bits_[16 / 32] & 196608u) { + // optional int32 axis = 16 [default = 1]; + if (has_axis()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional bool force_nd_im2col = 17 [default = false]; + if (has_force_nd_im2col()) { + total_size += 2 + 1; + } + + } + // repeated uint32 pad = 3; + { + size_t data_size = 0; + unsigned int count = this->pad_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->pad(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->pad_size()); + total_size += data_size; + } + + // repeated uint32 kernel_size = 4; + { + size_t data_size = 0; + unsigned int count = this->kernel_size_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->kernel_size(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->kernel_size_size()); + total_size += data_size; + } + + // repeated uint32 stride = 6; + { + size_t data_size = 0; + unsigned int count = this->stride_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->stride(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->stride_size()); + total_size += data_size; + } + + // repeated uint32 dilation = 18; + { + size_t data_size = 0; + unsigned int count = this->dilation_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->dilation(i)); + } + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->dilation_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConvolutionParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ConvolutionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ConvolutionParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ConvolutionParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ConvolutionParameter) + UnsafeMergeFrom(*source); + } +} + +void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ConvolutionParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ConvolutionParameter::UnsafeMergeFrom(const ConvolutionParameter& from) { + GOOGLE_DCHECK(&from != this); + pad_.UnsafeMergeFrom(from.pad_); + kernel_size_.UnsafeMergeFrom(from.kernel_size_); + stride_.UnsafeMergeFrom(from.stride_); + dilation_.UnsafeMergeFrom(from.dilation_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_output()) { + set_num_output(from.num_output()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_pad_h()) { + set_pad_h(from.pad_h()); + } + if (from.has_pad_w()) { + set_pad_w(from.pad_w()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_kernel_h()) { + set_kernel_h(from.kernel_h()); + } + if (from.has_kernel_w()) { + set_kernel_w(from.kernel_w()); + } + if (from.has_stride_h()) { + set_stride_h(from.stride_h()); + } + if (from.has_stride_w()) { + set_stride_w(from.stride_w()); + } + if (from.has_group()) { + set_group(from.group()); + } + if (from.has_weight_filler()) { + mutable_weight_filler()->::caffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::caffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_force_nd_im2col()) { + set_force_nd_im2col(from.force_nd_im2col()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ConvolutionParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ConvolutionParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConvolutionParameter::CopyFrom(const ConvolutionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ConvolutionParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ConvolutionParameter::IsInitialized() const { + + return true; +} + +void ConvolutionParameter::Swap(ConvolutionParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ConvolutionParameter::InternalSwap(ConvolutionParameter* other) { + std::swap(num_output_, other->num_output_); + std::swap(bias_term_, other->bias_term_); + pad_.UnsafeArenaSwap(&other->pad_); + kernel_size_.UnsafeArenaSwap(&other->kernel_size_); + stride_.UnsafeArenaSwap(&other->stride_); + dilation_.UnsafeArenaSwap(&other->dilation_); + std::swap(pad_h_, other->pad_h_); + std::swap(pad_w_, other->pad_w_); + std::swap(kernel_h_, other->kernel_h_); + std::swap(kernel_w_, other->kernel_w_); + std::swap(stride_h_, other->stride_h_); + std::swap(stride_w_, other->stride_w_); + std::swap(group_, other->group_); + std::swap(weight_filler_, other->weight_filler_); + std::swap(bias_filler_, other->bias_filler_); + std::swap(engine_, other->engine_); + std::swap(axis_, other->axis_); + std::swap(force_nd_im2col_, other->force_nd_im2col_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ConvolutionParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ConvolutionParameter_descriptor_; + metadata.reflection = ConvolutionParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ConvolutionParameter + +// optional uint32 num_output = 1; +bool ConvolutionParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ConvolutionParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +void ConvolutionParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +void ConvolutionParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +::google::protobuf::uint32 ConvolutionParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.num_output) + return num_output_; +} +void ConvolutionParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.num_output) +} + +// optional bool bias_term = 2 [default = true]; +bool ConvolutionParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ConvolutionParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000002u; +} +void ConvolutionParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000002u; +} +void ConvolutionParameter::clear_bias_term() { + bias_term_ = true; + clear_has_bias_term(); +} +bool ConvolutionParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.bias_term) + return bias_term_; +} +void ConvolutionParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.bias_term) +} + +// repeated uint32 pad = 3; +int ConvolutionParameter::pad_size() const { + return pad_.size(); +} +void ConvolutionParameter::clear_pad() { + pad_.Clear(); +} +::google::protobuf::uint32 ConvolutionParameter::pad(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.pad) + return pad_.Get(index); +} +void ConvolutionParameter::set_pad(int index, ::google::protobuf::uint32 value) { + pad_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.pad) +} +void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.pad) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.pad) + return pad_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.pad) + return &pad_; +} + +// repeated uint32 kernel_size = 4; +int ConvolutionParameter::kernel_size_size() const { + return kernel_size_.size(); +} +void ConvolutionParameter::clear_kernel_size() { + kernel_size_.Clear(); +} +::google::protobuf::uint32 ConvolutionParameter::kernel_size(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.kernel_size) + return kernel_size_.Get(index); +} +void ConvolutionParameter::set_kernel_size(int index, ::google::protobuf::uint32 value) { + kernel_size_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.kernel_size) +} +void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.kernel_size) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.kernel_size) + return &kernel_size_; +} + +// repeated uint32 stride = 6; +int ConvolutionParameter::stride_size() const { + return stride_.size(); +} +void ConvolutionParameter::clear_stride() { + stride_.Clear(); +} +::google::protobuf::uint32 ConvolutionParameter::stride(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.stride) + return stride_.Get(index); +} +void ConvolutionParameter::set_stride(int index, ::google::protobuf::uint32 value) { + stride_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.stride) +} +void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.stride) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.stride) + return stride_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.stride) + return &stride_; +} + +// repeated uint32 dilation = 18; +int ConvolutionParameter::dilation_size() const { + return dilation_.size(); +} +void ConvolutionParameter::clear_dilation() { + dilation_.Clear(); +} +::google::protobuf::uint32 ConvolutionParameter::dilation(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.dilation) + return dilation_.Get(index); +} +void ConvolutionParameter::set_dilation(int index, ::google::protobuf::uint32 value) { + dilation_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.dilation) +} +void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.dilation) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.dilation) + return dilation_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.dilation) + return &dilation_; +} + +// optional uint32 pad_h = 9 [default = 0]; +bool ConvolutionParameter::has_pad_h() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void ConvolutionParameter::set_has_pad_h() { + _has_bits_[0] |= 0x00000040u; +} +void ConvolutionParameter::clear_has_pad_h() { + _has_bits_[0] &= ~0x00000040u; +} +void ConvolutionParameter::clear_pad_h() { + pad_h_ = 0u; + clear_has_pad_h(); +} +::google::protobuf::uint32 ConvolutionParameter::pad_h() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.pad_h) + return pad_h_; +} +void ConvolutionParameter::set_pad_h(::google::protobuf::uint32 value) { + set_has_pad_h(); + pad_h_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.pad_h) +} + +// optional uint32 pad_w = 10 [default = 0]; +bool ConvolutionParameter::has_pad_w() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void ConvolutionParameter::set_has_pad_w() { + _has_bits_[0] |= 0x00000080u; +} +void ConvolutionParameter::clear_has_pad_w() { + _has_bits_[0] &= ~0x00000080u; +} +void ConvolutionParameter::clear_pad_w() { + pad_w_ = 0u; + clear_has_pad_w(); +} +::google::protobuf::uint32 ConvolutionParameter::pad_w() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.pad_w) + return pad_w_; +} +void ConvolutionParameter::set_pad_w(::google::protobuf::uint32 value) { + set_has_pad_w(); + pad_w_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.pad_w) +} + +// optional uint32 kernel_h = 11; +bool ConvolutionParameter::has_kernel_h() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void ConvolutionParameter::set_has_kernel_h() { + _has_bits_[0] |= 0x00000100u; +} +void ConvolutionParameter::clear_has_kernel_h() { + _has_bits_[0] &= ~0x00000100u; +} +void ConvolutionParameter::clear_kernel_h() { + kernel_h_ = 0u; + clear_has_kernel_h(); +} +::google::protobuf::uint32 ConvolutionParameter::kernel_h() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.kernel_h) + return kernel_h_; +} +void ConvolutionParameter::set_kernel_h(::google::protobuf::uint32 value) { + set_has_kernel_h(); + kernel_h_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.kernel_h) +} + +// optional uint32 kernel_w = 12; +bool ConvolutionParameter::has_kernel_w() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void ConvolutionParameter::set_has_kernel_w() { + _has_bits_[0] |= 0x00000200u; +} +void ConvolutionParameter::clear_has_kernel_w() { + _has_bits_[0] &= ~0x00000200u; +} +void ConvolutionParameter::clear_kernel_w() { + kernel_w_ = 0u; + clear_has_kernel_w(); +} +::google::protobuf::uint32 ConvolutionParameter::kernel_w() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.kernel_w) + return kernel_w_; +} +void ConvolutionParameter::set_kernel_w(::google::protobuf::uint32 value) { + set_has_kernel_w(); + kernel_w_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.kernel_w) +} + +// optional uint32 stride_h = 13; +bool ConvolutionParameter::has_stride_h() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void ConvolutionParameter::set_has_stride_h() { + _has_bits_[0] |= 0x00000400u; +} +void ConvolutionParameter::clear_has_stride_h() { + _has_bits_[0] &= ~0x00000400u; +} +void ConvolutionParameter::clear_stride_h() { + stride_h_ = 0u; + clear_has_stride_h(); +} +::google::protobuf::uint32 ConvolutionParameter::stride_h() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.stride_h) + return stride_h_; +} +void ConvolutionParameter::set_stride_h(::google::protobuf::uint32 value) { + set_has_stride_h(); + stride_h_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.stride_h) +} + +// optional uint32 stride_w = 14; +bool ConvolutionParameter::has_stride_w() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void ConvolutionParameter::set_has_stride_w() { + _has_bits_[0] |= 0x00000800u; +} +void ConvolutionParameter::clear_has_stride_w() { + _has_bits_[0] &= ~0x00000800u; +} +void ConvolutionParameter::clear_stride_w() { + stride_w_ = 0u; + clear_has_stride_w(); +} +::google::protobuf::uint32 ConvolutionParameter::stride_w() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.stride_w) + return stride_w_; +} +void ConvolutionParameter::set_stride_w(::google::protobuf::uint32 value) { + set_has_stride_w(); + stride_w_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.stride_w) +} + +// optional uint32 group = 5 [default = 1]; +bool ConvolutionParameter::has_group() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void ConvolutionParameter::set_has_group() { + _has_bits_[0] |= 0x00001000u; +} +void ConvolutionParameter::clear_has_group() { + _has_bits_[0] &= ~0x00001000u; +} +void ConvolutionParameter::clear_group() { + group_ = 1u; + clear_has_group(); +} +::google::protobuf::uint32 ConvolutionParameter::group() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.group) + return group_; +} +void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.group) +} + +// optional .caffe.FillerParameter weight_filler = 7; +bool ConvolutionParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +void ConvolutionParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00002000u; +} +void ConvolutionParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00002000u; +} +void ConvolutionParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::caffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +::caffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.ConvolutionParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void ConvolutionParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ConvolutionParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 8; +bool ConvolutionParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +void ConvolutionParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00004000u; +} +void ConvolutionParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00004000u; +} +void ConvolutionParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::caffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +::caffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.ConvolutionParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void ConvolutionParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ConvolutionParameter.bias_filler) +} + +// optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; +bool ConvolutionParameter::has_engine() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +void ConvolutionParameter::set_has_engine() { + _has_bits_[0] |= 0x00008000u; +} +void ConvolutionParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00008000u; +} +void ConvolutionParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.engine) + return static_cast< ::caffe::ConvolutionParameter_Engine >(engine_); +} +void ConvolutionParameter::set_engine(::caffe::ConvolutionParameter_Engine value) { + assert(::caffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.engine) +} + +// optional int32 axis = 16 [default = 1]; +bool ConvolutionParameter::has_axis() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +void ConvolutionParameter::set_has_axis() { + _has_bits_[0] |= 0x00010000u; +} +void ConvolutionParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00010000u; +} +void ConvolutionParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 ConvolutionParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.axis) + return axis_; +} +void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.axis) +} + +// optional bool force_nd_im2col = 17 [default = false]; +bool ConvolutionParameter::has_force_nd_im2col() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +void ConvolutionParameter::set_has_force_nd_im2col() { + _has_bits_[0] |= 0x00020000u; +} +void ConvolutionParameter::clear_has_force_nd_im2col() { + _has_bits_[0] &= ~0x00020000u; +} +void ConvolutionParameter::clear_force_nd_im2col() { + force_nd_im2col_ = false; + clear_has_force_nd_im2col(); +} +bool ConvolutionParameter::force_nd_im2col() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.force_nd_im2col) + return force_nd_im2col_; +} +void ConvolutionParameter::set_force_nd_im2col(bool value) { + set_has_force_nd_im2col(); + force_nd_im2col_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.force_nd_im2col) +} + +inline const ConvolutionParameter* ConvolutionParameter::internal_default_instance() { + return &ConvolutionParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int CropParameter::kAxisFieldNumber; +const int CropParameter::kOffsetFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +CropParameter::CropParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.CropParameter) +} + +void CropParameter::InitAsDefaultInstance() { +} + +CropParameter::CropParameter(const CropParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.CropParameter) +} + +void CropParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 2; +} + +CropParameter::~CropParameter() { + // @@protoc_insertion_point(destructor:caffe.CropParameter) + SharedDtor(); +} + +void CropParameter::SharedDtor() { +} + +void CropParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* CropParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return CropParameter_descriptor_; +} + +const CropParameter& CropParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed CropParameter_default_instance_; + +CropParameter* CropParameter::New(::google::protobuf::Arena* arena) const { + CropParameter* n = new CropParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void CropParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.CropParameter) + axis_ = 2; + offset_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool CropParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.CropParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 axis = 1 [default = 2]; + case 1: { + if (tag == 8) { + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_offset; + break; + } + + // repeated uint32 offset = 2; + case 2: { + if (tag == 16) { + parse_offset: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 16, input, this->mutable_offset()))); + } else if (tag == 18) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_offset()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_offset; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.CropParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.CropParameter) + return false; +#undef DO_ +} + +void CropParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.CropParameter) + // optional int32 axis = 1 [default = 2]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output); + } + + // repeated uint32 offset = 2; + for (int i = 0; i < this->offset_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 2, this->offset(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.CropParameter) +} + +::google::protobuf::uint8* CropParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.CropParameter) + // optional int32 axis = 1 [default = 2]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target); + } + + // repeated uint32 offset = 2; + for (int i = 0; i < this->offset_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(2, this->offset(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.CropParameter) + return target; +} + +size_t CropParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.CropParameter) + size_t total_size = 0; + + // optional int32 axis = 1 [default = 2]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // repeated uint32 offset = 2; + { + size_t data_size = 0; + unsigned int count = this->offset_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->offset(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->offset_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CropParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.CropParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const CropParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.CropParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.CropParameter) + UnsafeMergeFrom(*source); + } +} + +void CropParameter::MergeFrom(const CropParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.CropParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void CropParameter::UnsafeMergeFrom(const CropParameter& from) { + GOOGLE_DCHECK(&from != this); + offset_.UnsafeMergeFrom(from.offset_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void CropParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.CropParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CropParameter::CopyFrom(const CropParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.CropParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool CropParameter::IsInitialized() const { + + return true; +} + +void CropParameter::Swap(CropParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void CropParameter::InternalSwap(CropParameter* other) { + std::swap(axis_, other->axis_); + offset_.UnsafeArenaSwap(&other->offset_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata CropParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = CropParameter_descriptor_; + metadata.reflection = CropParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// CropParameter + +// optional int32 axis = 1 [default = 2]; +bool CropParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void CropParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void CropParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void CropParameter::clear_axis() { + axis_ = 2; + clear_has_axis(); +} +::google::protobuf::int32 CropParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.CropParameter.axis) + return axis_; +} +void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.CropParameter.axis) +} + +// repeated uint32 offset = 2; +int CropParameter::offset_size() const { + return offset_.size(); +} +void CropParameter::clear_offset() { + offset_.Clear(); +} +::google::protobuf::uint32 CropParameter::offset(int index) const { + // @@protoc_insertion_point(field_get:caffe.CropParameter.offset) + return offset_.Get(index); +} +void CropParameter::set_offset(int index, ::google::protobuf::uint32 value) { + offset_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.CropParameter.offset) +} +void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:caffe.CropParameter.offset) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:caffe.CropParameter.offset) + return offset_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:caffe.CropParameter.offset) + return &offset_; +} + +inline const CropParameter* CropParameter::internal_default_instance() { + return &CropParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* DataParameter_DB_descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataParameter_DB_descriptor_; +} +bool DataParameter_DB_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const DataParameter_DB DataParameter::LEVELDB; +const DataParameter_DB DataParameter::LMDB; +const DataParameter_DB DataParameter::DB_MIN; +const DataParameter_DB DataParameter::DB_MAX; +const int DataParameter::DB_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DataParameter::kSourceFieldNumber; +const int DataParameter::kBatchSizeFieldNumber; +const int DataParameter::kRandSkipFieldNumber; +const int DataParameter::kBackendFieldNumber; +const int DataParameter::kScaleFieldNumber; +const int DataParameter::kMeanFileFieldNumber; +const int DataParameter::kCropSizeFieldNumber; +const int DataParameter::kMirrorFieldNumber; +const int DataParameter::kForceEncodedColorFieldNumber; +const int DataParameter::kPrefetchFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DataParameter::DataParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.DataParameter) +} + +void DataParameter::InitAsDefaultInstance() { +} + +DataParameter::DataParameter(const DataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.DataParameter) +} + +void DataParameter::SharedCtor() { + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&batch_size_, 0, reinterpret_cast(&force_encoded_color_) - + reinterpret_cast(&batch_size_) + sizeof(force_encoded_color_)); + scale_ = 1; + prefetch_ = 4u; +} + +DataParameter::~DataParameter() { + // @@protoc_insertion_point(destructor:caffe.DataParameter) + SharedDtor(); +} + +void DataParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void DataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DataParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataParameter_descriptor_; +} + +const DataParameter& DataParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed DataParameter_default_instance_; + +DataParameter* DataParameter::New(::google::protobuf::Arena* arena) const { + DataParameter* n = new DataParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DataParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.DataParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(DataParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(batch_size_, mirror_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + if (_has_bits_[8 / 32] & 768u) { + force_encoded_color_ = false; + prefetch_ = 4u; + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.DataParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string source = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.DataParameter.source"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_scale; + break; + } + + // optional float scale = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_mean_file; + break; + } + + // optional string mean_file = 3; + case 3: { + if (tag == 26) { + parse_mean_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_mean_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.DataParameter.mean_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_batch_size; + break; + } + + // optional uint32 batch_size = 4; + case 4: { + if (tag == 32) { + parse_batch_size: + set_has_batch_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_crop_size; + break; + } + + // optional uint32 crop_size = 5 [default = 0]; + case 5: { + if (tag == 40) { + parse_crop_size: + set_has_crop_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_mirror; + break; + } + + // optional bool mirror = 6 [default = false]; + case 6: { + if (tag == 48) { + parse_mirror: + set_has_mirror(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_rand_skip; + break; + } + + // optional uint32 rand_skip = 7 [default = 0]; + case 7: { + if (tag == 56) { + parse_rand_skip: + set_has_rand_skip(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_backend; + break; + } + + // optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; + case 8: { + if (tag == 64) { + parse_backend: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::DataParameter_DB_IsValid(value)) { + set_backend(static_cast< ::caffe::DataParameter_DB >(value)); + } else { + mutable_unknown_fields()->AddVarint(8, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_force_encoded_color; + break; + } + + // optional bool force_encoded_color = 9 [default = false]; + case 9: { + if (tag == 72) { + parse_force_encoded_color: + set_has_force_encoded_color(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_encoded_color_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_prefetch; + break; + } + + // optional uint32 prefetch = 10 [default = 4]; + case 10: { + if (tag == 80) { + parse_prefetch: + set_has_prefetch(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &prefetch_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.DataParameter) + return false; +#undef DO_ +} + +void DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.DataParameter.source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output); + } + + // optional string mean_file = 3; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.DataParameter.mean_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->mean_file(), output); + } + + // optional uint32 batch_size = 4; + if (has_batch_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->batch_size(), output); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->crop_size(), output); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->mirror(), output); + } + + // optional uint32 rand_skip = 7 [default = 0]; + if (has_rand_skip()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->rand_skip(), output); + } + + // optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; + if (has_backend()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->backend(), output); + } + + // optional bool force_encoded_color = 9 [default = false]; + if (has_force_encoded_color()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->force_encoded_color(), output); + } + + // optional uint32 prefetch = 10 [default = 4]; + if (has_prefetch()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->prefetch(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.DataParameter) +} + +::google::protobuf::uint8* DataParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.DataParameter.source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->source(), target); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target); + } + + // optional string mean_file = 3; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.DataParameter.mean_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->mean_file(), target); + } + + // optional uint32 batch_size = 4; + if (has_batch_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->batch_size(), target); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->crop_size(), target); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->mirror(), target); + } + + // optional uint32 rand_skip = 7 [default = 0]; + if (has_rand_skip()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->rand_skip(), target); + } + + // optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; + if (has_backend()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->backend(), target); + } + + // optional bool force_encoded_color = 9 [default = false]; + if (has_force_encoded_color()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->force_encoded_color(), target); + } + + // optional uint32 prefetch = 10 [default = 4]; + if (has_prefetch()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->prefetch(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.DataParameter) + return target; +} + +size_t DataParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.DataParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + // optional uint32 batch_size = 4; + if (has_batch_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_size()); + } + + // optional uint32 rand_skip = 7 [default = 0]; + if (has_rand_skip()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->rand_skip()); + } + + // optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; + if (has_backend()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->backend()); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + // optional string mean_file = 3; + if (has_mean_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->mean_file()); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->crop_size()); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + total_size += 1 + 1; + } + + } + if (_has_bits_[8 / 32] & 768u) { + // optional bool force_encoded_color = 9 [default = false]; + if (has_force_encoded_color()) { + total_size += 1 + 1; + } + + // optional uint32 prefetch = 10 [default = 4]; + if (has_prefetch()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->prefetch()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.DataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DataParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.DataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.DataParameter) + UnsafeMergeFrom(*source); + } +} + +void DataParameter::MergeFrom(const DataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.DataParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void DataParameter::UnsafeMergeFrom(const DataParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_rand_skip()) { + set_rand_skip(from.rand_skip()); + } + if (from.has_backend()) { + set_backend(from.backend()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_mean_file()) { + set_has_mean_file(); + mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_); + } + if (from.has_crop_size()) { + set_crop_size(from.crop_size()); + } + if (from.has_mirror()) { + set_mirror(from.mirror()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_force_encoded_color()) { + set_force_encoded_color(from.force_encoded_color()); + } + if (from.has_prefetch()) { + set_prefetch(from.prefetch()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void DataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DataParameter::CopyFrom(const DataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.DataParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool DataParameter::IsInitialized() const { + + return true; +} + +void DataParameter::Swap(DataParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void DataParameter::InternalSwap(DataParameter* other) { + source_.Swap(&other->source_); + std::swap(batch_size_, other->batch_size_); + std::swap(rand_skip_, other->rand_skip_); + std::swap(backend_, other->backend_); + std::swap(scale_, other->scale_); + mean_file_.Swap(&other->mean_file_); + std::swap(crop_size_, other->crop_size_); + std::swap(mirror_, other->mirror_); + std::swap(force_encoded_color_, other->force_encoded_color_); + std::swap(prefetch_, other->prefetch_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DataParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DataParameter_descriptor_; + metadata.reflection = DataParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// DataParameter + +// optional string source = 1; +bool DataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void DataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +void DataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +void DataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +const ::std::string& DataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void DataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.DataParameter.source) +} +void DataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.DataParameter.source) +} +void DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.DataParameter.source) +} +::std::string* DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* DataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.DataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void DataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.DataParameter.source) +} + +// optional uint32 batch_size = 4; +bool DataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void DataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000002u; +} +void DataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000002u; +} +void DataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +::google::protobuf::uint32 DataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.batch_size) + return batch_size_; +} +void DataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.batch_size) +} + +// optional uint32 rand_skip = 7 [default = 0]; +bool DataParameter::has_rand_skip() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void DataParameter::set_has_rand_skip() { + _has_bits_[0] |= 0x00000004u; +} +void DataParameter::clear_has_rand_skip() { + _has_bits_[0] &= ~0x00000004u; +} +void DataParameter::clear_rand_skip() { + rand_skip_ = 0u; + clear_has_rand_skip(); +} +::google::protobuf::uint32 DataParameter::rand_skip() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.rand_skip) + return rand_skip_; +} +void DataParameter::set_rand_skip(::google::protobuf::uint32 value) { + set_has_rand_skip(); + rand_skip_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.rand_skip) +} + +// optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; +bool DataParameter::has_backend() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void DataParameter::set_has_backend() { + _has_bits_[0] |= 0x00000008u; +} +void DataParameter::clear_has_backend() { + _has_bits_[0] &= ~0x00000008u; +} +void DataParameter::clear_backend() { + backend_ = 0; + clear_has_backend(); +} +::caffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.backend) + return static_cast< ::caffe::DataParameter_DB >(backend_); +} +void DataParameter::set_backend(::caffe::DataParameter_DB value) { + assert(::caffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.backend) +} + +// optional float scale = 2 [default = 1]; +bool DataParameter::has_scale() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void DataParameter::set_has_scale() { + _has_bits_[0] |= 0x00000010u; +} +void DataParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000010u; +} +void DataParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float DataParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.scale) + return scale_; +} +void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.scale) +} + +// optional string mean_file = 3; +bool DataParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void DataParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000020u; +} +void DataParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000020u; +} +void DataParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +const ::std::string& DataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void DataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.DataParameter.mean_file) +} +void DataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.DataParameter.mean_file) +} +void DataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.DataParameter.mean_file) +} +::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.DataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* DataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.DataParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void DataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.DataParameter.mean_file) +} + +// optional uint32 crop_size = 5 [default = 0]; +bool DataParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void DataParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000040u; +} +void DataParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000040u; +} +void DataParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +::google::protobuf::uint32 DataParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.crop_size) + return crop_size_; +} +void DataParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.crop_size) +} + +// optional bool mirror = 6 [default = false]; +bool DataParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void DataParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000080u; +} +void DataParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000080u; +} +void DataParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +bool DataParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.mirror) + return mirror_; +} +void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.mirror) +} + +// optional bool force_encoded_color = 9 [default = false]; +bool DataParameter::has_force_encoded_color() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void DataParameter::set_has_force_encoded_color() { + _has_bits_[0] |= 0x00000100u; +} +void DataParameter::clear_has_force_encoded_color() { + _has_bits_[0] &= ~0x00000100u; +} +void DataParameter::clear_force_encoded_color() { + force_encoded_color_ = false; + clear_has_force_encoded_color(); +} +bool DataParameter::force_encoded_color() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.force_encoded_color) + return force_encoded_color_; +} +void DataParameter::set_force_encoded_color(bool value) { + set_has_force_encoded_color(); + force_encoded_color_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.force_encoded_color) +} + +// optional uint32 prefetch = 10 [default = 4]; +bool DataParameter::has_prefetch() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void DataParameter::set_has_prefetch() { + _has_bits_[0] |= 0x00000200u; +} +void DataParameter::clear_has_prefetch() { + _has_bits_[0] &= ~0x00000200u; +} +void DataParameter::clear_prefetch() { + prefetch_ = 4u; + clear_has_prefetch(); +} +::google::protobuf::uint32 DataParameter::prefetch() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.prefetch) + return prefetch_; +} +void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.prefetch) +} + +inline const DataParameter* DataParameter::internal_default_instance() { + return &DataParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NonMaximumSuppressionParameter::kNmsThresholdFieldNumber; +const int NonMaximumSuppressionParameter::kTopKFieldNumber; +const int NonMaximumSuppressionParameter::kEtaFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NonMaximumSuppressionParameter::NonMaximumSuppressionParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.NonMaximumSuppressionParameter) +} + +void NonMaximumSuppressionParameter::InitAsDefaultInstance() { +} + +NonMaximumSuppressionParameter::NonMaximumSuppressionParameter(const NonMaximumSuppressionParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.NonMaximumSuppressionParameter) +} + +void NonMaximumSuppressionParameter::SharedCtor() { + _cached_size_ = 0; + top_k_ = 0; + nms_threshold_ = 0.3f; + eta_ = 1; +} + +NonMaximumSuppressionParameter::~NonMaximumSuppressionParameter() { + // @@protoc_insertion_point(destructor:caffe.NonMaximumSuppressionParameter) + SharedDtor(); +} + +void NonMaximumSuppressionParameter::SharedDtor() { +} + +void NonMaximumSuppressionParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NonMaximumSuppressionParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NonMaximumSuppressionParameter_descriptor_; +} + +const NonMaximumSuppressionParameter& NonMaximumSuppressionParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NonMaximumSuppressionParameter_default_instance_; + +NonMaximumSuppressionParameter* NonMaximumSuppressionParameter::New(::google::protobuf::Arena* arena) const { + NonMaximumSuppressionParameter* n = new NonMaximumSuppressionParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void NonMaximumSuppressionParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.NonMaximumSuppressionParameter) + if (_has_bits_[0 / 32] & 7u) { + nms_threshold_ = 0.3f; + top_k_ = 0; + eta_ = 1; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool NonMaximumSuppressionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.NonMaximumSuppressionParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float nms_threshold = 1 [default = 0.3]; + case 1: { + if (tag == 13) { + set_has_nms_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &nms_threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_top_k; + break; + } + + // optional int32 top_k = 2; + case 2: { + if (tag == 16) { + parse_top_k: + set_has_top_k(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &top_k_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_eta; + break; + } + + // optional float eta = 3 [default = 1]; + case 3: { + if (tag == 29) { + parse_eta: + set_has_eta(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eta_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.NonMaximumSuppressionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.NonMaximumSuppressionParameter) + return false; +#undef DO_ +} + +void NonMaximumSuppressionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.NonMaximumSuppressionParameter) + // optional float nms_threshold = 1 [default = 0.3]; + if (has_nms_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->nms_threshold(), output); + } + + // optional int32 top_k = 2; + if (has_top_k()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->top_k(), output); + } + + // optional float eta = 3 [default = 1]; + if (has_eta()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->eta(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.NonMaximumSuppressionParameter) +} + +::google::protobuf::uint8* NonMaximumSuppressionParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.NonMaximumSuppressionParameter) + // optional float nms_threshold = 1 [default = 0.3]; + if (has_nms_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->nms_threshold(), target); + } + + // optional int32 top_k = 2; + if (has_top_k()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->top_k(), target); + } + + // optional float eta = 3 [default = 1]; + if (has_eta()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->eta(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.NonMaximumSuppressionParameter) + return target; +} + +size_t NonMaximumSuppressionParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.NonMaximumSuppressionParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional float nms_threshold = 1 [default = 0.3]; + if (has_nms_threshold()) { + total_size += 1 + 4; + } + + // optional int32 top_k = 2; + if (has_top_k()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->top_k()); + } + + // optional float eta = 3 [default = 1]; + if (has_eta()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NonMaximumSuppressionParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.NonMaximumSuppressionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NonMaximumSuppressionParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.NonMaximumSuppressionParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.NonMaximumSuppressionParameter) + UnsafeMergeFrom(*source); + } +} + +void NonMaximumSuppressionParameter::MergeFrom(const NonMaximumSuppressionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.NonMaximumSuppressionParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NonMaximumSuppressionParameter::UnsafeMergeFrom(const NonMaximumSuppressionParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_nms_threshold()) { + set_nms_threshold(from.nms_threshold()); + } + if (from.has_top_k()) { + set_top_k(from.top_k()); + } + if (from.has_eta()) { + set_eta(from.eta()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void NonMaximumSuppressionParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.NonMaximumSuppressionParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NonMaximumSuppressionParameter::CopyFrom(const NonMaximumSuppressionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.NonMaximumSuppressionParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NonMaximumSuppressionParameter::IsInitialized() const { + + return true; +} + +void NonMaximumSuppressionParameter::Swap(NonMaximumSuppressionParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void NonMaximumSuppressionParameter::InternalSwap(NonMaximumSuppressionParameter* other) { + std::swap(nms_threshold_, other->nms_threshold_); + std::swap(top_k_, other->top_k_); + std::swap(eta_, other->eta_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NonMaximumSuppressionParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NonMaximumSuppressionParameter_descriptor_; + metadata.reflection = NonMaximumSuppressionParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NonMaximumSuppressionParameter + +// optional float nms_threshold = 1 [default = 0.3]; +bool NonMaximumSuppressionParameter::has_nms_threshold() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void NonMaximumSuppressionParameter::set_has_nms_threshold() { + _has_bits_[0] |= 0x00000001u; +} +void NonMaximumSuppressionParameter::clear_has_nms_threshold() { + _has_bits_[0] &= ~0x00000001u; +} +void NonMaximumSuppressionParameter::clear_nms_threshold() { + nms_threshold_ = 0.3f; + clear_has_nms_threshold(); +} +float NonMaximumSuppressionParameter::nms_threshold() const { + // @@protoc_insertion_point(field_get:caffe.NonMaximumSuppressionParameter.nms_threshold) + return nms_threshold_; +} +void NonMaximumSuppressionParameter::set_nms_threshold(float value) { + set_has_nms_threshold(); + nms_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.NonMaximumSuppressionParameter.nms_threshold) +} + +// optional int32 top_k = 2; +bool NonMaximumSuppressionParameter::has_top_k() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void NonMaximumSuppressionParameter::set_has_top_k() { + _has_bits_[0] |= 0x00000002u; +} +void NonMaximumSuppressionParameter::clear_has_top_k() { + _has_bits_[0] &= ~0x00000002u; +} +void NonMaximumSuppressionParameter::clear_top_k() { + top_k_ = 0; + clear_has_top_k(); +} +::google::protobuf::int32 NonMaximumSuppressionParameter::top_k() const { + // @@protoc_insertion_point(field_get:caffe.NonMaximumSuppressionParameter.top_k) + return top_k_; +} +void NonMaximumSuppressionParameter::set_top_k(::google::protobuf::int32 value) { + set_has_top_k(); + top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.NonMaximumSuppressionParameter.top_k) +} + +// optional float eta = 3 [default = 1]; +bool NonMaximumSuppressionParameter::has_eta() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void NonMaximumSuppressionParameter::set_has_eta() { + _has_bits_[0] |= 0x00000004u; +} +void NonMaximumSuppressionParameter::clear_has_eta() { + _has_bits_[0] &= ~0x00000004u; +} +void NonMaximumSuppressionParameter::clear_eta() { + eta_ = 1; + clear_has_eta(); +} +float NonMaximumSuppressionParameter::eta() const { + // @@protoc_insertion_point(field_get:caffe.NonMaximumSuppressionParameter.eta) + return eta_; +} +void NonMaximumSuppressionParameter::set_eta(float value) { + set_has_eta(); + eta_ = value; + // @@protoc_insertion_point(field_set:caffe.NonMaximumSuppressionParameter.eta) +} + +inline const NonMaximumSuppressionParameter* NonMaximumSuppressionParameter::internal_default_instance() { + return &NonMaximumSuppressionParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SaveOutputParameter::kOutputDirectoryFieldNumber; +const int SaveOutputParameter::kOutputNamePrefixFieldNumber; +const int SaveOutputParameter::kOutputFormatFieldNumber; +const int SaveOutputParameter::kLabelMapFileFieldNumber; +const int SaveOutputParameter::kNameSizeFileFieldNumber; +const int SaveOutputParameter::kNumTestImageFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SaveOutputParameter::SaveOutputParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SaveOutputParameter) +} + +void SaveOutputParameter::InitAsDefaultInstance() { +} + +SaveOutputParameter::SaveOutputParameter(const SaveOutputParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SaveOutputParameter) +} + +void SaveOutputParameter::SharedCtor() { + _cached_size_ = 0; + output_directory_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_name_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_format_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_map_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_size_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_test_image_ = 0u; +} + +SaveOutputParameter::~SaveOutputParameter() { + // @@protoc_insertion_point(destructor:caffe.SaveOutputParameter) + SharedDtor(); +} + +void SaveOutputParameter::SharedDtor() { + output_directory_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_name_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_format_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_map_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_size_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void SaveOutputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SaveOutputParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SaveOutputParameter_descriptor_; +} + +const SaveOutputParameter& SaveOutputParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SaveOutputParameter_default_instance_; + +SaveOutputParameter* SaveOutputParameter::New(::google::protobuf::Arena* arena) const { + SaveOutputParameter* n = new SaveOutputParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SaveOutputParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SaveOutputParameter) + if (_has_bits_[0 / 32] & 63u) { + if (has_output_directory()) { + output_directory_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_output_name_prefix()) { + output_name_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_output_format()) { + output_format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_label_map_file()) { + label_map_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_name_size_file()) { + name_size_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + num_test_image_ = 0u; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SaveOutputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SaveOutputParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string output_directory = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_directory())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_directory().data(), this->output_directory().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SaveOutputParameter.output_directory"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_output_name_prefix; + break; + } + + // optional string output_name_prefix = 2; + case 2: { + if (tag == 18) { + parse_output_name_prefix: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_name_prefix())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_name_prefix().data(), this->output_name_prefix().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SaveOutputParameter.output_name_prefix"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_output_format; + break; + } + + // optional string output_format = 3; + case 3: { + if (tag == 26) { + parse_output_format: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_format())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_format().data(), this->output_format().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SaveOutputParameter.output_format"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_label_map_file; + break; + } + + // optional string label_map_file = 4; + case 4: { + if (tag == 34) { + parse_label_map_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_label_map_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->label_map_file().data(), this->label_map_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SaveOutputParameter.label_map_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_name_size_file; + break; + } + + // optional string name_size_file = 5; + case 5: { + if (tag == 42) { + parse_name_size_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name_size_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name_size_file().data(), this->name_size_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.SaveOutputParameter.name_size_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_num_test_image; + break; + } + + // optional uint32 num_test_image = 6; + case 6: { + if (tag == 48) { + parse_num_test_image: + set_has_num_test_image(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_test_image_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SaveOutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SaveOutputParameter) + return false; +#undef DO_ +} + +void SaveOutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SaveOutputParameter) + // optional string output_directory = 1; + if (has_output_directory()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_directory().data(), this->output_directory().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.output_directory"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->output_directory(), output); + } + + // optional string output_name_prefix = 2; + if (has_output_name_prefix()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_name_prefix().data(), this->output_name_prefix().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.output_name_prefix"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->output_name_prefix(), output); + } + + // optional string output_format = 3; + if (has_output_format()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_format().data(), this->output_format().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.output_format"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->output_format(), output); + } + + // optional string label_map_file = 4; + if (has_label_map_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->label_map_file().data(), this->label_map_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.label_map_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->label_map_file(), output); + } + + // optional string name_size_file = 5; + if (has_name_size_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name_size_file().data(), this->name_size_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.name_size_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->name_size_file(), output); + } + + // optional uint32 num_test_image = 6; + if (has_num_test_image()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->num_test_image(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SaveOutputParameter) +} + +::google::protobuf::uint8* SaveOutputParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SaveOutputParameter) + // optional string output_directory = 1; + if (has_output_directory()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_directory().data(), this->output_directory().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.output_directory"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->output_directory(), target); + } + + // optional string output_name_prefix = 2; + if (has_output_name_prefix()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_name_prefix().data(), this->output_name_prefix().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.output_name_prefix"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->output_name_prefix(), target); + } + + // optional string output_format = 3; + if (has_output_format()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_format().data(), this->output_format().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.output_format"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->output_format(), target); + } + + // optional string label_map_file = 4; + if (has_label_map_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->label_map_file().data(), this->label_map_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.label_map_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->label_map_file(), target); + } + + // optional string name_size_file = 5; + if (has_name_size_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name_size_file().data(), this->name_size_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.SaveOutputParameter.name_size_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->name_size_file(), target); + } + + // optional uint32 num_test_image = 6; + if (has_num_test_image()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->num_test_image(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SaveOutputParameter) + return target; +} + +size_t SaveOutputParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SaveOutputParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 63u) { + // optional string output_directory = 1; + if (has_output_directory()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_directory()); + } + + // optional string output_name_prefix = 2; + if (has_output_name_prefix()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_name_prefix()); + } + + // optional string output_format = 3; + if (has_output_format()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_format()); + } + + // optional string label_map_file = 4; + if (has_label_map_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->label_map_file()); + } + + // optional string name_size_file = 5; + if (has_name_size_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name_size_file()); + } + + // optional uint32 num_test_image = 6; + if (has_num_test_image()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_test_image()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SaveOutputParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SaveOutputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SaveOutputParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SaveOutputParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SaveOutputParameter) + UnsafeMergeFrom(*source); + } +} + +void SaveOutputParameter::MergeFrom(const SaveOutputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SaveOutputParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SaveOutputParameter::UnsafeMergeFrom(const SaveOutputParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_output_directory()) { + set_has_output_directory(); + output_directory_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_directory_); + } + if (from.has_output_name_prefix()) { + set_has_output_name_prefix(); + output_name_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_name_prefix_); + } + if (from.has_output_format()) { + set_has_output_format(); + output_format_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_format_); + } + if (from.has_label_map_file()) { + set_has_label_map_file(); + label_map_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.label_map_file_); + } + if (from.has_name_size_file()) { + set_has_name_size_file(); + name_size_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_size_file_); + } + if (from.has_num_test_image()) { + set_num_test_image(from.num_test_image()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SaveOutputParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SaveOutputParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SaveOutputParameter::CopyFrom(const SaveOutputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SaveOutputParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SaveOutputParameter::IsInitialized() const { + + return true; +} + +void SaveOutputParameter::Swap(SaveOutputParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void SaveOutputParameter::InternalSwap(SaveOutputParameter* other) { + output_directory_.Swap(&other->output_directory_); + output_name_prefix_.Swap(&other->output_name_prefix_); + output_format_.Swap(&other->output_format_); + label_map_file_.Swap(&other->label_map_file_); + name_size_file_.Swap(&other->name_size_file_); + std::swap(num_test_image_, other->num_test_image_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SaveOutputParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SaveOutputParameter_descriptor_; + metadata.reflection = SaveOutputParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SaveOutputParameter + +// optional string output_directory = 1; +bool SaveOutputParameter::has_output_directory() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SaveOutputParameter::set_has_output_directory() { + _has_bits_[0] |= 0x00000001u; +} +void SaveOutputParameter::clear_has_output_directory() { + _has_bits_[0] &= ~0x00000001u; +} +void SaveOutputParameter::clear_output_directory() { + output_directory_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_directory(); +} +const ::std::string& SaveOutputParameter::output_directory() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.output_directory) + return output_directory_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_output_directory(const ::std::string& value) { + set_has_output_directory(); + output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.output_directory) +} +void SaveOutputParameter::set_output_directory(const char* value) { + set_has_output_directory(); + output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.output_directory) +} +void SaveOutputParameter::set_output_directory(const char* value, size_t size) { + set_has_output_directory(); + output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.output_directory) +} +::std::string* SaveOutputParameter::mutable_output_directory() { + set_has_output_directory(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.output_directory) + return output_directory_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SaveOutputParameter::release_output_directory() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.output_directory) + clear_has_output_directory(); + return output_directory_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_allocated_output_directory(::std::string* output_directory) { + if (output_directory != NULL) { + set_has_output_directory(); + } else { + clear_has_output_directory(); + } + output_directory_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_directory); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.output_directory) +} + +// optional string output_name_prefix = 2; +bool SaveOutputParameter::has_output_name_prefix() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void SaveOutputParameter::set_has_output_name_prefix() { + _has_bits_[0] |= 0x00000002u; +} +void SaveOutputParameter::clear_has_output_name_prefix() { + _has_bits_[0] &= ~0x00000002u; +} +void SaveOutputParameter::clear_output_name_prefix() { + output_name_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_name_prefix(); +} +const ::std::string& SaveOutputParameter::output_name_prefix() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.output_name_prefix) + return output_name_prefix_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_output_name_prefix(const ::std::string& value) { + set_has_output_name_prefix(); + output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.output_name_prefix) +} +void SaveOutputParameter::set_output_name_prefix(const char* value) { + set_has_output_name_prefix(); + output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.output_name_prefix) +} +void SaveOutputParameter::set_output_name_prefix(const char* value, size_t size) { + set_has_output_name_prefix(); + output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.output_name_prefix) +} +::std::string* SaveOutputParameter::mutable_output_name_prefix() { + set_has_output_name_prefix(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.output_name_prefix) + return output_name_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SaveOutputParameter::release_output_name_prefix() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.output_name_prefix) + clear_has_output_name_prefix(); + return output_name_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_allocated_output_name_prefix(::std::string* output_name_prefix) { + if (output_name_prefix != NULL) { + set_has_output_name_prefix(); + } else { + clear_has_output_name_prefix(); + } + output_name_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_name_prefix); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.output_name_prefix) +} + +// optional string output_format = 3; +bool SaveOutputParameter::has_output_format() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void SaveOutputParameter::set_has_output_format() { + _has_bits_[0] |= 0x00000004u; +} +void SaveOutputParameter::clear_has_output_format() { + _has_bits_[0] &= ~0x00000004u; +} +void SaveOutputParameter::clear_output_format() { + output_format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_format(); +} +const ::std::string& SaveOutputParameter::output_format() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.output_format) + return output_format_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_output_format(const ::std::string& value) { + set_has_output_format(); + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.output_format) +} +void SaveOutputParameter::set_output_format(const char* value) { + set_has_output_format(); + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.output_format) +} +void SaveOutputParameter::set_output_format(const char* value, size_t size) { + set_has_output_format(); + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.output_format) +} +::std::string* SaveOutputParameter::mutable_output_format() { + set_has_output_format(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.output_format) + return output_format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SaveOutputParameter::release_output_format() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.output_format) + clear_has_output_format(); + return output_format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_allocated_output_format(::std::string* output_format) { + if (output_format != NULL) { + set_has_output_format(); + } else { + clear_has_output_format(); + } + output_format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_format); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.output_format) +} + +// optional string label_map_file = 4; +bool SaveOutputParameter::has_label_map_file() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void SaveOutputParameter::set_has_label_map_file() { + _has_bits_[0] |= 0x00000008u; +} +void SaveOutputParameter::clear_has_label_map_file() { + _has_bits_[0] &= ~0x00000008u; +} +void SaveOutputParameter::clear_label_map_file() { + label_map_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_label_map_file(); +} +const ::std::string& SaveOutputParameter::label_map_file() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.label_map_file) + return label_map_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_label_map_file(const ::std::string& value) { + set_has_label_map_file(); + label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.label_map_file) +} +void SaveOutputParameter::set_label_map_file(const char* value) { + set_has_label_map_file(); + label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.label_map_file) +} +void SaveOutputParameter::set_label_map_file(const char* value, size_t size) { + set_has_label_map_file(); + label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.label_map_file) +} +::std::string* SaveOutputParameter::mutable_label_map_file() { + set_has_label_map_file(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.label_map_file) + return label_map_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SaveOutputParameter::release_label_map_file() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.label_map_file) + clear_has_label_map_file(); + return label_map_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_allocated_label_map_file(::std::string* label_map_file) { + if (label_map_file != NULL) { + set_has_label_map_file(); + } else { + clear_has_label_map_file(); + } + label_map_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), label_map_file); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.label_map_file) +} + +// optional string name_size_file = 5; +bool SaveOutputParameter::has_name_size_file() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void SaveOutputParameter::set_has_name_size_file() { + _has_bits_[0] |= 0x00000010u; +} +void SaveOutputParameter::clear_has_name_size_file() { + _has_bits_[0] &= ~0x00000010u; +} +void SaveOutputParameter::clear_name_size_file() { + name_size_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name_size_file(); +} +const ::std::string& SaveOutputParameter::name_size_file() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.name_size_file) + return name_size_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_name_size_file(const ::std::string& value) { + set_has_name_size_file(); + name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.name_size_file) +} +void SaveOutputParameter::set_name_size_file(const char* value) { + set_has_name_size_file(); + name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.name_size_file) +} +void SaveOutputParameter::set_name_size_file(const char* value, size_t size) { + set_has_name_size_file(); + name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.name_size_file) +} +::std::string* SaveOutputParameter::mutable_name_size_file() { + set_has_name_size_file(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.name_size_file) + return name_size_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* SaveOutputParameter::release_name_size_file() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.name_size_file) + clear_has_name_size_file(); + return name_size_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void SaveOutputParameter::set_allocated_name_size_file(::std::string* name_size_file) { + if (name_size_file != NULL) { + set_has_name_size_file(); + } else { + clear_has_name_size_file(); + } + name_size_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_size_file); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.name_size_file) +} + +// optional uint32 num_test_image = 6; +bool SaveOutputParameter::has_num_test_image() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void SaveOutputParameter::set_has_num_test_image() { + _has_bits_[0] |= 0x00000020u; +} +void SaveOutputParameter::clear_has_num_test_image() { + _has_bits_[0] &= ~0x00000020u; +} +void SaveOutputParameter::clear_num_test_image() { + num_test_image_ = 0u; + clear_has_num_test_image(); +} +::google::protobuf::uint32 SaveOutputParameter::num_test_image() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.num_test_image) + return num_test_image_; +} +void SaveOutputParameter::set_num_test_image(::google::protobuf::uint32 value) { + set_has_num_test_image(); + num_test_image_ = value; + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.num_test_image) +} + +inline const SaveOutputParameter* SaveOutputParameter::internal_default_instance() { + return &SaveOutputParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DropoutParameter::kDropoutRatioFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DropoutParameter::DropoutParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.DropoutParameter) +} + +void DropoutParameter::InitAsDefaultInstance() { +} + +DropoutParameter::DropoutParameter(const DropoutParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.DropoutParameter) +} + +void DropoutParameter::SharedCtor() { + _cached_size_ = 0; + dropout_ratio_ = 0.5f; +} + +DropoutParameter::~DropoutParameter() { + // @@protoc_insertion_point(destructor:caffe.DropoutParameter) + SharedDtor(); +} + +void DropoutParameter::SharedDtor() { +} + +void DropoutParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DropoutParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DropoutParameter_descriptor_; +} + +const DropoutParameter& DropoutParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed DropoutParameter_default_instance_; + +DropoutParameter* DropoutParameter::New(::google::protobuf::Arena* arena) const { + DropoutParameter* n = new DropoutParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DropoutParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.DropoutParameter) + dropout_ratio_ = 0.5f; + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DropoutParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.DropoutParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float dropout_ratio = 1 [default = 0.5]; + case 1: { + if (tag == 13) { + set_has_dropout_ratio(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.DropoutParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.DropoutParameter) + return false; +#undef DO_ +} + +void DropoutParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.DropoutParameter) + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->dropout_ratio(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.DropoutParameter) +} + +::google::protobuf::uint8* DropoutParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.DropoutParameter) + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->dropout_ratio(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.DropoutParameter) + return target; +} + +size_t DropoutParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.DropoutParameter) + size_t total_size = 0; + + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + total_size += 1 + 4; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DropoutParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.DropoutParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DropoutParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.DropoutParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.DropoutParameter) + UnsafeMergeFrom(*source); + } +} + +void DropoutParameter::MergeFrom(const DropoutParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.DropoutParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void DropoutParameter::UnsafeMergeFrom(const DropoutParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_dropout_ratio()) { + set_dropout_ratio(from.dropout_ratio()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void DropoutParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.DropoutParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DropoutParameter::CopyFrom(const DropoutParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.DropoutParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool DropoutParameter::IsInitialized() const { + + return true; +} + +void DropoutParameter::Swap(DropoutParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void DropoutParameter::InternalSwap(DropoutParameter* other) { + std::swap(dropout_ratio_, other->dropout_ratio_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DropoutParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DropoutParameter_descriptor_; + metadata.reflection = DropoutParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// DropoutParameter + +// optional float dropout_ratio = 1 [default = 0.5]; +bool DropoutParameter::has_dropout_ratio() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void DropoutParameter::set_has_dropout_ratio() { + _has_bits_[0] |= 0x00000001u; +} +void DropoutParameter::clear_has_dropout_ratio() { + _has_bits_[0] &= ~0x00000001u; +} +void DropoutParameter::clear_dropout_ratio() { + dropout_ratio_ = 0.5f; + clear_has_dropout_ratio(); +} +float DropoutParameter::dropout_ratio() const { + // @@protoc_insertion_point(field_get:caffe.DropoutParameter.dropout_ratio) + return dropout_ratio_; +} +void DropoutParameter::set_dropout_ratio(float value) { + set_has_dropout_ratio(); + dropout_ratio_ = value; + // @@protoc_insertion_point(field_set:caffe.DropoutParameter.dropout_ratio) +} + +inline const DropoutParameter* DropoutParameter::internal_default_instance() { + return &DropoutParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DummyDataParameter::kDataFillerFieldNumber; +const int DummyDataParameter::kShapeFieldNumber; +const int DummyDataParameter::kNumFieldNumber; +const int DummyDataParameter::kChannelsFieldNumber; +const int DummyDataParameter::kHeightFieldNumber; +const int DummyDataParameter::kWidthFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DummyDataParameter::DummyDataParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.DummyDataParameter) +} + +void DummyDataParameter::InitAsDefaultInstance() { +} + +DummyDataParameter::DummyDataParameter(const DummyDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.DummyDataParameter) +} + +void DummyDataParameter::SharedCtor() { + _cached_size_ = 0; +} + +DummyDataParameter::~DummyDataParameter() { + // @@protoc_insertion_point(destructor:caffe.DummyDataParameter) + SharedDtor(); +} + +void DummyDataParameter::SharedDtor() { +} + +void DummyDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DummyDataParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DummyDataParameter_descriptor_; +} + +const DummyDataParameter& DummyDataParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed DummyDataParameter_default_instance_; + +DummyDataParameter* DummyDataParameter::New(::google::protobuf::Arena* arena) const { + DummyDataParameter* n = new DummyDataParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DummyDataParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.DummyDataParameter) + data_filler_.Clear(); + shape_.Clear(); + num_.Clear(); + channels_.Clear(); + height_.Clear(); + width_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DummyDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.DummyDataParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .caffe.FillerParameter data_filler = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_data_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_data_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_data_filler; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(16)) goto parse_num; + break; + } + + // repeated uint32 num = 2; + case 2: { + if (tag == 16) { + parse_num: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 16, input, this->mutable_num()))); + } else if (tag == 18) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_num()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_num; + if (input->ExpectTag(24)) goto parse_channels; + break; + } + + // repeated uint32 channels = 3; + case 3: { + if (tag == 24) { + parse_channels: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 24, input, this->mutable_channels()))); + } else if (tag == 26) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_channels()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_channels; + if (input->ExpectTag(32)) goto parse_height; + break; + } + + // repeated uint32 height = 4; + case 4: { + if (tag == 32) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 32, input, this->mutable_height()))); + } else if (tag == 34) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_height()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_height; + if (input->ExpectTag(40)) goto parse_width; + break; + } + + // repeated uint32 width = 5; + case 5: { + if (tag == 40) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 40, input, this->mutable_width()))); + } else if (tag == 42) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_width()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_width; + if (input->ExpectTag(50)) goto parse_shape; + break; + } + + // repeated .caffe.BlobShape shape = 6; + case 6: { + if (tag == 50) { + parse_shape: + DO_(input->IncrementRecursionDepth()); + parse_loop_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_loop_shape; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.DummyDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.DummyDataParameter) + return false; +#undef DO_ +} + +void DummyDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.DummyDataParameter) + // repeated .caffe.FillerParameter data_filler = 1; + for (unsigned int i = 0, n = this->data_filler_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->data_filler(i), output); + } + + // repeated uint32 num = 2; + for (int i = 0; i < this->num_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 2, this->num(i), output); + } + + // repeated uint32 channels = 3; + for (int i = 0; i < this->channels_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 3, this->channels(i), output); + } + + // repeated uint32 height = 4; + for (int i = 0; i < this->height_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 4, this->height(i), output); + } + + // repeated uint32 width = 5; + for (int i = 0; i < this->width_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 5, this->width(i), output); + } + + // repeated .caffe.BlobShape shape = 6; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->shape(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.DummyDataParameter) +} + +::google::protobuf::uint8* DummyDataParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.DummyDataParameter) + // repeated .caffe.FillerParameter data_filler = 1; + for (unsigned int i = 0, n = this->data_filler_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->data_filler(i), false, target); + } + + // repeated uint32 num = 2; + for (int i = 0; i < this->num_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(2, this->num(i), target); + } + + // repeated uint32 channels = 3; + for (int i = 0; i < this->channels_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(3, this->channels(i), target); + } + + // repeated uint32 height = 4; + for (int i = 0; i < this->height_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(4, this->height(i), target); + } + + // repeated uint32 width = 5; + for (int i = 0; i < this->width_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(5, this->width(i), target); + } + + // repeated .caffe.BlobShape shape = 6; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, this->shape(i), false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.DummyDataParameter) + return target; +} + +size_t DummyDataParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.DummyDataParameter) + size_t total_size = 0; + + // repeated .caffe.FillerParameter data_filler = 1; + { + unsigned int count = this->data_filler_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_filler(i)); + } + } + + // repeated .caffe.BlobShape shape = 6; + { + unsigned int count = this->shape_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + } + + // repeated uint32 num = 2; + { + size_t data_size = 0; + unsigned int count = this->num_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->num(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->num_size()); + total_size += data_size; + } + + // repeated uint32 channels = 3; + { + size_t data_size = 0; + unsigned int count = this->channels_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->channels(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->channels_size()); + total_size += data_size; + } + + // repeated uint32 height = 4; + { + size_t data_size = 0; + unsigned int count = this->height_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->height(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->height_size()); + total_size += data_size; + } + + // repeated uint32 width = 5; + { + size_t data_size = 0; + unsigned int count = this->width_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->width(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->width_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DummyDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.DummyDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DummyDataParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.DummyDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.DummyDataParameter) + UnsafeMergeFrom(*source); + } +} + +void DummyDataParameter::MergeFrom(const DummyDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.DummyDataParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void DummyDataParameter::UnsafeMergeFrom(const DummyDataParameter& from) { + GOOGLE_DCHECK(&from != this); + data_filler_.MergeFrom(from.data_filler_); + shape_.MergeFrom(from.shape_); + num_.UnsafeMergeFrom(from.num_); + channels_.UnsafeMergeFrom(from.channels_); + height_.UnsafeMergeFrom(from.height_); + width_.UnsafeMergeFrom(from.width_); + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void DummyDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.DummyDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DummyDataParameter::CopyFrom(const DummyDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.DummyDataParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool DummyDataParameter::IsInitialized() const { + + return true; +} + +void DummyDataParameter::Swap(DummyDataParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void DummyDataParameter::InternalSwap(DummyDataParameter* other) { + data_filler_.UnsafeArenaSwap(&other->data_filler_); + shape_.UnsafeArenaSwap(&other->shape_); + num_.UnsafeArenaSwap(&other->num_); + channels_.UnsafeArenaSwap(&other->channels_); + height_.UnsafeArenaSwap(&other->height_); + width_.UnsafeArenaSwap(&other->width_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DummyDataParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DummyDataParameter_descriptor_; + metadata.reflection = DummyDataParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// DummyDataParameter + +// repeated .caffe.FillerParameter data_filler = 1; +int DummyDataParameter::data_filler_size() const { + return data_filler_.size(); +} +void DummyDataParameter::clear_data_filler() { + data_filler_.Clear(); +} +const ::caffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +::caffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:caffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +::caffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.data_filler) + return &data_filler_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.data_filler) + return data_filler_; +} + +// repeated .caffe.BlobShape shape = 6; +int DummyDataParameter::shape_size() const { + return shape_.size(); +} +void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +const ::caffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.shape) + return shape_.Get(index); +} +::caffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:caffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +::caffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.shape) + return shape_; +} + +// repeated uint32 num = 2; +int DummyDataParameter::num_size() const { + return num_.size(); +} +void DummyDataParameter::clear_num() { + num_.Clear(); +} +::google::protobuf::uint32 DummyDataParameter::num(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.num) + return num_.Get(index); +} +void DummyDataParameter::set_num(int index, ::google::protobuf::uint32 value) { + num_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.num) +} +void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.num) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.num) + return num_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.num) + return &num_; +} + +// repeated uint32 channels = 3; +int DummyDataParameter::channels_size() const { + return channels_.size(); +} +void DummyDataParameter::clear_channels() { + channels_.Clear(); +} +::google::protobuf::uint32 DummyDataParameter::channels(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.channels) + return channels_.Get(index); +} +void DummyDataParameter::set_channels(int index, ::google::protobuf::uint32 value) { + channels_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.channels) +} +void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.channels) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.channels) + return channels_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.channels) + return &channels_; +} + +// repeated uint32 height = 4; +int DummyDataParameter::height_size() const { + return height_.size(); +} +void DummyDataParameter::clear_height() { + height_.Clear(); +} +::google::protobuf::uint32 DummyDataParameter::height(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.height) + return height_.Get(index); +} +void DummyDataParameter::set_height(int index, ::google::protobuf::uint32 value) { + height_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.height) +} +void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.height) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.height) + return height_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.height) + return &height_; +} + +// repeated uint32 width = 5; +int DummyDataParameter::width_size() const { + return width_.size(); +} +void DummyDataParameter::clear_width() { + width_.Clear(); +} +::google::protobuf::uint32 DummyDataParameter::width(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.width) + return width_.Get(index); +} +void DummyDataParameter::set_width(int index, ::google::protobuf::uint32 value) { + width_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.width) +} +void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.width) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.width) + return width_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.width) + return &width_; +} + +inline const DummyDataParameter* DummyDataParameter::internal_default_instance() { + return &DummyDataParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor() { + protobuf_AssignDescriptorsOnce(); + return EltwiseParameter_EltwiseOp_descriptor_; +} +bool EltwiseParameter_EltwiseOp_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const EltwiseParameter_EltwiseOp EltwiseParameter::PROD; +const EltwiseParameter_EltwiseOp EltwiseParameter::SUM; +const EltwiseParameter_EltwiseOp EltwiseParameter::MAX; +const EltwiseParameter_EltwiseOp EltwiseParameter::EltwiseOp_MIN; +const EltwiseParameter_EltwiseOp EltwiseParameter::EltwiseOp_MAX; +const int EltwiseParameter::EltwiseOp_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EltwiseParameter::kOperationFieldNumber; +const int EltwiseParameter::kCoeffFieldNumber; +const int EltwiseParameter::kStableProdGradFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EltwiseParameter::EltwiseParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.EltwiseParameter) +} + +void EltwiseParameter::InitAsDefaultInstance() { +} + +EltwiseParameter::EltwiseParameter(const EltwiseParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.EltwiseParameter) +} + +void EltwiseParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + stable_prod_grad_ = true; +} + +EltwiseParameter::~EltwiseParameter() { + // @@protoc_insertion_point(destructor:caffe.EltwiseParameter) + SharedDtor(); +} + +void EltwiseParameter::SharedDtor() { +} + +void EltwiseParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EltwiseParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EltwiseParameter_descriptor_; +} + +const EltwiseParameter& EltwiseParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed EltwiseParameter_default_instance_; + +EltwiseParameter* EltwiseParameter::New(::google::protobuf::Arena* arena) const { + EltwiseParameter* n = new EltwiseParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void EltwiseParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.EltwiseParameter) + if (_has_bits_[0 / 32] & 5u) { + operation_ = 1; + stable_prod_grad_ = true; + } + coeff_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool EltwiseParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.EltwiseParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::EltwiseParameter_EltwiseOp_IsValid(value)) { + set_operation(static_cast< ::caffe::EltwiseParameter_EltwiseOp >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_coeff; + break; + } + + // repeated float coeff = 2; + case 2: { + if (tag == 21) { + parse_coeff: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 21, input, this->mutable_coeff()))); + } else if (tag == 18) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_coeff()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_coeff; + if (input->ExpectTag(24)) goto parse_stable_prod_grad; + break; + } + + // optional bool stable_prod_grad = 3 [default = true]; + case 3: { + if (tag == 24) { + parse_stable_prod_grad: + set_has_stable_prod_grad(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &stable_prod_grad_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.EltwiseParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.EltwiseParameter) + return false; +#undef DO_ +} + +void EltwiseParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.EltwiseParameter) + // optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + if (has_operation()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->operation(), output); + } + + // repeated float coeff = 2; + for (int i = 0; i < this->coeff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 2, this->coeff(i), output); + } + + // optional bool stable_prod_grad = 3 [default = true]; + if (has_stable_prod_grad()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->stable_prod_grad(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.EltwiseParameter) +} + +::google::protobuf::uint8* EltwiseParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.EltwiseParameter) + // optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + if (has_operation()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->operation(), target); + } + + // repeated float coeff = 2; + for (int i = 0; i < this->coeff_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(2, this->coeff(i), target); + } + + // optional bool stable_prod_grad = 3 [default = true]; + if (has_stable_prod_grad()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->stable_prod_grad(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.EltwiseParameter) + return target; +} + +size_t EltwiseParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.EltwiseParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 5u) { + // optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + if (has_operation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->operation()); + } + + // optional bool stable_prod_grad = 3 [default = true]; + if (has_stable_prod_grad()) { + total_size += 1 + 1; + } + + } + // repeated float coeff = 2; + { + size_t data_size = 0; + unsigned int count = this->coeff_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->coeff_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EltwiseParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.EltwiseParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const EltwiseParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.EltwiseParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.EltwiseParameter) + UnsafeMergeFrom(*source); + } +} + +void EltwiseParameter::MergeFrom(const EltwiseParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.EltwiseParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void EltwiseParameter::UnsafeMergeFrom(const EltwiseParameter& from) { + GOOGLE_DCHECK(&from != this); + coeff_.UnsafeMergeFrom(from.coeff_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_operation()) { + set_operation(from.operation()); + } + if (from.has_stable_prod_grad()) { + set_stable_prod_grad(from.stable_prod_grad()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void EltwiseParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.EltwiseParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EltwiseParameter::CopyFrom(const EltwiseParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.EltwiseParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool EltwiseParameter::IsInitialized() const { + + return true; +} + +void EltwiseParameter::Swap(EltwiseParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void EltwiseParameter::InternalSwap(EltwiseParameter* other) { + std::swap(operation_, other->operation_); + coeff_.UnsafeArenaSwap(&other->coeff_); + std::swap(stable_prod_grad_, other->stable_prod_grad_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata EltwiseParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EltwiseParameter_descriptor_; + metadata.reflection = EltwiseParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EltwiseParameter + +// optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; +bool EltwiseParameter::has_operation() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void EltwiseParameter::set_has_operation() { + _has_bits_[0] |= 0x00000001u; +} +void EltwiseParameter::clear_has_operation() { + _has_bits_[0] &= ~0x00000001u; +} +void EltwiseParameter::clear_operation() { + operation_ = 1; + clear_has_operation(); +} +::caffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:caffe.EltwiseParameter.operation) + return static_cast< ::caffe::EltwiseParameter_EltwiseOp >(operation_); +} +void EltwiseParameter::set_operation(::caffe::EltwiseParameter_EltwiseOp value) { + assert(::caffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:caffe.EltwiseParameter.operation) +} + +// repeated float coeff = 2; +int EltwiseParameter::coeff_size() const { + return coeff_.size(); +} +void EltwiseParameter::clear_coeff() { + coeff_.Clear(); +} +float EltwiseParameter::coeff(int index) const { + // @@protoc_insertion_point(field_get:caffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} +void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.EltwiseParameter.coeff) +} +void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:caffe.EltwiseParameter.coeff) +} +const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:caffe.EltwiseParameter.coeff) + return coeff_; +} +::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:caffe.EltwiseParameter.coeff) + return &coeff_; +} + +// optional bool stable_prod_grad = 3 [default = true]; +bool EltwiseParameter::has_stable_prod_grad() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void EltwiseParameter::set_has_stable_prod_grad() { + _has_bits_[0] |= 0x00000004u; +} +void EltwiseParameter::clear_has_stable_prod_grad() { + _has_bits_[0] &= ~0x00000004u; +} +void EltwiseParameter::clear_stable_prod_grad() { + stable_prod_grad_ = true; + clear_has_stable_prod_grad(); +} +bool EltwiseParameter::stable_prod_grad() const { + // @@protoc_insertion_point(field_get:caffe.EltwiseParameter.stable_prod_grad) + return stable_prod_grad_; +} +void EltwiseParameter::set_stable_prod_grad(bool value) { + set_has_stable_prod_grad(); + stable_prod_grad_ = value; + // @@protoc_insertion_point(field_set:caffe.EltwiseParameter.stable_prod_grad) +} + +inline const EltwiseParameter* EltwiseParameter::internal_default_instance() { + return &EltwiseParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ELUParameter::kAlphaFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ELUParameter::ELUParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ELUParameter) +} + +void ELUParameter::InitAsDefaultInstance() { +} + +ELUParameter::ELUParameter(const ELUParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ELUParameter) +} + +void ELUParameter::SharedCtor() { + _cached_size_ = 0; + alpha_ = 1; +} + +ELUParameter::~ELUParameter() { + // @@protoc_insertion_point(destructor:caffe.ELUParameter) + SharedDtor(); +} + +void ELUParameter::SharedDtor() { +} + +void ELUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ELUParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ELUParameter_descriptor_; +} + +const ELUParameter& ELUParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ELUParameter_default_instance_; + +ELUParameter* ELUParameter::New(::google::protobuf::Arena* arena) const { + ELUParameter* n = new ELUParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ELUParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ELUParameter) + alpha_ = 1; + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ELUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ELUParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float alpha = 1 [default = 1]; + case 1: { + if (tag == 13) { + set_has_alpha(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ELUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ELUParameter) + return false; +#undef DO_ +} + +void ELUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ELUParameter) + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->alpha(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ELUParameter) +} + +::google::protobuf::uint8* ELUParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ELUParameter) + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->alpha(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ELUParameter) + return target; +} + +size_t ELUParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ELUParameter) + size_t total_size = 0; + + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + total_size += 1 + 4; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ELUParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ELUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ELUParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ELUParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ELUParameter) + UnsafeMergeFrom(*source); + } +} + +void ELUParameter::MergeFrom(const ELUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ELUParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ELUParameter::UnsafeMergeFrom(const ELUParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ELUParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ELUParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ELUParameter::CopyFrom(const ELUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ELUParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ELUParameter::IsInitialized() const { + + return true; +} + +void ELUParameter::Swap(ELUParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ELUParameter::InternalSwap(ELUParameter* other) { + std::swap(alpha_, other->alpha_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ELUParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ELUParameter_descriptor_; + metadata.reflection = ELUParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ELUParameter + +// optional float alpha = 1 [default = 1]; +bool ELUParameter::has_alpha() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ELUParameter::set_has_alpha() { + _has_bits_[0] |= 0x00000001u; +} +void ELUParameter::clear_has_alpha() { + _has_bits_[0] &= ~0x00000001u; +} +void ELUParameter::clear_alpha() { + alpha_ = 1; + clear_has_alpha(); +} +float ELUParameter::alpha() const { + // @@protoc_insertion_point(field_get:caffe.ELUParameter.alpha) + return alpha_; +} +void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:caffe.ELUParameter.alpha) +} + +inline const ELUParameter* ELUParameter::internal_default_instance() { + return &ELUParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EmbedParameter::kNumOutputFieldNumber; +const int EmbedParameter::kInputDimFieldNumber; +const int EmbedParameter::kBiasTermFieldNumber; +const int EmbedParameter::kWeightFillerFieldNumber; +const int EmbedParameter::kBiasFillerFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EmbedParameter::EmbedParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.EmbedParameter) +} + +void EmbedParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + bias_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +EmbedParameter::EmbedParameter(const EmbedParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.EmbedParameter) +} + +void EmbedParameter::SharedCtor() { + _cached_size_ = 0; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(&num_output_, 0, reinterpret_cast(&input_dim_) - + reinterpret_cast(&num_output_) + sizeof(input_dim_)); + bias_term_ = true; +} + +EmbedParameter::~EmbedParameter() { + // @@protoc_insertion_point(destructor:caffe.EmbedParameter) + SharedDtor(); +} + +void EmbedParameter::SharedDtor() { + if (this != &EmbedParameter_default_instance_.get()) { + delete weight_filler_; + delete bias_filler_; + } +} + +void EmbedParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EmbedParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EmbedParameter_descriptor_; +} + +const EmbedParameter& EmbedParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed EmbedParameter_default_instance_; + +EmbedParameter* EmbedParameter::New(::google::protobuf::Arena* arena) const { + EmbedParameter* n = new EmbedParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void EmbedParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.EmbedParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(EmbedParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 31u) { + ZR_(num_output_, input_dim_); + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool EmbedParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.EmbedParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 num_output = 1; + case 1: { + if (tag == 8) { + set_has_num_output(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_input_dim; + break; + } + + // optional uint32 input_dim = 2; + case 2: { + if (tag == 16) { + parse_input_dim: + set_has_input_dim(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_dim_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_bias_term; + break; + } + + // optional bool bias_term = 3 [default = true]; + case 3: { + if (tag == 24) { + parse_bias_term: + set_has_bias_term(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_weight_filler; + break; + } + + // optional .caffe.FillerParameter weight_filler = 4; + case 4: { + if (tag == 34) { + parse_weight_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_weight_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_bias_filler; + break; + } + + // optional .caffe.FillerParameter bias_filler = 5; + case 5: { + if (tag == 42) { + parse_bias_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.EmbedParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.EmbedParameter) + return false; +#undef DO_ +} + +void EmbedParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.EmbedParameter) + // optional uint32 num_output = 1; + if (has_num_output()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output); + } + + // optional uint32 input_dim = 2; + if (has_input_dim()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->input_dim(), output); + } + + // optional bool bias_term = 3 [default = true]; + if (has_bias_term()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->bias_term(), output); + } + + // optional .caffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *this->weight_filler_, output); + } + + // optional .caffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *this->bias_filler_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.EmbedParameter) +} + +::google::protobuf::uint8* EmbedParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.EmbedParameter) + // optional uint32 num_output = 1; + if (has_num_output()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target); + } + + // optional uint32 input_dim = 2; + if (has_input_dim()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->input_dim(), target); + } + + // optional bool bias_term = 3 [default = true]; + if (has_bias_term()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->bias_term(), target); + } + + // optional .caffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *this->weight_filler_, false, target); + } + + // optional .caffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *this->bias_filler_, false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.EmbedParameter) + return target; +} + +size_t EmbedParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.EmbedParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 31u) { + // optional uint32 num_output = 1; + if (has_num_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_output()); + } + + // optional uint32 input_dim = 2; + if (has_input_dim()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->input_dim()); + } + + // optional bool bias_term = 3 [default = true]; + if (has_bias_term()) { + total_size += 1 + 1; + } + + // optional .caffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .caffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EmbedParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.EmbedParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const EmbedParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.EmbedParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.EmbedParameter) + UnsafeMergeFrom(*source); + } +} + +void EmbedParameter::MergeFrom(const EmbedParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.EmbedParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void EmbedParameter::UnsafeMergeFrom(const EmbedParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_output()) { + set_num_output(from.num_output()); + } + if (from.has_input_dim()) { + set_input_dim(from.input_dim()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_weight_filler()) { + mutable_weight_filler()->::caffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::caffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void EmbedParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.EmbedParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EmbedParameter::CopyFrom(const EmbedParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.EmbedParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool EmbedParameter::IsInitialized() const { + + return true; +} + +void EmbedParameter::Swap(EmbedParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void EmbedParameter::InternalSwap(EmbedParameter* other) { + std::swap(num_output_, other->num_output_); + std::swap(input_dim_, other->input_dim_); + std::swap(bias_term_, other->bias_term_); + std::swap(weight_filler_, other->weight_filler_); + std::swap(bias_filler_, other->bias_filler_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata EmbedParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EmbedParameter_descriptor_; + metadata.reflection = EmbedParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EmbedParameter + +// optional uint32 num_output = 1; +bool EmbedParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void EmbedParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +void EmbedParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +void EmbedParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +::google::protobuf::uint32 EmbedParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.num_output) + return num_output_; +} +void EmbedParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.EmbedParameter.num_output) +} + +// optional uint32 input_dim = 2; +bool EmbedParameter::has_input_dim() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void EmbedParameter::set_has_input_dim() { + _has_bits_[0] |= 0x00000002u; +} +void EmbedParameter::clear_has_input_dim() { + _has_bits_[0] &= ~0x00000002u; +} +void EmbedParameter::clear_input_dim() { + input_dim_ = 0u; + clear_has_input_dim(); +} +::google::protobuf::uint32 EmbedParameter::input_dim() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.input_dim) + return input_dim_; +} +void EmbedParameter::set_input_dim(::google::protobuf::uint32 value) { + set_has_input_dim(); + input_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.EmbedParameter.input_dim) +} + +// optional bool bias_term = 3 [default = true]; +bool EmbedParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void EmbedParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000004u; +} +void EmbedParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000004u; +} +void EmbedParameter::clear_bias_term() { + bias_term_ = true; + clear_has_bias_term(); +} +bool EmbedParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.bias_term) + return bias_term_; +} +void EmbedParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.EmbedParameter.bias_term) +} + +// optional .caffe.FillerParameter weight_filler = 4; +bool EmbedParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void EmbedParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000008u; +} +void EmbedParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000008u; +} +void EmbedParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::caffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.EmbedParameter.weight_filler) + return weight_filler_; +} +::caffe::FillerParameter* EmbedParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.EmbedParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void EmbedParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.EmbedParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 5; +bool EmbedParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void EmbedParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000010u; +} +void EmbedParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000010u; +} +void EmbedParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::caffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.EmbedParameter.bias_filler) + return bias_filler_; +} +::caffe::FillerParameter* EmbedParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.EmbedParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void EmbedParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.EmbedParameter.bias_filler) +} + +inline const EmbedParameter* EmbedParameter::internal_default_instance() { + return &EmbedParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExpParameter::kBaseFieldNumber; +const int ExpParameter::kScaleFieldNumber; +const int ExpParameter::kShiftFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExpParameter::ExpParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ExpParameter) +} + +void ExpParameter::InitAsDefaultInstance() { +} + +ExpParameter::ExpParameter(const ExpParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ExpParameter) +} + +void ExpParameter::SharedCtor() { + _cached_size_ = 0; + shift_ = 0; + base_ = -1; + scale_ = 1; +} + +ExpParameter::~ExpParameter() { + // @@protoc_insertion_point(destructor:caffe.ExpParameter) + SharedDtor(); +} + +void ExpParameter::SharedDtor() { +} + +void ExpParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ExpParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ExpParameter_descriptor_; +} + +const ExpParameter& ExpParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ExpParameter_default_instance_; + +ExpParameter* ExpParameter::New(::google::protobuf::Arena* arena) const { + ExpParameter* n = new ExpParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ExpParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ExpParameter) + if (_has_bits_[0 / 32] & 7u) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ExpParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ExpParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float base = 1 [default = -1]; + case 1: { + if (tag == 13) { + set_has_base(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_scale; + break; + } + + // optional float scale = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_shift; + break; + } + + // optional float shift = 3 [default = 0]; + case 3: { + if (tag == 29) { + parse_shift: + set_has_shift(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ExpParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ExpParameter) + return false; +#undef DO_ +} + +void ExpParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ExpParameter) + // optional float base = 1 [default = -1]; + if (has_base()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->base(), output); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output); + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->shift(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ExpParameter) +} + +::google::protobuf::uint8* ExpParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ExpParameter) + // optional float base = 1 [default = -1]; + if (has_base()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->base(), target); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target); + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->shift(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ExpParameter) + return target; +} + +size_t ExpParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ExpParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional float base = 1 [default = -1]; + if (has_base()) { + total_size += 1 + 4; + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExpParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ExpParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ExpParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ExpParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ExpParameter) + UnsafeMergeFrom(*source); + } +} + +void ExpParameter::MergeFrom(const ExpParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ExpParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ExpParameter::UnsafeMergeFrom(const ExpParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_base()) { + set_base(from.base()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_shift()) { + set_shift(from.shift()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ExpParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ExpParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExpParameter::CopyFrom(const ExpParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ExpParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ExpParameter::IsInitialized() const { + + return true; +} + +void ExpParameter::Swap(ExpParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ExpParameter::InternalSwap(ExpParameter* other) { + std::swap(base_, other->base_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ExpParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ExpParameter_descriptor_; + metadata.reflection = ExpParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ExpParameter + +// optional float base = 1 [default = -1]; +bool ExpParameter::has_base() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ExpParameter::set_has_base() { + _has_bits_[0] |= 0x00000001u; +} +void ExpParameter::clear_has_base() { + _has_bits_[0] &= ~0x00000001u; +} +void ExpParameter::clear_base() { + base_ = -1; + clear_has_base(); +} +float ExpParameter::base() const { + // @@protoc_insertion_point(field_get:caffe.ExpParameter.base) + return base_; +} +void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:caffe.ExpParameter.base) +} + +// optional float scale = 2 [default = 1]; +bool ExpParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ExpParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +void ExpParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +void ExpParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float ExpParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.ExpParameter.scale) + return scale_; +} +void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.ExpParameter.scale) +} + +// optional float shift = 3 [default = 0]; +bool ExpParameter::has_shift() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ExpParameter::set_has_shift() { + _has_bits_[0] |= 0x00000004u; +} +void ExpParameter::clear_has_shift() { + _has_bits_[0] &= ~0x00000004u; +} +void ExpParameter::clear_shift() { + shift_ = 0; + clear_has_shift(); +} +float ExpParameter::shift() const { + // @@protoc_insertion_point(field_get:caffe.ExpParameter.shift) + return shift_; +} +void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:caffe.ExpParameter.shift) +} + +inline const ExpParameter* ExpParameter::internal_default_instance() { + return &ExpParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FlattenParameter::kAxisFieldNumber; +const int FlattenParameter::kEndAxisFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FlattenParameter::FlattenParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.FlattenParameter) +} + +void FlattenParameter::InitAsDefaultInstance() { +} + +FlattenParameter::FlattenParameter(const FlattenParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.FlattenParameter) +} + +void FlattenParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + end_axis_ = -1; +} + +FlattenParameter::~FlattenParameter() { + // @@protoc_insertion_point(destructor:caffe.FlattenParameter) + SharedDtor(); +} + +void FlattenParameter::SharedDtor() { +} + +void FlattenParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FlattenParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FlattenParameter_descriptor_; +} + +const FlattenParameter& FlattenParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed FlattenParameter_default_instance_; + +FlattenParameter* FlattenParameter::New(::google::protobuf::Arena* arena) const { + FlattenParameter* n = new FlattenParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FlattenParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.FlattenParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + end_axis_ = -1; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FlattenParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.FlattenParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 axis = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_end_axis; + break; + } + + // optional int32 end_axis = 2 [default = -1]; + case 2: { + if (tag == 16) { + parse_end_axis: + set_has_end_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.FlattenParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.FlattenParameter) + return false; +#undef DO_ +} + +void FlattenParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.FlattenParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output); + } + + // optional int32 end_axis = 2 [default = -1]; + if (has_end_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end_axis(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.FlattenParameter) +} + +::google::protobuf::uint8* FlattenParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.FlattenParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target); + } + + // optional int32 end_axis = 2 [default = -1]; + if (has_end_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end_axis(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.FlattenParameter) + return target; +} + +size_t FlattenParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.FlattenParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional int32 end_axis = 2 [default = -1]; + if (has_end_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->end_axis()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FlattenParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.FlattenParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FlattenParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.FlattenParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.FlattenParameter) + UnsafeMergeFrom(*source); + } +} + +void FlattenParameter::MergeFrom(const FlattenParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.FlattenParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void FlattenParameter::UnsafeMergeFrom(const FlattenParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_end_axis()) { + set_end_axis(from.end_axis()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void FlattenParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.FlattenParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FlattenParameter::CopyFrom(const FlattenParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.FlattenParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool FlattenParameter::IsInitialized() const { + + return true; +} + +void FlattenParameter::Swap(FlattenParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void FlattenParameter::InternalSwap(FlattenParameter* other) { + std::swap(axis_, other->axis_); + std::swap(end_axis_, other->end_axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FlattenParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FlattenParameter_descriptor_; + metadata.reflection = FlattenParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FlattenParameter + +// optional int32 axis = 1 [default = 1]; +bool FlattenParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void FlattenParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void FlattenParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void FlattenParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 FlattenParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.FlattenParameter.axis) + return axis_; +} +void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.FlattenParameter.axis) +} + +// optional int32 end_axis = 2 [default = -1]; +bool FlattenParameter::has_end_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void FlattenParameter::set_has_end_axis() { + _has_bits_[0] |= 0x00000002u; +} +void FlattenParameter::clear_has_end_axis() { + _has_bits_[0] &= ~0x00000002u; +} +void FlattenParameter::clear_end_axis() { + end_axis_ = -1; + clear_has_end_axis(); +} +::google::protobuf::int32 FlattenParameter::end_axis() const { + // @@protoc_insertion_point(field_get:caffe.FlattenParameter.end_axis) + return end_axis_; +} +void FlattenParameter::set_end_axis(::google::protobuf::int32 value) { + set_has_end_axis(); + end_axis_ = value; + // @@protoc_insertion_point(field_set:caffe.FlattenParameter.end_axis) +} + +inline const FlattenParameter* FlattenParameter::internal_default_instance() { + return &FlattenParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HDF5DataParameter::kSourceFieldNumber; +const int HDF5DataParameter::kBatchSizeFieldNumber; +const int HDF5DataParameter::kShuffleFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HDF5DataParameter::HDF5DataParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.HDF5DataParameter) +} + +void HDF5DataParameter::InitAsDefaultInstance() { +} + +HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.HDF5DataParameter) +} + +void HDF5DataParameter::SharedCtor() { + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&batch_size_, 0, reinterpret_cast(&shuffle_) - + reinterpret_cast(&batch_size_) + sizeof(shuffle_)); +} + +HDF5DataParameter::~HDF5DataParameter() { + // @@protoc_insertion_point(destructor:caffe.HDF5DataParameter) + SharedDtor(); +} + +void HDF5DataParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HDF5DataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* HDF5DataParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return HDF5DataParameter_descriptor_; +} + +const HDF5DataParameter& HDF5DataParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed HDF5DataParameter_default_instance_; + +HDF5DataParameter* HDF5DataParameter::New(::google::protobuf::Arena* arena) const { + HDF5DataParameter* n = new HDF5DataParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void HDF5DataParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.HDF5DataParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(HDF5DataParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 7u) { + ZR_(batch_size_, shuffle_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool HDF5DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.HDF5DataParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string source = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.HDF5DataParameter.source"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_batch_size; + break; + } + + // optional uint32 batch_size = 2; + case 2: { + if (tag == 16) { + parse_batch_size: + set_has_batch_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_shuffle; + break; + } + + // optional bool shuffle = 3 [default = false]; + case 3: { + if (tag == 24) { + parse_shuffle: + set_has_shuffle(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.HDF5DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.HDF5DataParameter) + return false; +#undef DO_ +} + +void HDF5DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.HDF5DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.HDF5DataParameter.source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + // optional uint32 batch_size = 2; + if (has_batch_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->batch_size(), output); + } + + // optional bool shuffle = 3 [default = false]; + if (has_shuffle()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->shuffle(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.HDF5DataParameter) +} + +::google::protobuf::uint8* HDF5DataParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.HDF5DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.HDF5DataParameter.source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->source(), target); + } + + // optional uint32 batch_size = 2; + if (has_batch_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->batch_size(), target); + } + + // optional bool shuffle = 3 [default = false]; + if (has_shuffle()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->shuffle(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.HDF5DataParameter) + return target; +} + +size_t HDF5DataParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.HDF5DataParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + // optional uint32 batch_size = 2; + if (has_batch_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_size()); + } + + // optional bool shuffle = 3 [default = false]; + if (has_shuffle()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5DataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.HDF5DataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const HDF5DataParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.HDF5DataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.HDF5DataParameter) + UnsafeMergeFrom(*source); + } +} + +void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.HDF5DataParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void HDF5DataParameter::UnsafeMergeFrom(const HDF5DataParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_shuffle()) { + set_shuffle(from.shuffle()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void HDF5DataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.HDF5DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HDF5DataParameter::CopyFrom(const HDF5DataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.HDF5DataParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool HDF5DataParameter::IsInitialized() const { + + return true; +} + +void HDF5DataParameter::Swap(HDF5DataParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void HDF5DataParameter::InternalSwap(HDF5DataParameter* other) { + source_.Swap(&other->source_); + std::swap(batch_size_, other->batch_size_); + std::swap(shuffle_, other->shuffle_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata HDF5DataParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = HDF5DataParameter_descriptor_; + metadata.reflection = HDF5DataParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// HDF5DataParameter + +// optional string source = 1; +bool HDF5DataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void HDF5DataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +void HDF5DataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +void HDF5DataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +const ::std::string& HDF5DataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.HDF5DataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void HDF5DataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.HDF5DataParameter.source) +} +void HDF5DataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.HDF5DataParameter.source) +} +void HDF5DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.HDF5DataParameter.source) +} +::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.HDF5DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* HDF5DataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.HDF5DataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void HDF5DataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.HDF5DataParameter.source) +} + +// optional uint32 batch_size = 2; +bool HDF5DataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void HDF5DataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000002u; +} +void HDF5DataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000002u; +} +void HDF5DataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +::google::protobuf::uint32 HDF5DataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.HDF5DataParameter.batch_size) + return batch_size_; +} +void HDF5DataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.HDF5DataParameter.batch_size) +} + +// optional bool shuffle = 3 [default = false]; +bool HDF5DataParameter::has_shuffle() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void HDF5DataParameter::set_has_shuffle() { + _has_bits_[0] |= 0x00000004u; +} +void HDF5DataParameter::clear_has_shuffle() { + _has_bits_[0] &= ~0x00000004u; +} +void HDF5DataParameter::clear_shuffle() { + shuffle_ = false; + clear_has_shuffle(); +} +bool HDF5DataParameter::shuffle() const { + // @@protoc_insertion_point(field_get:caffe.HDF5DataParameter.shuffle) + return shuffle_; +} +void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:caffe.HDF5DataParameter.shuffle) +} + +inline const HDF5DataParameter* HDF5DataParameter::internal_default_instance() { + return &HDF5DataParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HDF5OutputParameter::kFileNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HDF5OutputParameter::HDF5OutputParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::InitAsDefaultInstance() { +} + +HDF5OutputParameter::HDF5OutputParameter(const HDF5OutputParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::SharedCtor() { + _cached_size_ = 0; + file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +HDF5OutputParameter::~HDF5OutputParameter() { + // @@protoc_insertion_point(destructor:caffe.HDF5OutputParameter) + SharedDtor(); +} + +void HDF5OutputParameter::SharedDtor() { + file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void HDF5OutputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* HDF5OutputParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return HDF5OutputParameter_descriptor_; +} + +const HDF5OutputParameter& HDF5OutputParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed HDF5OutputParameter_default_instance_; + +HDF5OutputParameter* HDF5OutputParameter::New(::google::protobuf::Arena* arena) const { + HDF5OutputParameter* n = new HDF5OutputParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void HDF5OutputParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.HDF5OutputParameter) + if (has_file_name()) { + file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool HDF5OutputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.HDF5OutputParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string file_name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->file_name().data(), this->file_name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.HDF5OutputParameter.file_name"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.HDF5OutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.HDF5OutputParameter) + return false; +#undef DO_ +} + +void HDF5OutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.HDF5OutputParameter) + // optional string file_name = 1; + if (has_file_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->file_name().data(), this->file_name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.HDF5OutputParameter.file_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_name(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.HDF5OutputParameter) +} + +::google::protobuf::uint8* HDF5OutputParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.HDF5OutputParameter) + // optional string file_name = 1; + if (has_file_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->file_name().data(), this->file_name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.HDF5OutputParameter.file_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->file_name(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.HDF5OutputParameter) + return target; +} + +size_t HDF5OutputParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.HDF5OutputParameter) + size_t total_size = 0; + + // optional string file_name = 1; + if (has_file_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_name()); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5OutputParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.HDF5OutputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const HDF5OutputParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.HDF5OutputParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.HDF5OutputParameter) + UnsafeMergeFrom(*source); + } +} + +void HDF5OutputParameter::MergeFrom(const HDF5OutputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.HDF5OutputParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void HDF5OutputParameter::UnsafeMergeFrom(const HDF5OutputParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_name()) { + set_has_file_name(); + file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void HDF5OutputParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.HDF5OutputParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HDF5OutputParameter::CopyFrom(const HDF5OutputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.HDF5OutputParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool HDF5OutputParameter::IsInitialized() const { + + return true; +} + +void HDF5OutputParameter::Swap(HDF5OutputParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void HDF5OutputParameter::InternalSwap(HDF5OutputParameter* other) { + file_name_.Swap(&other->file_name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata HDF5OutputParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = HDF5OutputParameter_descriptor_; + metadata.reflection = HDF5OutputParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// HDF5OutputParameter + +// optional string file_name = 1; +bool HDF5OutputParameter::has_file_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void HDF5OutputParameter::set_has_file_name() { + _has_bits_[0] |= 0x00000001u; +} +void HDF5OutputParameter::clear_has_file_name() { + _has_bits_[0] &= ~0x00000001u; +} +void HDF5OutputParameter::clear_file_name() { + file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_file_name(); +} +const ::std::string& HDF5OutputParameter::file_name() const { + // @@protoc_insertion_point(field_get:caffe.HDF5OutputParameter.file_name) + return file_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void HDF5OutputParameter::set_file_name(const ::std::string& value) { + set_has_file_name(); + file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.HDF5OutputParameter.file_name) +} +void HDF5OutputParameter::set_file_name(const char* value) { + set_has_file_name(); + file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.HDF5OutputParameter.file_name) +} +void HDF5OutputParameter::set_file_name(const char* value, size_t size) { + set_has_file_name(); + file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.HDF5OutputParameter.file_name) +} +::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + // @@protoc_insertion_point(field_mutable:caffe.HDF5OutputParameter.file_name) + return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* HDF5OutputParameter::release_file_name() { + // @@protoc_insertion_point(field_release:caffe.HDF5OutputParameter.file_name) + clear_has_file_name(); + return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void HDF5OutputParameter::set_allocated_file_name(::std::string* file_name) { + if (file_name != NULL) { + set_has_file_name(); + } else { + clear_has_file_name(); + } + file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name); + // @@protoc_insertion_point(field_set_allocated:caffe.HDF5OutputParameter.file_name) +} + +inline const HDF5OutputParameter* HDF5OutputParameter::internal_default_instance() { + return &HDF5OutputParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* HingeLossParameter_Norm_descriptor() { + protobuf_AssignDescriptorsOnce(); + return HingeLossParameter_Norm_descriptor_; +} +bool HingeLossParameter_Norm_IsValid(int value) { + switch (value) { + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const HingeLossParameter_Norm HingeLossParameter::L1; +const HingeLossParameter_Norm HingeLossParameter::L2; +const HingeLossParameter_Norm HingeLossParameter::Norm_MIN; +const HingeLossParameter_Norm HingeLossParameter::Norm_MAX; +const int HingeLossParameter::Norm_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HingeLossParameter::kNormFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HingeLossParameter::HingeLossParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.HingeLossParameter) +} + +void HingeLossParameter::InitAsDefaultInstance() { +} + +HingeLossParameter::HingeLossParameter(const HingeLossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.HingeLossParameter) +} + +void HingeLossParameter::SharedCtor() { + _cached_size_ = 0; + norm_ = 1; +} + +HingeLossParameter::~HingeLossParameter() { + // @@protoc_insertion_point(destructor:caffe.HingeLossParameter) + SharedDtor(); +} + +void HingeLossParameter::SharedDtor() { +} + +void HingeLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* HingeLossParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return HingeLossParameter_descriptor_; +} + +const HingeLossParameter& HingeLossParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed HingeLossParameter_default_instance_; + +HingeLossParameter* HingeLossParameter::New(::google::protobuf::Arena* arena) const { + HingeLossParameter* n = new HingeLossParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void HingeLossParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.HingeLossParameter) + norm_ = 1; + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool HingeLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.HingeLossParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::HingeLossParameter_Norm_IsValid(value)) { + set_norm(static_cast< ::caffe::HingeLossParameter_Norm >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.HingeLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.HingeLossParameter) + return false; +#undef DO_ +} + +void HingeLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.HingeLossParameter) + // optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->norm(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.HingeLossParameter) +} + +::google::protobuf::uint8* HingeLossParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.HingeLossParameter) + // optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->norm(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.HingeLossParameter) + return target; +} + +size_t HingeLossParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.HingeLossParameter) + size_t total_size = 0; + + // optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm()); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HingeLossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.HingeLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const HingeLossParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.HingeLossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.HingeLossParameter) + UnsafeMergeFrom(*source); + } +} + +void HingeLossParameter::MergeFrom(const HingeLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.HingeLossParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void HingeLossParameter::UnsafeMergeFrom(const HingeLossParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_norm()) { + set_norm(from.norm()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void HingeLossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.HingeLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HingeLossParameter::CopyFrom(const HingeLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.HingeLossParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool HingeLossParameter::IsInitialized() const { + + return true; +} + +void HingeLossParameter::Swap(HingeLossParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void HingeLossParameter::InternalSwap(HingeLossParameter* other) { + std::swap(norm_, other->norm_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata HingeLossParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = HingeLossParameter_descriptor_; + metadata.reflection = HingeLossParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// HingeLossParameter + +// optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; +bool HingeLossParameter::has_norm() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void HingeLossParameter::set_has_norm() { + _has_bits_[0] |= 0x00000001u; +} +void HingeLossParameter::clear_has_norm() { + _has_bits_[0] &= ~0x00000001u; +} +void HingeLossParameter::clear_norm() { + norm_ = 1; + clear_has_norm(); +} +::caffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:caffe.HingeLossParameter.norm) + return static_cast< ::caffe::HingeLossParameter_Norm >(norm_); +} +void HingeLossParameter::set_norm(::caffe::HingeLossParameter_Norm value) { + assert(::caffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:caffe.HingeLossParameter.norm) +} + +inline const HingeLossParameter* HingeLossParameter::internal_default_instance() { + return &HingeLossParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ImageDataParameter::kSourceFieldNumber; +const int ImageDataParameter::kBatchSizeFieldNumber; +const int ImageDataParameter::kRandSkipFieldNumber; +const int ImageDataParameter::kShuffleFieldNumber; +const int ImageDataParameter::kNewHeightFieldNumber; +const int ImageDataParameter::kNewWidthFieldNumber; +const int ImageDataParameter::kIsColorFieldNumber; +const int ImageDataParameter::kScaleFieldNumber; +const int ImageDataParameter::kMeanFileFieldNumber; +const int ImageDataParameter::kCropSizeFieldNumber; +const int ImageDataParameter::kMirrorFieldNumber; +const int ImageDataParameter::kRootFolderFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ImageDataParameter::ImageDataParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ImageDataParameter) +} + +void ImageDataParameter::InitAsDefaultInstance() { +} + +ImageDataParameter::ImageDataParameter(const ImageDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ImageDataParameter) +} + +void ImageDataParameter::SharedCtor() { + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&rand_skip_, 0, reinterpret_cast(&crop_size_) - + reinterpret_cast(&rand_skip_) + sizeof(crop_size_)); + scale_ = 1; + batch_size_ = 1u; + is_color_ = true; +} + +ImageDataParameter::~ImageDataParameter() { + // @@protoc_insertion_point(destructor:caffe.ImageDataParameter) + SharedDtor(); +} + +void ImageDataParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + root_folder_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void ImageDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ImageDataParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ImageDataParameter_descriptor_; +} + +const ImageDataParameter& ImageDataParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ImageDataParameter_default_instance_; + +ImageDataParameter* ImageDataParameter::New(::google::protobuf::Arena* arena) const { + ImageDataParameter* n = new ImageDataParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ImageDataParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ImageDataParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(ImageDataParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(rand_skip_, shuffle_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + batch_size_ = 1u; + is_color_ = true; + scale_ = 1; + } + if (_has_bits_[8 / 32] & 3840u) { + ZR_(mirror_, crop_size_); + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_root_folder()) { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ImageDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ImageDataParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string source = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.ImageDataParameter.source"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_scale; + break; + } + + // optional float scale = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_mean_file; + break; + } + + // optional string mean_file = 3; + case 3: { + if (tag == 26) { + parse_mean_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_mean_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.ImageDataParameter.mean_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_batch_size; + break; + } + + // optional uint32 batch_size = 4 [default = 1]; + case 4: { + if (tag == 32) { + parse_batch_size: + set_has_batch_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_crop_size; + break; + } + + // optional uint32 crop_size = 5 [default = 0]; + case 5: { + if (tag == 40) { + parse_crop_size: + set_has_crop_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_mirror; + break; + } + + // optional bool mirror = 6 [default = false]; + case 6: { + if (tag == 48) { + parse_mirror: + set_has_mirror(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_rand_skip; + break; + } + + // optional uint32 rand_skip = 7 [default = 0]; + case 7: { + if (tag == 56) { + parse_rand_skip: + set_has_rand_skip(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_shuffle; + break; + } + + // optional bool shuffle = 8 [default = false]; + case 8: { + if (tag == 64) { + parse_shuffle: + set_has_shuffle(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_new_height; + break; + } + + // optional uint32 new_height = 9 [default = 0]; + case 9: { + if (tag == 72) { + parse_new_height: + set_has_new_height(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_height_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_new_width; + break; + } + + // optional uint32 new_width = 10 [default = 0]; + case 10: { + if (tag == 80) { + parse_new_width: + set_has_new_width(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_width_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_is_color; + break; + } + + // optional bool is_color = 11 [default = true]; + case 11: { + if (tag == 88) { + parse_is_color: + set_has_is_color(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_color_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(98)) goto parse_root_folder; + break; + } + + // optional string root_folder = 12 [default = ""]; + case 12: { + if (tag == 98) { + parse_root_folder: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_root_folder())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->root_folder().data(), this->root_folder().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.ImageDataParameter.root_folder"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ImageDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ImageDataParameter) + return false; +#undef DO_ +} + +void ImageDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ImageDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ImageDataParameter.source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output); + } + + // optional string mean_file = 3; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ImageDataParameter.mean_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->mean_file(), output); + } + + // optional uint32 batch_size = 4 [default = 1]; + if (has_batch_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->batch_size(), output); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->crop_size(), output); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->mirror(), output); + } + + // optional uint32 rand_skip = 7 [default = 0]; + if (has_rand_skip()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->rand_skip(), output); + } + + // optional bool shuffle = 8 [default = false]; + if (has_shuffle()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->shuffle(), output); + } + + // optional uint32 new_height = 9 [default = 0]; + if (has_new_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->new_height(), output); + } + + // optional uint32 new_width = 10 [default = 0]; + if (has_new_width()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->new_width(), output); + } + + // optional bool is_color = 11 [default = true]; + if (has_is_color()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->is_color(), output); + } + + // optional string root_folder = 12 [default = ""]; + if (has_root_folder()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->root_folder().data(), this->root_folder().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ImageDataParameter.root_folder"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 12, this->root_folder(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ImageDataParameter) +} + +::google::protobuf::uint8* ImageDataParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ImageDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ImageDataParameter.source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->source(), target); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target); + } + + // optional string mean_file = 3; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ImageDataParameter.mean_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->mean_file(), target); + } + + // optional uint32 batch_size = 4 [default = 1]; + if (has_batch_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->batch_size(), target); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->crop_size(), target); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->mirror(), target); + } + + // optional uint32 rand_skip = 7 [default = 0]; + if (has_rand_skip()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->rand_skip(), target); + } + + // optional bool shuffle = 8 [default = false]; + if (has_shuffle()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->shuffle(), target); + } + + // optional uint32 new_height = 9 [default = 0]; + if (has_new_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->new_height(), target); + } + + // optional uint32 new_width = 10 [default = 0]; + if (has_new_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->new_width(), target); + } + + // optional bool is_color = 11 [default = true]; + if (has_is_color()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(11, this->is_color(), target); + } + + // optional string root_folder = 12 [default = ""]; + if (has_root_folder()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->root_folder().data(), this->root_folder().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.ImageDataParameter.root_folder"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 12, this->root_folder(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ImageDataParameter) + return target; +} + +size_t ImageDataParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ImageDataParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + // optional uint32 batch_size = 4 [default = 1]; + if (has_batch_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_size()); + } + + // optional uint32 rand_skip = 7 [default = 0]; + if (has_rand_skip()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->rand_skip()); + } + + // optional bool shuffle = 8 [default = false]; + if (has_shuffle()) { + total_size += 1 + 1; + } + + // optional uint32 new_height = 9 [default = 0]; + if (has_new_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->new_height()); + } + + // optional uint32 new_width = 10 [default = 0]; + if (has_new_width()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->new_width()); + } + + // optional bool is_color = 11 [default = true]; + if (has_is_color()) { + total_size += 1 + 1; + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + } + if (_has_bits_[8 / 32] & 3840u) { + // optional string mean_file = 3; + if (has_mean_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->mean_file()); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->crop_size()); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + total_size += 1 + 1; + } + + // optional string root_folder = 12 [default = ""]; + if (has_root_folder()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->root_folder()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ImageDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ImageDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ImageDataParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ImageDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ImageDataParameter) + UnsafeMergeFrom(*source); + } +} + +void ImageDataParameter::MergeFrom(const ImageDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ImageDataParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ImageDataParameter::UnsafeMergeFrom(const ImageDataParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_rand_skip()) { + set_rand_skip(from.rand_skip()); + } + if (from.has_shuffle()) { + set_shuffle(from.shuffle()); + } + if (from.has_new_height()) { + set_new_height(from.new_height()); + } + if (from.has_new_width()) { + set_new_width(from.new_width()); + } + if (from.has_is_color()) { + set_is_color(from.is_color()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_mean_file()) { + set_has_mean_file(); + mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_); + } + if (from.has_crop_size()) { + set_crop_size(from.crop_size()); + } + if (from.has_mirror()) { + set_mirror(from.mirror()); + } + if (from.has_root_folder()) { + set_has_root_folder(); + root_folder_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_folder_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ImageDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ImageDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ImageDataParameter::CopyFrom(const ImageDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ImageDataParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ImageDataParameter::IsInitialized() const { + + return true; +} + +void ImageDataParameter::Swap(ImageDataParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ImageDataParameter::InternalSwap(ImageDataParameter* other) { + source_.Swap(&other->source_); + std::swap(batch_size_, other->batch_size_); + std::swap(rand_skip_, other->rand_skip_); + std::swap(shuffle_, other->shuffle_); + std::swap(new_height_, other->new_height_); + std::swap(new_width_, other->new_width_); + std::swap(is_color_, other->is_color_); + std::swap(scale_, other->scale_); + mean_file_.Swap(&other->mean_file_); + std::swap(crop_size_, other->crop_size_); + std::swap(mirror_, other->mirror_); + root_folder_.Swap(&other->root_folder_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ImageDataParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ImageDataParameter_descriptor_; + metadata.reflection = ImageDataParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ImageDataParameter + +// optional string source = 1; +bool ImageDataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ImageDataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +void ImageDataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +void ImageDataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +const ::std::string& ImageDataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ImageDataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.source) +} +void ImageDataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ImageDataParameter.source) +} +void ImageDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ImageDataParameter.source) +} +::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.ImageDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ImageDataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.ImageDataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ImageDataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.ImageDataParameter.source) +} + +// optional uint32 batch_size = 4 [default = 1]; +bool ImageDataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ImageDataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000002u; +} +void ImageDataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000002u; +} +void ImageDataParameter::clear_batch_size() { + batch_size_ = 1u; + clear_has_batch_size(); +} +::google::protobuf::uint32 ImageDataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.batch_size) + return batch_size_; +} +void ImageDataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.batch_size) +} + +// optional uint32 rand_skip = 7 [default = 0]; +bool ImageDataParameter::has_rand_skip() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ImageDataParameter::set_has_rand_skip() { + _has_bits_[0] |= 0x00000004u; +} +void ImageDataParameter::clear_has_rand_skip() { + _has_bits_[0] &= ~0x00000004u; +} +void ImageDataParameter::clear_rand_skip() { + rand_skip_ = 0u; + clear_has_rand_skip(); +} +::google::protobuf::uint32 ImageDataParameter::rand_skip() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.rand_skip) + return rand_skip_; +} +void ImageDataParameter::set_rand_skip(::google::protobuf::uint32 value) { + set_has_rand_skip(); + rand_skip_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.rand_skip) +} + +// optional bool shuffle = 8 [default = false]; +bool ImageDataParameter::has_shuffle() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void ImageDataParameter::set_has_shuffle() { + _has_bits_[0] |= 0x00000008u; +} +void ImageDataParameter::clear_has_shuffle() { + _has_bits_[0] &= ~0x00000008u; +} +void ImageDataParameter::clear_shuffle() { + shuffle_ = false; + clear_has_shuffle(); +} +bool ImageDataParameter::shuffle() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.shuffle) + return shuffle_; +} +void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.shuffle) +} + +// optional uint32 new_height = 9 [default = 0]; +bool ImageDataParameter::has_new_height() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void ImageDataParameter::set_has_new_height() { + _has_bits_[0] |= 0x00000010u; +} +void ImageDataParameter::clear_has_new_height() { + _has_bits_[0] &= ~0x00000010u; +} +void ImageDataParameter::clear_new_height() { + new_height_ = 0u; + clear_has_new_height(); +} +::google::protobuf::uint32 ImageDataParameter::new_height() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.new_height) + return new_height_; +} +void ImageDataParameter::set_new_height(::google::protobuf::uint32 value) { + set_has_new_height(); + new_height_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.new_height) +} + +// optional uint32 new_width = 10 [default = 0]; +bool ImageDataParameter::has_new_width() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void ImageDataParameter::set_has_new_width() { + _has_bits_[0] |= 0x00000020u; +} +void ImageDataParameter::clear_has_new_width() { + _has_bits_[0] &= ~0x00000020u; +} +void ImageDataParameter::clear_new_width() { + new_width_ = 0u; + clear_has_new_width(); +} +::google::protobuf::uint32 ImageDataParameter::new_width() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.new_width) + return new_width_; +} +void ImageDataParameter::set_new_width(::google::protobuf::uint32 value) { + set_has_new_width(); + new_width_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.new_width) +} + +// optional bool is_color = 11 [default = true]; +bool ImageDataParameter::has_is_color() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void ImageDataParameter::set_has_is_color() { + _has_bits_[0] |= 0x00000040u; +} +void ImageDataParameter::clear_has_is_color() { + _has_bits_[0] &= ~0x00000040u; +} +void ImageDataParameter::clear_is_color() { + is_color_ = true; + clear_has_is_color(); +} +bool ImageDataParameter::is_color() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.is_color) + return is_color_; +} +void ImageDataParameter::set_is_color(bool value) { + set_has_is_color(); + is_color_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.is_color) +} + +// optional float scale = 2 [default = 1]; +bool ImageDataParameter::has_scale() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void ImageDataParameter::set_has_scale() { + _has_bits_[0] |= 0x00000080u; +} +void ImageDataParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000080u; +} +void ImageDataParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float ImageDataParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.scale) + return scale_; +} +void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.scale) +} + +// optional string mean_file = 3; +bool ImageDataParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void ImageDataParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000100u; +} +void ImageDataParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000100u; +} +void ImageDataParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +const ::std::string& ImageDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ImageDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.mean_file) +} +void ImageDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ImageDataParameter.mean_file) +} +void ImageDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ImageDataParameter.mean_file) +} +::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.ImageDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ImageDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.ImageDataParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ImageDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.ImageDataParameter.mean_file) +} + +// optional uint32 crop_size = 5 [default = 0]; +bool ImageDataParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void ImageDataParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000200u; +} +void ImageDataParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000200u; +} +void ImageDataParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +::google::protobuf::uint32 ImageDataParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.crop_size) + return crop_size_; +} +void ImageDataParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.crop_size) +} + +// optional bool mirror = 6 [default = false]; +bool ImageDataParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void ImageDataParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000400u; +} +void ImageDataParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000400u; +} +void ImageDataParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +bool ImageDataParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.mirror) + return mirror_; +} +void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.mirror) +} + +// optional string root_folder = 12 [default = ""]; +bool ImageDataParameter::has_root_folder() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void ImageDataParameter::set_has_root_folder() { + _has_bits_[0] |= 0x00000800u; +} +void ImageDataParameter::clear_has_root_folder() { + _has_bits_[0] &= ~0x00000800u; +} +void ImageDataParameter::clear_root_folder() { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_root_folder(); +} +const ::std::string& ImageDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.root_folder) + return root_folder_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ImageDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.root_folder) +} +void ImageDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ImageDataParameter.root_folder) +} +void ImageDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ImageDataParameter.root_folder) +} +::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:caffe.ImageDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* ImageDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:caffe.ImageDataParameter.root_folder) + clear_has_root_folder(); + return root_folder_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void ImageDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder != NULL) { + set_has_root_folder(); + } else { + clear_has_root_folder(); + } + root_folder_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root_folder); + // @@protoc_insertion_point(field_set_allocated:caffe.ImageDataParameter.root_folder) +} + +inline const ImageDataParameter* ImageDataParameter::internal_default_instance() { + return &ImageDataParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InfogainLossParameter::kSourceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InfogainLossParameter::InfogainLossParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.InfogainLossParameter) +} + +void InfogainLossParameter::InitAsDefaultInstance() { +} + +InfogainLossParameter::InfogainLossParameter(const InfogainLossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.InfogainLossParameter) +} + +void InfogainLossParameter::SharedCtor() { + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +InfogainLossParameter::~InfogainLossParameter() { + // @@protoc_insertion_point(destructor:caffe.InfogainLossParameter) + SharedDtor(); +} + +void InfogainLossParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void InfogainLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* InfogainLossParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return InfogainLossParameter_descriptor_; +} + +const InfogainLossParameter& InfogainLossParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed InfogainLossParameter_default_instance_; + +InfogainLossParameter* InfogainLossParameter::New(::google::protobuf::Arena* arena) const { + InfogainLossParameter* n = new InfogainLossParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void InfogainLossParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.InfogainLossParameter) + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool InfogainLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.InfogainLossParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string source = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.InfogainLossParameter.source"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.InfogainLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.InfogainLossParameter) + return false; +#undef DO_ +} + +void InfogainLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.InfogainLossParameter.source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.InfogainLossParameter) +} + +::google::protobuf::uint8* InfogainLossParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.InfogainLossParameter.source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->source(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.InfogainLossParameter) + return target; +} + +size_t InfogainLossParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.InfogainLossParameter) + size_t total_size = 0; + + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InfogainLossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.InfogainLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const InfogainLossParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.InfogainLossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.InfogainLossParameter) + UnsafeMergeFrom(*source); + } +} + +void InfogainLossParameter::MergeFrom(const InfogainLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.InfogainLossParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void InfogainLossParameter::UnsafeMergeFrom(const InfogainLossParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void InfogainLossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.InfogainLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InfogainLossParameter::CopyFrom(const InfogainLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.InfogainLossParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool InfogainLossParameter::IsInitialized() const { + + return true; +} + +void InfogainLossParameter::Swap(InfogainLossParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void InfogainLossParameter::InternalSwap(InfogainLossParameter* other) { + source_.Swap(&other->source_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata InfogainLossParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = InfogainLossParameter_descriptor_; + metadata.reflection = InfogainLossParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// InfogainLossParameter + +// optional string source = 1; +bool InfogainLossParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void InfogainLossParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +void InfogainLossParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +void InfogainLossParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +const ::std::string& InfogainLossParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.InfogainLossParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void InfogainLossParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.InfogainLossParameter.source) +} +void InfogainLossParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.InfogainLossParameter.source) +} +void InfogainLossParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.InfogainLossParameter.source) +} +::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.InfogainLossParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* InfogainLossParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.InfogainLossParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void InfogainLossParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.InfogainLossParameter.source) +} + +inline const InfogainLossParameter* InfogainLossParameter::internal_default_instance() { + return &InfogainLossParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InnerProductParameter::kNumOutputFieldNumber; +const int InnerProductParameter::kBiasTermFieldNumber; +const int InnerProductParameter::kWeightFillerFieldNumber; +const int InnerProductParameter::kBiasFillerFieldNumber; +const int InnerProductParameter::kAxisFieldNumber; +const int InnerProductParameter::kTransposeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InnerProductParameter::InnerProductParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.InnerProductParameter) +} + +void InnerProductParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + bias_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +InnerProductParameter::InnerProductParameter(const InnerProductParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.InnerProductParameter) +} + +void InnerProductParameter::SharedCtor() { + _cached_size_ = 0; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(&num_output_, 0, reinterpret_cast(&transpose_) - + reinterpret_cast(&num_output_) + sizeof(transpose_)); + bias_term_ = true; + axis_ = 1; +} + +InnerProductParameter::~InnerProductParameter() { + // @@protoc_insertion_point(destructor:caffe.InnerProductParameter) + SharedDtor(); +} + +void InnerProductParameter::SharedDtor() { + if (this != &InnerProductParameter_default_instance_.get()) { + delete weight_filler_; + delete bias_filler_; + } +} + +void InnerProductParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* InnerProductParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return InnerProductParameter_descriptor_; +} + +const InnerProductParameter& InnerProductParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed InnerProductParameter_default_instance_; + +InnerProductParameter* InnerProductParameter::New(::google::protobuf::Arena* arena) const { + InnerProductParameter* n = new InnerProductParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void InnerProductParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.InnerProductParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(InnerProductParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 63u) { + ZR_(num_output_, transpose_); + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + } + axis_ = 1; + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool InnerProductParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.InnerProductParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 num_output = 1; + case 1: { + if (tag == 8) { + set_has_num_output(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_bias_term; + break; + } + + // optional bool bias_term = 2 [default = true]; + case 2: { + if (tag == 16) { + parse_bias_term: + set_has_bias_term(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_weight_filler; + break; + } + + // optional .caffe.FillerParameter weight_filler = 3; + case 3: { + if (tag == 26) { + parse_weight_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_weight_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_bias_filler; + break; + } + + // optional .caffe.FillerParameter bias_filler = 4; + case 4: { + if (tag == 34) { + parse_bias_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_axis; + break; + } + + // optional int32 axis = 5 [default = 1]; + case 5: { + if (tag == 40) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_transpose; + break; + } + + // optional bool transpose = 6 [default = false]; + case 6: { + if (tag == 48) { + parse_transpose: + set_has_transpose(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &transpose_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.InnerProductParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.InnerProductParameter) + return false; +#undef DO_ +} + +void InnerProductParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.InnerProductParameter) + // optional uint32 num_output = 1; + if (has_num_output()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output); + } + + // optional bool bias_term = 2 [default = true]; + if (has_bias_term()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->bias_term(), output); + } + + // optional .caffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->weight_filler_, output); + } + + // optional .caffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *this->bias_filler_, output); + } + + // optional int32 axis = 5 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->axis(), output); + } + + // optional bool transpose = 6 [default = false]; + if (has_transpose()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->transpose(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.InnerProductParameter) +} + +::google::protobuf::uint8* InnerProductParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.InnerProductParameter) + // optional uint32 num_output = 1; + if (has_num_output()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target); + } + + // optional bool bias_term = 2 [default = true]; + if (has_bias_term()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->bias_term(), target); + } + + // optional .caffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *this->weight_filler_, false, target); + } + + // optional .caffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *this->bias_filler_, false, target); + } + + // optional int32 axis = 5 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->axis(), target); + } + + // optional bool transpose = 6 [default = false]; + if (has_transpose()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->transpose(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.InnerProductParameter) + return target; +} + +size_t InnerProductParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.InnerProductParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 63u) { + // optional uint32 num_output = 1; + if (has_num_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_output()); + } + + // optional bool bias_term = 2 [default = true]; + if (has_bias_term()) { + total_size += 1 + 1; + } + + // optional .caffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .caffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + // optional int32 axis = 5 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional bool transpose = 6 [default = false]; + if (has_transpose()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InnerProductParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.InnerProductParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const InnerProductParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.InnerProductParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.InnerProductParameter) + UnsafeMergeFrom(*source); + } +} + +void InnerProductParameter::MergeFrom(const InnerProductParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.InnerProductParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void InnerProductParameter::UnsafeMergeFrom(const InnerProductParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_output()) { + set_num_output(from.num_output()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_weight_filler()) { + mutable_weight_filler()->::caffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::caffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_transpose()) { + set_transpose(from.transpose()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void InnerProductParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.InnerProductParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InnerProductParameter::CopyFrom(const InnerProductParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.InnerProductParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool InnerProductParameter::IsInitialized() const { + + return true; +} + +void InnerProductParameter::Swap(InnerProductParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void InnerProductParameter::InternalSwap(InnerProductParameter* other) { + std::swap(num_output_, other->num_output_); + std::swap(bias_term_, other->bias_term_); + std::swap(weight_filler_, other->weight_filler_); + std::swap(bias_filler_, other->bias_filler_); + std::swap(axis_, other->axis_); + std::swap(transpose_, other->transpose_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata InnerProductParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = InnerProductParameter_descriptor_; + metadata.reflection = InnerProductParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// InnerProductParameter + +// optional uint32 num_output = 1; +bool InnerProductParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void InnerProductParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +void InnerProductParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +void InnerProductParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +::google::protobuf::uint32 InnerProductParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.num_output) + return num_output_; +} +void InnerProductParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.num_output) +} + +// optional bool bias_term = 2 [default = true]; +bool InnerProductParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void InnerProductParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000002u; +} +void InnerProductParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000002u; +} +void InnerProductParameter::clear_bias_term() { + bias_term_ = true; + clear_has_bias_term(); +} +bool InnerProductParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.bias_term) + return bias_term_; +} +void InnerProductParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.bias_term) +} + +// optional .caffe.FillerParameter weight_filler = 3; +bool InnerProductParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void InnerProductParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000004u; +} +void InnerProductParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000004u; +} +void InnerProductParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::caffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +::caffe::FillerParameter* InnerProductParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.InnerProductParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void InnerProductParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.InnerProductParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 4; +bool InnerProductParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void InnerProductParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000008u; +} +void InnerProductParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000008u; +} +void InnerProductParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::caffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +::caffe::FillerParameter* InnerProductParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.InnerProductParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void InnerProductParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.InnerProductParameter.bias_filler) +} + +// optional int32 axis = 5 [default = 1]; +bool InnerProductParameter::has_axis() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void InnerProductParameter::set_has_axis() { + _has_bits_[0] |= 0x00000010u; +} +void InnerProductParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000010u; +} +void InnerProductParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 InnerProductParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.axis) + return axis_; +} +void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.axis) +} + +// optional bool transpose = 6 [default = false]; +bool InnerProductParameter::has_transpose() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void InnerProductParameter::set_has_transpose() { + _has_bits_[0] |= 0x00000020u; +} +void InnerProductParameter::clear_has_transpose() { + _has_bits_[0] &= ~0x00000020u; +} +void InnerProductParameter::clear_transpose() { + transpose_ = false; + clear_has_transpose(); +} +bool InnerProductParameter::transpose() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.transpose) + return transpose_; +} +void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.transpose) +} + +inline const InnerProductParameter* InnerProductParameter::internal_default_instance() { + return &InnerProductParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InputParameter::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InputParameter::InputParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.InputParameter) +} + +void InputParameter::InitAsDefaultInstance() { +} + +InputParameter::InputParameter(const InputParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.InputParameter) +} + +void InputParameter::SharedCtor() { + _cached_size_ = 0; +} + +InputParameter::~InputParameter() { + // @@protoc_insertion_point(destructor:caffe.InputParameter) + SharedDtor(); +} + +void InputParameter::SharedDtor() { +} + +void InputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* InputParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return InputParameter_descriptor_; +} + +const InputParameter& InputParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed InputParameter_default_instance_; + +InputParameter* InputParameter::New(::google::protobuf::Arena* arena) const { + InputParameter* n = new InputParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void InputParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.InputParameter) + shape_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool InputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.InputParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .caffe.BlobShape shape = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_shape; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.InputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.InputParameter) + return false; +#undef DO_ +} + +void InputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.InputParameter) + // repeated .caffe.BlobShape shape = 1; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->shape(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.InputParameter) +} + +::google::protobuf::uint8* InputParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.InputParameter) + // repeated .caffe.BlobShape shape = 1; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->shape(i), false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.InputParameter) + return target; +} + +size_t InputParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.InputParameter) + size_t total_size = 0; + + // repeated .caffe.BlobShape shape = 1; + { + unsigned int count = this->shape_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InputParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.InputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const InputParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.InputParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.InputParameter) + UnsafeMergeFrom(*source); + } +} + +void InputParameter::MergeFrom(const InputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.InputParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void InputParameter::UnsafeMergeFrom(const InputParameter& from) { + GOOGLE_DCHECK(&from != this); + shape_.MergeFrom(from.shape_); + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void InputParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.InputParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InputParameter::CopyFrom(const InputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.InputParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool InputParameter::IsInitialized() const { + + return true; +} + +void InputParameter::Swap(InputParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void InputParameter::InternalSwap(InputParameter* other) { + shape_.UnsafeArenaSwap(&other->shape_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata InputParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = InputParameter_descriptor_; + metadata.reflection = InputParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// InputParameter + +// repeated .caffe.BlobShape shape = 1; +int InputParameter::shape_size() const { + return shape_.size(); +} +void InputParameter::clear_shape() { + shape_.Clear(); +} +const ::caffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:caffe.InputParameter.shape) + return shape_.Get(index); +} +::caffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:caffe.InputParameter.shape) + return shape_.Mutable(index); +} +::caffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:caffe.InputParameter.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:caffe.InputParameter.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:caffe.InputParameter.shape) + return shape_; +} + +inline const InputParameter* InputParameter::internal_default_instance() { + return &InputParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LogParameter::kBaseFieldNumber; +const int LogParameter::kScaleFieldNumber; +const int LogParameter::kShiftFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LogParameter::LogParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.LogParameter) +} + +void LogParameter::InitAsDefaultInstance() { +} + +LogParameter::LogParameter(const LogParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.LogParameter) +} + +void LogParameter::SharedCtor() { + _cached_size_ = 0; + shift_ = 0; + base_ = -1; + scale_ = 1; +} + +LogParameter::~LogParameter() { + // @@protoc_insertion_point(destructor:caffe.LogParameter) + SharedDtor(); +} + +void LogParameter::SharedDtor() { +} + +void LogParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LogParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LogParameter_descriptor_; +} + +const LogParameter& LogParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed LogParameter_default_instance_; + +LogParameter* LogParameter::New(::google::protobuf::Arena* arena) const { + LogParameter* n = new LogParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void LogParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.LogParameter) + if (_has_bits_[0 / 32] & 7u) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool LogParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.LogParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float base = 1 [default = -1]; + case 1: { + if (tag == 13) { + set_has_base(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_scale; + break; + } + + // optional float scale = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_shift; + break; + } + + // optional float shift = 3 [default = 0]; + case 3: { + if (tag == 29) { + parse_shift: + set_has_shift(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.LogParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.LogParameter) + return false; +#undef DO_ +} + +void LogParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.LogParameter) + // optional float base = 1 [default = -1]; + if (has_base()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->base(), output); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output); + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->shift(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.LogParameter) +} + +::google::protobuf::uint8* LogParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.LogParameter) + // optional float base = 1 [default = -1]; + if (has_base()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->base(), target); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target); + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->shift(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.LogParameter) + return target; +} + +size_t LogParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.LogParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional float base = 1 [default = -1]; + if (has_base()) { + total_size += 1 + 4; + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LogParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.LogParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const LogParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.LogParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.LogParameter) + UnsafeMergeFrom(*source); + } +} + +void LogParameter::MergeFrom(const LogParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.LogParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void LogParameter::UnsafeMergeFrom(const LogParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_base()) { + set_base(from.base()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_shift()) { + set_shift(from.shift()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void LogParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.LogParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LogParameter::CopyFrom(const LogParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.LogParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool LogParameter::IsInitialized() const { + + return true; +} + +void LogParameter::Swap(LogParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void LogParameter::InternalSwap(LogParameter* other) { + std::swap(base_, other->base_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata LogParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LogParameter_descriptor_; + metadata.reflection = LogParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// LogParameter + +// optional float base = 1 [default = -1]; +bool LogParameter::has_base() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void LogParameter::set_has_base() { + _has_bits_[0] |= 0x00000001u; +} +void LogParameter::clear_has_base() { + _has_bits_[0] &= ~0x00000001u; +} +void LogParameter::clear_base() { + base_ = -1; + clear_has_base(); +} +float LogParameter::base() const { + // @@protoc_insertion_point(field_get:caffe.LogParameter.base) + return base_; +} +void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:caffe.LogParameter.base) +} + +// optional float scale = 2 [default = 1]; +bool LogParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void LogParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +void LogParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +void LogParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float LogParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.LogParameter.scale) + return scale_; +} +void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.LogParameter.scale) +} + +// optional float shift = 3 [default = 0]; +bool LogParameter::has_shift() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void LogParameter::set_has_shift() { + _has_bits_[0] |= 0x00000004u; +} +void LogParameter::clear_has_shift() { + _has_bits_[0] &= ~0x00000004u; +} +void LogParameter::clear_shift() { + shift_ = 0; + clear_has_shift(); +} +float LogParameter::shift() const { + // @@protoc_insertion_point(field_get:caffe.LogParameter.shift) + return shift_; +} +void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:caffe.LogParameter.shift) +} + +inline const LogParameter* LogParameter::internal_default_instance() { + return &LogParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* LRNParameter_NormRegion_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LRNParameter_NormRegion_descriptor_; +} +bool LRNParameter_NormRegion_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LRNParameter_NormRegion LRNParameter::ACROSS_CHANNELS; +const LRNParameter_NormRegion LRNParameter::WITHIN_CHANNEL; +const LRNParameter_NormRegion LRNParameter::NormRegion_MIN; +const LRNParameter_NormRegion LRNParameter::NormRegion_MAX; +const int LRNParameter::NormRegion_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* LRNParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LRNParameter_Engine_descriptor_; +} +bool LRNParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const LRNParameter_Engine LRNParameter::DEFAULT; +const LRNParameter_Engine LRNParameter::CAFFE; +const LRNParameter_Engine LRNParameter::CUDNN; +const LRNParameter_Engine LRNParameter::Engine_MIN; +const LRNParameter_Engine LRNParameter::Engine_MAX; +const int LRNParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int LRNParameter::kLocalSizeFieldNumber; +const int LRNParameter::kAlphaFieldNumber; +const int LRNParameter::kBetaFieldNumber; +const int LRNParameter::kNormRegionFieldNumber; +const int LRNParameter::kKFieldNumber; +const int LRNParameter::kEngineFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +LRNParameter::LRNParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.LRNParameter) +} + +void LRNParameter::InitAsDefaultInstance() { +} + +LRNParameter::LRNParameter(const LRNParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.LRNParameter) +} + +void LRNParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&norm_region_, 0, reinterpret_cast(&engine_) - + reinterpret_cast(&norm_region_) + sizeof(engine_)); + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; +} + +LRNParameter::~LRNParameter() { + // @@protoc_insertion_point(destructor:caffe.LRNParameter) + SharedDtor(); +} + +void LRNParameter::SharedDtor() { +} + +void LRNParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LRNParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LRNParameter_descriptor_; +} + +const LRNParameter& LRNParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed LRNParameter_default_instance_; + +LRNParameter* LRNParameter::New(::google::protobuf::Arena* arena) const { + LRNParameter* n = new LRNParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void LRNParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.LRNParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(LRNParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 63u) { + ZR_(norm_region_, engine_); + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool LRNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.LRNParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 local_size = 1 [default = 5]; + case 1: { + if (tag == 8) { + set_has_local_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_alpha; + break; + } + + // optional float alpha = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_alpha: + set_has_alpha(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_beta; + break; + } + + // optional float beta = 3 [default = 0.75]; + case 3: { + if (tag == 29) { + parse_beta: + set_has_beta(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_norm_region; + break; + } + + // optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + case 4: { + if (tag == 32) { + parse_norm_region: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::LRNParameter_NormRegion_IsValid(value)) { + set_norm_region(static_cast< ::caffe::LRNParameter_NormRegion >(value)); + } else { + mutable_unknown_fields()->AddVarint(4, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(45)) goto parse_k; + break; + } + + // optional float k = 5 [default = 1]; + case 5: { + if (tag == 45) { + parse_k: + set_has_k(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + case 6: { + if (tag == 48) { + parse_engine: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::LRNParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::LRNParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(6, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.LRNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.LRNParameter) + return false; +#undef DO_ +} + +void LRNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.LRNParameter) + // optional uint32 local_size = 1 [default = 5]; + if (has_local_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->local_size(), output); + } + + // optional float alpha = 2 [default = 1]; + if (has_alpha()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->alpha(), output); + } + + // optional float beta = 3 [default = 0.75]; + if (has_beta()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->beta(), output); + } + + // optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + if (has_norm_region()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->norm_region(), output); + } + + // optional float k = 5 [default = 1]; + if (has_k()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->k(), output); + } + + // optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.LRNParameter) +} + +::google::protobuf::uint8* LRNParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.LRNParameter) + // optional uint32 local_size = 1 [default = 5]; + if (has_local_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->local_size(), target); + } + + // optional float alpha = 2 [default = 1]; + if (has_alpha()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->alpha(), target); + } + + // optional float beta = 3 [default = 0.75]; + if (has_beta()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->beta(), target); + } + + // optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + if (has_norm_region()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->norm_region(), target); + } + + // optional float k = 5 [default = 1]; + if (has_k()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->k(), target); + } + + // optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->engine(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.LRNParameter) + return target; +} + +size_t LRNParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.LRNParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 63u) { + // optional uint32 local_size = 1 [default = 5]; + if (has_local_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->local_size()); + } + + // optional float alpha = 2 [default = 1]; + if (has_alpha()) { + total_size += 1 + 4; + } + + // optional float beta = 3 [default = 0.75]; + if (has_beta()) { + total_size += 1 + 4; + } + + // optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + if (has_norm_region()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm_region()); + } + + // optional float k = 5 [default = 1]; + if (has_k()) { + total_size += 1 + 4; + } + + // optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LRNParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.LRNParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const LRNParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.LRNParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.LRNParameter) + UnsafeMergeFrom(*source); + } +} + +void LRNParameter::MergeFrom(const LRNParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.LRNParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void LRNParameter::UnsafeMergeFrom(const LRNParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_local_size()) { + set_local_size(from.local_size()); + } + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + if (from.has_beta()) { + set_beta(from.beta()); + } + if (from.has_norm_region()) { + set_norm_region(from.norm_region()); + } + if (from.has_k()) { + set_k(from.k()); + } + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void LRNParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.LRNParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LRNParameter::CopyFrom(const LRNParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.LRNParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool LRNParameter::IsInitialized() const { + + return true; +} + +void LRNParameter::Swap(LRNParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void LRNParameter::InternalSwap(LRNParameter* other) { + std::swap(local_size_, other->local_size_); + std::swap(alpha_, other->alpha_); + std::swap(beta_, other->beta_); + std::swap(norm_region_, other->norm_region_); + std::swap(k_, other->k_); + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata LRNParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LRNParameter_descriptor_; + metadata.reflection = LRNParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// LRNParameter + +// optional uint32 local_size = 1 [default = 5]; +bool LRNParameter::has_local_size() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void LRNParameter::set_has_local_size() { + _has_bits_[0] |= 0x00000001u; +} +void LRNParameter::clear_has_local_size() { + _has_bits_[0] &= ~0x00000001u; +} +void LRNParameter::clear_local_size() { + local_size_ = 5u; + clear_has_local_size(); +} +::google::protobuf::uint32 LRNParameter::local_size() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.local_size) + return local_size_; +} +void LRNParameter::set_local_size(::google::protobuf::uint32 value) { + set_has_local_size(); + local_size_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.local_size) +} + +// optional float alpha = 2 [default = 1]; +bool LRNParameter::has_alpha() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void LRNParameter::set_has_alpha() { + _has_bits_[0] |= 0x00000002u; +} +void LRNParameter::clear_has_alpha() { + _has_bits_[0] &= ~0x00000002u; +} +void LRNParameter::clear_alpha() { + alpha_ = 1; + clear_has_alpha(); +} +float LRNParameter::alpha() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.alpha) + return alpha_; +} +void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.alpha) +} + +// optional float beta = 3 [default = 0.75]; +bool LRNParameter::has_beta() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void LRNParameter::set_has_beta() { + _has_bits_[0] |= 0x00000004u; +} +void LRNParameter::clear_has_beta() { + _has_bits_[0] &= ~0x00000004u; +} +void LRNParameter::clear_beta() { + beta_ = 0.75f; + clear_has_beta(); +} +float LRNParameter::beta() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.beta) + return beta_; +} +void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.beta) +} + +// optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; +bool LRNParameter::has_norm_region() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void LRNParameter::set_has_norm_region() { + _has_bits_[0] |= 0x00000008u; +} +void LRNParameter::clear_has_norm_region() { + _has_bits_[0] &= ~0x00000008u; +} +void LRNParameter::clear_norm_region() { + norm_region_ = 0; + clear_has_norm_region(); +} +::caffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.norm_region) + return static_cast< ::caffe::LRNParameter_NormRegion >(norm_region_); +} +void LRNParameter::set_norm_region(::caffe::LRNParameter_NormRegion value) { + assert(::caffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.norm_region) +} + +// optional float k = 5 [default = 1]; +bool LRNParameter::has_k() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void LRNParameter::set_has_k() { + _has_bits_[0] |= 0x00000010u; +} +void LRNParameter::clear_has_k() { + _has_bits_[0] &= ~0x00000010u; +} +void LRNParameter::clear_k() { + k_ = 1; + clear_has_k(); +} +float LRNParameter::k() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.k) + return k_; +} +void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.k) +} + +// optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; +bool LRNParameter::has_engine() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void LRNParameter::set_has_engine() { + _has_bits_[0] |= 0x00000020u; +} +void LRNParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000020u; +} +void LRNParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.engine) + return static_cast< ::caffe::LRNParameter_Engine >(engine_); +} +void LRNParameter::set_engine(::caffe::LRNParameter_Engine value) { + assert(::caffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.engine) +} + +inline const LRNParameter* LRNParameter::internal_default_instance() { + return &LRNParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MemoryDataParameter::kBatchSizeFieldNumber; +const int MemoryDataParameter::kChannelsFieldNumber; +const int MemoryDataParameter::kHeightFieldNumber; +const int MemoryDataParameter::kWidthFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MemoryDataParameter::MemoryDataParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.MemoryDataParameter) +} + +void MemoryDataParameter::InitAsDefaultInstance() { +} + +MemoryDataParameter::MemoryDataParameter(const MemoryDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.MemoryDataParameter) +} + +void MemoryDataParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&batch_size_, 0, reinterpret_cast(&width_) - + reinterpret_cast(&batch_size_) + sizeof(width_)); +} + +MemoryDataParameter::~MemoryDataParameter() { + // @@protoc_insertion_point(destructor:caffe.MemoryDataParameter) + SharedDtor(); +} + +void MemoryDataParameter::SharedDtor() { +} + +void MemoryDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MemoryDataParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MemoryDataParameter_descriptor_; +} + +const MemoryDataParameter& MemoryDataParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed MemoryDataParameter_default_instance_; + +MemoryDataParameter* MemoryDataParameter::New(::google::protobuf::Arena* arena) const { + MemoryDataParameter* n = new MemoryDataParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void MemoryDataParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.MemoryDataParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(MemoryDataParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(batch_size_, width_); + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool MemoryDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.MemoryDataParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 batch_size = 1; + case 1: { + if (tag == 8) { + set_has_batch_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_channels; + break; + } + + // optional uint32 channels = 2; + case 2: { + if (tag == 16) { + parse_channels: + set_has_channels(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &channels_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_height; + break; + } + + // optional uint32 height = 3; + case 3: { + if (tag == 24) { + parse_height: + set_has_height(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &height_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_width; + break; + } + + // optional uint32 width = 4; + case 4: { + if (tag == 32) { + parse_width: + set_has_width(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &width_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.MemoryDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.MemoryDataParameter) + return false; +#undef DO_ +} + +void MemoryDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.MemoryDataParameter) + // optional uint32 batch_size = 1; + if (has_batch_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->batch_size(), output); + } + + // optional uint32 channels = 2; + if (has_channels()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->channels(), output); + } + + // optional uint32 height = 3; + if (has_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->height(), output); + } + + // optional uint32 width = 4; + if (has_width()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->width(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.MemoryDataParameter) +} + +::google::protobuf::uint8* MemoryDataParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.MemoryDataParameter) + // optional uint32 batch_size = 1; + if (has_batch_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->batch_size(), target); + } + + // optional uint32 channels = 2; + if (has_channels()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->channels(), target); + } + + // optional uint32 height = 3; + if (has_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->height(), target); + } + + // optional uint32 width = 4; + if (has_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->width(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.MemoryDataParameter) + return target; +} + +size_t MemoryDataParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.MemoryDataParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 15u) { + // optional uint32 batch_size = 1; + if (has_batch_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_size()); + } + + // optional uint32 channels = 2; + if (has_channels()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->channels()); + } + + // optional uint32 height = 3; + if (has_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->height()); + } + + // optional uint32 width = 4; + if (has_width()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->width()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MemoryDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.MemoryDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const MemoryDataParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.MemoryDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.MemoryDataParameter) + UnsafeMergeFrom(*source); + } +} + +void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.MemoryDataParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void MemoryDataParameter::UnsafeMergeFrom(const MemoryDataParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_channels()) { + set_channels(from.channels()); + } + if (from.has_height()) { + set_height(from.height()); + } + if (from.has_width()) { + set_width(from.width()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void MemoryDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.MemoryDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryDataParameter::CopyFrom(const MemoryDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.MemoryDataParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool MemoryDataParameter::IsInitialized() const { + + return true; +} + +void MemoryDataParameter::Swap(MemoryDataParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void MemoryDataParameter::InternalSwap(MemoryDataParameter* other) { + std::swap(batch_size_, other->batch_size_); + std::swap(channels_, other->channels_); + std::swap(height_, other->height_); + std::swap(width_, other->width_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata MemoryDataParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MemoryDataParameter_descriptor_; + metadata.reflection = MemoryDataParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// MemoryDataParameter + +// optional uint32 batch_size = 1; +bool MemoryDataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void MemoryDataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000001u; +} +void MemoryDataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000001u; +} +void MemoryDataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +::google::protobuf::uint32 MemoryDataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.batch_size) + return batch_size_; +} +void MemoryDataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.batch_size) +} + +// optional uint32 channels = 2; +bool MemoryDataParameter::has_channels() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void MemoryDataParameter::set_has_channels() { + _has_bits_[0] |= 0x00000002u; +} +void MemoryDataParameter::clear_has_channels() { + _has_bits_[0] &= ~0x00000002u; +} +void MemoryDataParameter::clear_channels() { + channels_ = 0u; + clear_has_channels(); +} +::google::protobuf::uint32 MemoryDataParameter::channels() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.channels) + return channels_; +} +void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.channels) +} + +// optional uint32 height = 3; +bool MemoryDataParameter::has_height() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void MemoryDataParameter::set_has_height() { + _has_bits_[0] |= 0x00000004u; +} +void MemoryDataParameter::clear_has_height() { + _has_bits_[0] &= ~0x00000004u; +} +void MemoryDataParameter::clear_height() { + height_ = 0u; + clear_has_height(); +} +::google::protobuf::uint32 MemoryDataParameter::height() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.height) + return height_; +} +void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.height) +} + +// optional uint32 width = 4; +bool MemoryDataParameter::has_width() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void MemoryDataParameter::set_has_width() { + _has_bits_[0] |= 0x00000008u; +} +void MemoryDataParameter::clear_has_width() { + _has_bits_[0] &= ~0x00000008u; +} +void MemoryDataParameter::clear_width() { + width_ = 0u; + clear_has_width(); +} +::google::protobuf::uint32 MemoryDataParameter::width() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.width) + return width_; +} +void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.width) +} + +inline const MemoryDataParameter* MemoryDataParameter::internal_default_instance() { + return &MemoryDataParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MVNParameter::kNormalizeVarianceFieldNumber; +const int MVNParameter::kAcrossChannelsFieldNumber; +const int MVNParameter::kEpsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MVNParameter::MVNParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.MVNParameter) +} + +void MVNParameter::InitAsDefaultInstance() { +} + +MVNParameter::MVNParameter(const MVNParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.MVNParameter) +} + +void MVNParameter::SharedCtor() { + _cached_size_ = 0; + across_channels_ = false; + normalize_variance_ = true; + eps_ = 1e-09f; +} + +MVNParameter::~MVNParameter() { + // @@protoc_insertion_point(destructor:caffe.MVNParameter) + SharedDtor(); +} + +void MVNParameter::SharedDtor() { +} + +void MVNParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MVNParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MVNParameter_descriptor_; +} + +const MVNParameter& MVNParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed MVNParameter_default_instance_; + +MVNParameter* MVNParameter::New(::google::protobuf::Arena* arena) const { + MVNParameter* n = new MVNParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void MVNParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.MVNParameter) + if (_has_bits_[0 / 32] & 7u) { + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool MVNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.MVNParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool normalize_variance = 1 [default = true]; + case 1: { + if (tag == 8) { + set_has_normalize_variance(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_variance_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_across_channels; + break; + } + + // optional bool across_channels = 2 [default = false]; + case 2: { + if (tag == 16) { + parse_across_channels: + set_has_across_channels(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &across_channels_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_eps; + break; + } + + // optional float eps = 3 [default = 1e-09]; + case 3: { + if (tag == 29) { + parse_eps: + set_has_eps(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.MVNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.MVNParameter) + return false; +#undef DO_ +} + +void MVNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.MVNParameter) + // optional bool normalize_variance = 1 [default = true]; + if (has_normalize_variance()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->normalize_variance(), output); + } + + // optional bool across_channels = 2 [default = false]; + if (has_across_channels()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->across_channels(), output); + } + + // optional float eps = 3 [default = 1e-09]; + if (has_eps()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->eps(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.MVNParameter) +} + +::google::protobuf::uint8* MVNParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.MVNParameter) + // optional bool normalize_variance = 1 [default = true]; + if (has_normalize_variance()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->normalize_variance(), target); + } + + // optional bool across_channels = 2 [default = false]; + if (has_across_channels()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->across_channels(), target); + } + + // optional float eps = 3 [default = 1e-09]; + if (has_eps()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->eps(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.MVNParameter) + return target; +} + +size_t MVNParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.MVNParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional bool normalize_variance = 1 [default = true]; + if (has_normalize_variance()) { + total_size += 1 + 1; + } + + // optional bool across_channels = 2 [default = false]; + if (has_across_channels()) { + total_size += 1 + 1; + } + + // optional float eps = 3 [default = 1e-09]; + if (has_eps()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MVNParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.MVNParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const MVNParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.MVNParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.MVNParameter) + UnsafeMergeFrom(*source); + } +} + +void MVNParameter::MergeFrom(const MVNParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.MVNParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void MVNParameter::UnsafeMergeFrom(const MVNParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_normalize_variance()) { + set_normalize_variance(from.normalize_variance()); + } + if (from.has_across_channels()) { + set_across_channels(from.across_channels()); + } + if (from.has_eps()) { + set_eps(from.eps()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void MVNParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.MVNParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MVNParameter::CopyFrom(const MVNParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.MVNParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool MVNParameter::IsInitialized() const { + + return true; +} + +void MVNParameter::Swap(MVNParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void MVNParameter::InternalSwap(MVNParameter* other) { + std::swap(normalize_variance_, other->normalize_variance_); + std::swap(across_channels_, other->across_channels_); + std::swap(eps_, other->eps_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata MVNParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MVNParameter_descriptor_; + metadata.reflection = MVNParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// MVNParameter + +// optional bool normalize_variance = 1 [default = true]; +bool MVNParameter::has_normalize_variance() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void MVNParameter::set_has_normalize_variance() { + _has_bits_[0] |= 0x00000001u; +} +void MVNParameter::clear_has_normalize_variance() { + _has_bits_[0] &= ~0x00000001u; +} +void MVNParameter::clear_normalize_variance() { + normalize_variance_ = true; + clear_has_normalize_variance(); +} +bool MVNParameter::normalize_variance() const { + // @@protoc_insertion_point(field_get:caffe.MVNParameter.normalize_variance) + return normalize_variance_; +} +void MVNParameter::set_normalize_variance(bool value) { + set_has_normalize_variance(); + normalize_variance_ = value; + // @@protoc_insertion_point(field_set:caffe.MVNParameter.normalize_variance) +} + +// optional bool across_channels = 2 [default = false]; +bool MVNParameter::has_across_channels() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void MVNParameter::set_has_across_channels() { + _has_bits_[0] |= 0x00000002u; +} +void MVNParameter::clear_has_across_channels() { + _has_bits_[0] &= ~0x00000002u; +} +void MVNParameter::clear_across_channels() { + across_channels_ = false; + clear_has_across_channels(); +} +bool MVNParameter::across_channels() const { + // @@protoc_insertion_point(field_get:caffe.MVNParameter.across_channels) + return across_channels_; +} +void MVNParameter::set_across_channels(bool value) { + set_has_across_channels(); + across_channels_ = value; + // @@protoc_insertion_point(field_set:caffe.MVNParameter.across_channels) +} + +// optional float eps = 3 [default = 1e-09]; +bool MVNParameter::has_eps() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void MVNParameter::set_has_eps() { + _has_bits_[0] |= 0x00000004u; +} +void MVNParameter::clear_has_eps() { + _has_bits_[0] &= ~0x00000004u; +} +void MVNParameter::clear_eps() { + eps_ = 1e-09f; + clear_has_eps(); +} +float MVNParameter::eps() const { + // @@protoc_insertion_point(field_get:caffe.MVNParameter.eps) + return eps_; +} +void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:caffe.MVNParameter.eps) +} + +inline const MVNParameter* MVNParameter::internal_default_instance() { + return &MVNParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ParameterParameter::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ParameterParameter::ParameterParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ParameterParameter) +} + +void ParameterParameter::InitAsDefaultInstance() { + shape_ = const_cast< ::caffe::BlobShape*>( + ::caffe::BlobShape::internal_default_instance()); +} + +ParameterParameter::ParameterParameter(const ParameterParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ParameterParameter) +} + +void ParameterParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; +} + +ParameterParameter::~ParameterParameter() { + // @@protoc_insertion_point(destructor:caffe.ParameterParameter) + SharedDtor(); +} + +void ParameterParameter::SharedDtor() { + if (this != &ParameterParameter_default_instance_.get()) { + delete shape_; + } +} + +void ParameterParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ParameterParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ParameterParameter_descriptor_; +} + +const ParameterParameter& ParameterParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ParameterParameter_default_instance_; + +ParameterParameter* ParameterParameter::New(::google::protobuf::Arena* arena) const { + ParameterParameter* n = new ParameterParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ParameterParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ParameterParameter) + if (has_shape()) { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ParameterParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ParameterParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.BlobShape shape = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ParameterParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ParameterParameter) + return false; +#undef DO_ +} + +void ParameterParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ParameterParameter) + // optional .caffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *this->shape_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ParameterParameter) +} + +::google::protobuf::uint8* ParameterParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ParameterParameter) + // optional .caffe.BlobShape shape = 1; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *this->shape_, false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ParameterParameter) + return target; +} + +size_t ParameterParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ParameterParameter) + size_t total_size = 0; + + // optional .caffe.BlobShape shape = 1; + if (has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->shape_); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParameterParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ParameterParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ParameterParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ParameterParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ParameterParameter) + UnsafeMergeFrom(*source); + } +} + +void ParameterParameter::MergeFrom(const ParameterParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ParameterParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ParameterParameter::UnsafeMergeFrom(const ParameterParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::caffe::BlobShape::MergeFrom(from.shape()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ParameterParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ParameterParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ParameterParameter::CopyFrom(const ParameterParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ParameterParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ParameterParameter::IsInitialized() const { + + return true; +} + +void ParameterParameter::Swap(ParameterParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ParameterParameter::InternalSwap(ParameterParameter* other) { + std::swap(shape_, other->shape_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ParameterParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ParameterParameter_descriptor_; + metadata.reflection = ParameterParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ParameterParameter + +// optional .caffe.BlobShape shape = 1; +bool ParameterParameter::has_shape() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ParameterParameter::set_has_shape() { + _has_bits_[0] |= 0x00000001u; +} +void ParameterParameter::clear_has_shape() { + _has_bits_[0] &= ~0x00000001u; +} +void ParameterParameter::clear_shape() { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::caffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:caffe.ParameterParameter.shape) + return shape_ != NULL ? *shape_ + : *::caffe::BlobShape::internal_default_instance(); +} +::caffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::caffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:caffe.ParameterParameter.shape) + return shape_; +} +::caffe::BlobShape* ParameterParameter::release_shape() { + // @@protoc_insertion_point(field_release:caffe.ParameterParameter.shape) + clear_has_shape(); + ::caffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void ParameterParameter::set_allocated_shape(::caffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ParameterParameter.shape) +} + +inline const ParameterParameter* ParameterParameter::internal_default_instance() { + return &ParameterParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* PoolingParameter_PoolMethod_descriptor() { + protobuf_AssignDescriptorsOnce(); + return PoolingParameter_PoolMethod_descriptor_; +} +bool PoolingParameter_PoolMethod_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const PoolingParameter_PoolMethod PoolingParameter::MAX; +const PoolingParameter_PoolMethod PoolingParameter::AVE; +const PoolingParameter_PoolMethod PoolingParameter::STOCHASTIC; +const PoolingParameter_PoolMethod PoolingParameter::PoolMethod_MIN; +const PoolingParameter_PoolMethod PoolingParameter::PoolMethod_MAX; +const int PoolingParameter::PoolMethod_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* PoolingParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return PoolingParameter_Engine_descriptor_; +} +bool PoolingParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const PoolingParameter_Engine PoolingParameter::DEFAULT; +const PoolingParameter_Engine PoolingParameter::CAFFE; +const PoolingParameter_Engine PoolingParameter::CUDNN; +const PoolingParameter_Engine PoolingParameter::Engine_MIN; +const PoolingParameter_Engine PoolingParameter::Engine_MAX; +const int PoolingParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PoolingParameter::kPoolFieldNumber; +const int PoolingParameter::kPadFieldNumber; +const int PoolingParameter::kPadHFieldNumber; +const int PoolingParameter::kPadWFieldNumber; +const int PoolingParameter::kKernelSizeFieldNumber; +const int PoolingParameter::kKernelHFieldNumber; +const int PoolingParameter::kKernelWFieldNumber; +const int PoolingParameter::kStrideFieldNumber; +const int PoolingParameter::kStrideHFieldNumber; +const int PoolingParameter::kStrideWFieldNumber; +const int PoolingParameter::kEngineFieldNumber; +const int PoolingParameter::kGlobalPoolingFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PoolingParameter::PoolingParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.PoolingParameter) +} + +void PoolingParameter::InitAsDefaultInstance() { +} + +PoolingParameter::PoolingParameter(const PoolingParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.PoolingParameter) +} + +void PoolingParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&pool_, 0, reinterpret_cast(&global_pooling_) - + reinterpret_cast(&pool_) + sizeof(global_pooling_)); + stride_ = 1u; +} + +PoolingParameter::~PoolingParameter() { + // @@protoc_insertion_point(destructor:caffe.PoolingParameter) + SharedDtor(); +} + +void PoolingParameter::SharedDtor() { +} + +void PoolingParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PoolingParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PoolingParameter_descriptor_; +} + +const PoolingParameter& PoolingParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed PoolingParameter_default_instance_; + +PoolingParameter* PoolingParameter::New(::google::protobuf::Arena* arena) const { + PoolingParameter* n = new PoolingParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void PoolingParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.PoolingParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(PoolingParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(pool_, kernel_w_); + stride_ = 1u; + } + ZR_(stride_h_, global_pooling_); + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool PoolingParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.PoolingParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::PoolingParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::caffe::PoolingParameter_PoolMethod >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_kernel_size; + break; + } + + // optional uint32 kernel_size = 2; + case 2: { + if (tag == 16) { + parse_kernel_size: + set_has_kernel_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_stride; + break; + } + + // optional uint32 stride = 3 [default = 1]; + case 3: { + if (tag == 24) { + parse_stride: + set_has_stride(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_pad; + break; + } + + // optional uint32 pad = 4 [default = 0]; + case 4: { + if (tag == 32) { + parse_pad: + set_has_pad(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_kernel_h; + break; + } + + // optional uint32 kernel_h = 5; + case 5: { + if (tag == 40) { + parse_kernel_h: + set_has_kernel_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_kernel_w; + break; + } + + // optional uint32 kernel_w = 6; + case 6: { + if (tag == 48) { + parse_kernel_w: + set_has_kernel_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_stride_h; + break; + } + + // optional uint32 stride_h = 7; + case 7: { + if (tag == 56) { + parse_stride_h: + set_has_stride_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_stride_w; + break; + } + + // optional uint32 stride_w = 8; + case 8: { + if (tag == 64) { + parse_stride_w: + set_has_stride_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_pad_h; + break; + } + + // optional uint32 pad_h = 9 [default = 0]; + case 9: { + if (tag == 72) { + parse_pad_h: + set_has_pad_h(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_pad_w; + break; + } + + // optional uint32 pad_w = 10 [default = 0]; + case 10: { + if (tag == 80) { + parse_pad_w: + set_has_pad_w(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_engine; + break; + } + + // optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + case 11: { + if (tag == 88) { + parse_engine: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::PoolingParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::PoolingParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(11, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_global_pooling; + break; + } + + // optional bool global_pooling = 12 [default = false]; + case 12: { + if (tag == 96) { + parse_global_pooling: + set_has_global_pooling(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &global_pooling_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.PoolingParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.PoolingParameter) + return false; +#undef DO_ +} + +void PoolingParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.PoolingParameter) + // optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->pool(), output); + } + + // optional uint32 kernel_size = 2; + if (has_kernel_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->kernel_size(), output); + } + + // optional uint32 stride = 3 [default = 1]; + if (has_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->stride(), output); + } + + // optional uint32 pad = 4 [default = 0]; + if (has_pad()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->pad(), output); + } + + // optional uint32 kernel_h = 5; + if (has_kernel_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->kernel_h(), output); + } + + // optional uint32 kernel_w = 6; + if (has_kernel_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->kernel_w(), output); + } + + // optional uint32 stride_h = 7; + if (has_stride_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->stride_h(), output); + } + + // optional uint32 stride_w = 8; + if (has_stride_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->stride_w(), output); + } + + // optional uint32 pad_h = 9 [default = 0]; + if (has_pad_h()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->pad_h(), output); + } + + // optional uint32 pad_w = 10 [default = 0]; + if (has_pad_w()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->pad_w(), output); + } + + // optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 11, this->engine(), output); + } + + // optional bool global_pooling = 12 [default = false]; + if (has_global_pooling()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->global_pooling(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.PoolingParameter) +} + +::google::protobuf::uint8* PoolingParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.PoolingParameter) + // optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + if (has_pool()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->pool(), target); + } + + // optional uint32 kernel_size = 2; + if (has_kernel_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->kernel_size(), target); + } + + // optional uint32 stride = 3 [default = 1]; + if (has_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->stride(), target); + } + + // optional uint32 pad = 4 [default = 0]; + if (has_pad()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->pad(), target); + } + + // optional uint32 kernel_h = 5; + if (has_kernel_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->kernel_h(), target); + } + + // optional uint32 kernel_w = 6; + if (has_kernel_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->kernel_w(), target); + } + + // optional uint32 stride_h = 7; + if (has_stride_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->stride_h(), target); + } + + // optional uint32 stride_w = 8; + if (has_stride_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->stride_w(), target); + } + + // optional uint32 pad_h = 9 [default = 0]; + if (has_pad_h()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->pad_h(), target); + } + + // optional uint32 pad_w = 10 [default = 0]; + if (has_pad_w()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->pad_w(), target); + } + + // optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 11, this->engine(), target); + } + + // optional bool global_pooling = 12 [default = false]; + if (has_global_pooling()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->global_pooling(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.PoolingParameter) + return target; +} + +size_t PoolingParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.PoolingParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional uint32 pad = 4 [default = 0]; + if (has_pad()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad()); + } + + // optional uint32 pad_h = 9 [default = 0]; + if (has_pad_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_h()); + } + + // optional uint32 pad_w = 10 [default = 0]; + if (has_pad_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_w()); + } + + // optional uint32 kernel_size = 2; + if (has_kernel_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_size()); + } + + // optional uint32 kernel_h = 5; + if (has_kernel_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_h()); + } + + // optional uint32 kernel_w = 6; + if (has_kernel_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_w()); + } + + // optional uint32 stride = 3 [default = 1]; + if (has_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride()); + } + + } + if (_has_bits_[8 / 32] & 3840u) { + // optional uint32 stride_h = 7; + if (has_stride_h()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_h()); + } + + // optional uint32 stride_w = 8; + if (has_stride_w()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_w()); + } + + // optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + // optional bool global_pooling = 12 [default = false]; + if (has_global_pooling()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PoolingParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.PoolingParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const PoolingParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.PoolingParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.PoolingParameter) + UnsafeMergeFrom(*source); + } +} + +void PoolingParameter::MergeFrom(const PoolingParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.PoolingParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void PoolingParameter::UnsafeMergeFrom(const PoolingParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_pool()) { + set_pool(from.pool()); + } + if (from.has_pad()) { + set_pad(from.pad()); + } + if (from.has_pad_h()) { + set_pad_h(from.pad_h()); + } + if (from.has_pad_w()) { + set_pad_w(from.pad_w()); + } + if (from.has_kernel_size()) { + set_kernel_size(from.kernel_size()); + } + if (from.has_kernel_h()) { + set_kernel_h(from.kernel_h()); + } + if (from.has_kernel_w()) { + set_kernel_w(from.kernel_w()); + } + if (from.has_stride()) { + set_stride(from.stride()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_stride_h()) { + set_stride_h(from.stride_h()); + } + if (from.has_stride_w()) { + set_stride_w(from.stride_w()); + } + if (from.has_engine()) { + set_engine(from.engine()); + } + if (from.has_global_pooling()) { + set_global_pooling(from.global_pooling()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void PoolingParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.PoolingParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PoolingParameter::CopyFrom(const PoolingParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.PoolingParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool PoolingParameter::IsInitialized() const { + + return true; +} + +void PoolingParameter::Swap(PoolingParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void PoolingParameter::InternalSwap(PoolingParameter* other) { + std::swap(pool_, other->pool_); + std::swap(pad_, other->pad_); + std::swap(pad_h_, other->pad_h_); + std::swap(pad_w_, other->pad_w_); + std::swap(kernel_size_, other->kernel_size_); + std::swap(kernel_h_, other->kernel_h_); + std::swap(kernel_w_, other->kernel_w_); + std::swap(stride_, other->stride_); + std::swap(stride_h_, other->stride_h_); + std::swap(stride_w_, other->stride_w_); + std::swap(engine_, other->engine_); + std::swap(global_pooling_, other->global_pooling_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata PoolingParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PoolingParameter_descriptor_; + metadata.reflection = PoolingParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PoolingParameter + +// optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; +bool PoolingParameter::has_pool() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void PoolingParameter::set_has_pool() { + _has_bits_[0] |= 0x00000001u; +} +void PoolingParameter::clear_has_pool() { + _has_bits_[0] &= ~0x00000001u; +} +void PoolingParameter::clear_pool() { + pool_ = 0; + clear_has_pool(); +} +::caffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pool) + return static_cast< ::caffe::PoolingParameter_PoolMethod >(pool_); +} +void PoolingParameter::set_pool(::caffe::PoolingParameter_PoolMethod value) { + assert(::caffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pool) +} + +// optional uint32 pad = 4 [default = 0]; +bool PoolingParameter::has_pad() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void PoolingParameter::set_has_pad() { + _has_bits_[0] |= 0x00000002u; +} +void PoolingParameter::clear_has_pad() { + _has_bits_[0] &= ~0x00000002u; +} +void PoolingParameter::clear_pad() { + pad_ = 0u; + clear_has_pad(); +} +::google::protobuf::uint32 PoolingParameter::pad() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pad) + return pad_; +} +void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pad) +} + +// optional uint32 pad_h = 9 [default = 0]; +bool PoolingParameter::has_pad_h() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void PoolingParameter::set_has_pad_h() { + _has_bits_[0] |= 0x00000004u; +} +void PoolingParameter::clear_has_pad_h() { + _has_bits_[0] &= ~0x00000004u; +} +void PoolingParameter::clear_pad_h() { + pad_h_ = 0u; + clear_has_pad_h(); +} +::google::protobuf::uint32 PoolingParameter::pad_h() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pad_h) + return pad_h_; +} +void PoolingParameter::set_pad_h(::google::protobuf::uint32 value) { + set_has_pad_h(); + pad_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pad_h) +} + +// optional uint32 pad_w = 10 [default = 0]; +bool PoolingParameter::has_pad_w() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void PoolingParameter::set_has_pad_w() { + _has_bits_[0] |= 0x00000008u; +} +void PoolingParameter::clear_has_pad_w() { + _has_bits_[0] &= ~0x00000008u; +} +void PoolingParameter::clear_pad_w() { + pad_w_ = 0u; + clear_has_pad_w(); +} +::google::protobuf::uint32 PoolingParameter::pad_w() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pad_w) + return pad_w_; +} +void PoolingParameter::set_pad_w(::google::protobuf::uint32 value) { + set_has_pad_w(); + pad_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pad_w) +} + +// optional uint32 kernel_size = 2; +bool PoolingParameter::has_kernel_size() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void PoolingParameter::set_has_kernel_size() { + _has_bits_[0] |= 0x00000010u; +} +void PoolingParameter::clear_has_kernel_size() { + _has_bits_[0] &= ~0x00000010u; +} +void PoolingParameter::clear_kernel_size() { + kernel_size_ = 0u; + clear_has_kernel_size(); +} +::google::protobuf::uint32 PoolingParameter::kernel_size() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.kernel_size) + return kernel_size_; +} +void PoolingParameter::set_kernel_size(::google::protobuf::uint32 value) { + set_has_kernel_size(); + kernel_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.kernel_size) +} + +// optional uint32 kernel_h = 5; +bool PoolingParameter::has_kernel_h() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void PoolingParameter::set_has_kernel_h() { + _has_bits_[0] |= 0x00000020u; +} +void PoolingParameter::clear_has_kernel_h() { + _has_bits_[0] &= ~0x00000020u; +} +void PoolingParameter::clear_kernel_h() { + kernel_h_ = 0u; + clear_has_kernel_h(); +} +::google::protobuf::uint32 PoolingParameter::kernel_h() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.kernel_h) + return kernel_h_; +} +void PoolingParameter::set_kernel_h(::google::protobuf::uint32 value) { + set_has_kernel_h(); + kernel_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.kernel_h) +} + +// optional uint32 kernel_w = 6; +bool PoolingParameter::has_kernel_w() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void PoolingParameter::set_has_kernel_w() { + _has_bits_[0] |= 0x00000040u; +} +void PoolingParameter::clear_has_kernel_w() { + _has_bits_[0] &= ~0x00000040u; +} +void PoolingParameter::clear_kernel_w() { + kernel_w_ = 0u; + clear_has_kernel_w(); +} +::google::protobuf::uint32 PoolingParameter::kernel_w() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.kernel_w) + return kernel_w_; +} +void PoolingParameter::set_kernel_w(::google::protobuf::uint32 value) { + set_has_kernel_w(); + kernel_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.kernel_w) +} + +// optional uint32 stride = 3 [default = 1]; +bool PoolingParameter::has_stride() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void PoolingParameter::set_has_stride() { + _has_bits_[0] |= 0x00000080u; +} +void PoolingParameter::clear_has_stride() { + _has_bits_[0] &= ~0x00000080u; +} +void PoolingParameter::clear_stride() { + stride_ = 1u; + clear_has_stride(); +} +::google::protobuf::uint32 PoolingParameter::stride() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.stride) + return stride_; +} +void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.stride) +} + +// optional uint32 stride_h = 7; +bool PoolingParameter::has_stride_h() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void PoolingParameter::set_has_stride_h() { + _has_bits_[0] |= 0x00000100u; +} +void PoolingParameter::clear_has_stride_h() { + _has_bits_[0] &= ~0x00000100u; +} +void PoolingParameter::clear_stride_h() { + stride_h_ = 0u; + clear_has_stride_h(); +} +::google::protobuf::uint32 PoolingParameter::stride_h() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.stride_h) + return stride_h_; +} +void PoolingParameter::set_stride_h(::google::protobuf::uint32 value) { + set_has_stride_h(); + stride_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.stride_h) +} + +// optional uint32 stride_w = 8; +bool PoolingParameter::has_stride_w() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void PoolingParameter::set_has_stride_w() { + _has_bits_[0] |= 0x00000200u; +} +void PoolingParameter::clear_has_stride_w() { + _has_bits_[0] &= ~0x00000200u; +} +void PoolingParameter::clear_stride_w() { + stride_w_ = 0u; + clear_has_stride_w(); +} +::google::protobuf::uint32 PoolingParameter::stride_w() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.stride_w) + return stride_w_; +} +void PoolingParameter::set_stride_w(::google::protobuf::uint32 value) { + set_has_stride_w(); + stride_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.stride_w) +} + +// optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; +bool PoolingParameter::has_engine() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void PoolingParameter::set_has_engine() { + _has_bits_[0] |= 0x00000400u; +} +void PoolingParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000400u; +} +void PoolingParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.engine) + return static_cast< ::caffe::PoolingParameter_Engine >(engine_); +} +void PoolingParameter::set_engine(::caffe::PoolingParameter_Engine value) { + assert(::caffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.engine) +} + +// optional bool global_pooling = 12 [default = false]; +bool PoolingParameter::has_global_pooling() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void PoolingParameter::set_has_global_pooling() { + _has_bits_[0] |= 0x00000800u; +} +void PoolingParameter::clear_has_global_pooling() { + _has_bits_[0] &= ~0x00000800u; +} +void PoolingParameter::clear_global_pooling() { + global_pooling_ = false; + clear_has_global_pooling(); +} +bool PoolingParameter::global_pooling() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.global_pooling) + return global_pooling_; +} +void PoolingParameter::set_global_pooling(bool value) { + set_has_global_pooling(); + global_pooling_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.global_pooling) +} + +inline const PoolingParameter* PoolingParameter::internal_default_instance() { + return &PoolingParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PowerParameter::kPowerFieldNumber; +const int PowerParameter::kScaleFieldNumber; +const int PowerParameter::kShiftFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PowerParameter::PowerParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.PowerParameter) +} + +void PowerParameter::InitAsDefaultInstance() { +} + +PowerParameter::PowerParameter(const PowerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.PowerParameter) +} + +void PowerParameter::SharedCtor() { + _cached_size_ = 0; + shift_ = 0; + power_ = 1; + scale_ = 1; +} + +PowerParameter::~PowerParameter() { + // @@protoc_insertion_point(destructor:caffe.PowerParameter) + SharedDtor(); +} + +void PowerParameter::SharedDtor() { +} + +void PowerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PowerParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PowerParameter_descriptor_; +} + +const PowerParameter& PowerParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed PowerParameter_default_instance_; + +PowerParameter* PowerParameter::New(::google::protobuf::Arena* arena) const { + PowerParameter* n = new PowerParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void PowerParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.PowerParameter) + if (_has_bits_[0 / 32] & 7u) { + power_ = 1; + scale_ = 1; + shift_ = 0; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool PowerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.PowerParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float power = 1 [default = 1]; + case 1: { + if (tag == 13) { + set_has_power(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_scale; + break; + } + + // optional float scale = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_shift; + break; + } + + // optional float shift = 3 [default = 0]; + case 3: { + if (tag == 29) { + parse_shift: + set_has_shift(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.PowerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.PowerParameter) + return false; +#undef DO_ +} + +void PowerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.PowerParameter) + // optional float power = 1 [default = 1]; + if (has_power()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->power(), output); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output); + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->shift(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.PowerParameter) +} + +::google::protobuf::uint8* PowerParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.PowerParameter) + // optional float power = 1 [default = 1]; + if (has_power()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->power(), target); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target); + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->shift(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.PowerParameter) + return target; +} + +size_t PowerParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.PowerParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional float power = 1 [default = 1]; + if (has_power()) { + total_size += 1 + 4; + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + // optional float shift = 3 [default = 0]; + if (has_shift()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PowerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.PowerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const PowerParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.PowerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.PowerParameter) + UnsafeMergeFrom(*source); + } +} + +void PowerParameter::MergeFrom(const PowerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.PowerParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void PowerParameter::UnsafeMergeFrom(const PowerParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_power()) { + set_power(from.power()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_shift()) { + set_shift(from.shift()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void PowerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.PowerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PowerParameter::CopyFrom(const PowerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.PowerParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool PowerParameter::IsInitialized() const { + + return true; +} + +void PowerParameter::Swap(PowerParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void PowerParameter::InternalSwap(PowerParameter* other) { + std::swap(power_, other->power_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata PowerParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PowerParameter_descriptor_; + metadata.reflection = PowerParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PowerParameter + +// optional float power = 1 [default = 1]; +bool PowerParameter::has_power() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void PowerParameter::set_has_power() { + _has_bits_[0] |= 0x00000001u; +} +void PowerParameter::clear_has_power() { + _has_bits_[0] &= ~0x00000001u; +} +void PowerParameter::clear_power() { + power_ = 1; + clear_has_power(); +} +float PowerParameter::power() const { + // @@protoc_insertion_point(field_get:caffe.PowerParameter.power) + return power_; +} +void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:caffe.PowerParameter.power) +} + +// optional float scale = 2 [default = 1]; +bool PowerParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void PowerParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +void PowerParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +void PowerParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float PowerParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.PowerParameter.scale) + return scale_; +} +void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.PowerParameter.scale) +} + +// optional float shift = 3 [default = 0]; +bool PowerParameter::has_shift() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void PowerParameter::set_has_shift() { + _has_bits_[0] |= 0x00000004u; +} +void PowerParameter::clear_has_shift() { + _has_bits_[0] &= ~0x00000004u; +} +void PowerParameter::clear_shift() { + shift_ = 0; + clear_has_shift(); +} +float PowerParameter::shift() const { + // @@protoc_insertion_point(field_get:caffe.PowerParameter.shift) + return shift_; +} +void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:caffe.PowerParameter.shift) +} + +inline const PowerParameter* PowerParameter::internal_default_instance() { + return &PowerParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PythonParameter::kModuleFieldNumber; +const int PythonParameter::kLayerFieldNumber; +const int PythonParameter::kParamStrFieldNumber; +const int PythonParameter::kShareInParallelFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PythonParameter::PythonParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.PythonParameter) +} + +void PythonParameter::InitAsDefaultInstance() { +} + +PythonParameter::PythonParameter(const PythonParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.PythonParameter) +} + +void PythonParameter::SharedCtor() { + _cached_size_ = 0; + module_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_in_parallel_ = false; +} + +PythonParameter::~PythonParameter() { + // @@protoc_insertion_point(destructor:caffe.PythonParameter) + SharedDtor(); +} + +void PythonParameter::SharedDtor() { + module_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void PythonParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PythonParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PythonParameter_descriptor_; +} + +const PythonParameter& PythonParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed PythonParameter_default_instance_; + +PythonParameter* PythonParameter::New(::google::protobuf::Arena* arena) const { + PythonParameter* n = new PythonParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void PythonParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.PythonParameter) + if (_has_bits_[0 / 32] & 15u) { + if (has_module()) { + module_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_layer()) { + layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_param_str()) { + param_str_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + share_in_parallel_ = false; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool PythonParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.PythonParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string module = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_module())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.PythonParameter.module"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layer; + break; + } + + // optional string layer = 2; + case 2: { + if (tag == 18) { + parse_layer: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_layer())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->layer().data(), this->layer().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.PythonParameter.layer"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_param_str; + break; + } + + // optional string param_str = 3 [default = ""]; + case 3: { + if (tag == 26) { + parse_param_str: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_param_str())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->param_str().data(), this->param_str().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.PythonParameter.param_str"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_share_in_parallel; + break; + } + + // optional bool share_in_parallel = 4 [default = false]; + case 4: { + if (tag == 32) { + parse_share_in_parallel: + set_has_share_in_parallel(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &share_in_parallel_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.PythonParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.PythonParameter) + return false; +#undef DO_ +} + +void PythonParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.PythonParameter.module"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->module(), output); + } + + // optional string layer = 2; + if (has_layer()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->layer().data(), this->layer().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.PythonParameter.layer"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->layer(), output); + } + + // optional string param_str = 3 [default = ""]; + if (has_param_str()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->param_str().data(), this->param_str().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.PythonParameter.param_str"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->param_str(), output); + } + + // optional bool share_in_parallel = 4 [default = false]; + if (has_share_in_parallel()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->share_in_parallel(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.PythonParameter) +} + +::google::protobuf::uint8* PythonParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.PythonParameter.module"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->module(), target); + } + + // optional string layer = 2; + if (has_layer()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->layer().data(), this->layer().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.PythonParameter.layer"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->layer(), target); + } + + // optional string param_str = 3 [default = ""]; + if (has_param_str()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->param_str().data(), this->param_str().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.PythonParameter.param_str"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->param_str(), target); + } + + // optional bool share_in_parallel = 4 [default = false]; + if (has_share_in_parallel()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->share_in_parallel(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.PythonParameter) + return target; +} + +size_t PythonParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.PythonParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 15u) { + // optional string module = 1; + if (has_module()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->module()); + } + + // optional string layer = 2; + if (has_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->layer()); + } + + // optional string param_str = 3 [default = ""]; + if (has_param_str()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->param_str()); + } + + // optional bool share_in_parallel = 4 [default = false]; + if (has_share_in_parallel()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PythonParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.PythonParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const PythonParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.PythonParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.PythonParameter) + UnsafeMergeFrom(*source); + } +} + +void PythonParameter::MergeFrom(const PythonParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.PythonParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void PythonParameter::UnsafeMergeFrom(const PythonParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_module()) { + set_has_module(); + module_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.module_); + } + if (from.has_layer()) { + set_has_layer(); + layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.layer_); + } + if (from.has_param_str()) { + set_has_param_str(); + param_str_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.param_str_); + } + if (from.has_share_in_parallel()) { + set_share_in_parallel(from.share_in_parallel()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void PythonParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.PythonParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PythonParameter::CopyFrom(const PythonParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.PythonParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool PythonParameter::IsInitialized() const { + + return true; +} + +void PythonParameter::Swap(PythonParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void PythonParameter::InternalSwap(PythonParameter* other) { + module_.Swap(&other->module_); + layer_.Swap(&other->layer_); + param_str_.Swap(&other->param_str_); + std::swap(share_in_parallel_, other->share_in_parallel_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata PythonParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PythonParameter_descriptor_; + metadata.reflection = PythonParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PythonParameter + +// optional string module = 1; +bool PythonParameter::has_module() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void PythonParameter::set_has_module() { + _has_bits_[0] |= 0x00000001u; +} +void PythonParameter::clear_has_module() { + _has_bits_[0] &= ~0x00000001u; +} +void PythonParameter::clear_module() { + module_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_module(); +} +const ::std::string& PythonParameter::module() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.module) + return module_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void PythonParameter::set_module(const ::std::string& value) { + set_has_module(); + module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.PythonParameter.module) +} +void PythonParameter::set_module(const char* value) { + set_has_module(); + module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.PythonParameter.module) +} +void PythonParameter::set_module(const char* value, size_t size) { + set_has_module(); + module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.PythonParameter.module) +} +::std::string* PythonParameter::mutable_module() { + set_has_module(); + // @@protoc_insertion_point(field_mutable:caffe.PythonParameter.module) + return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* PythonParameter::release_module() { + // @@protoc_insertion_point(field_release:caffe.PythonParameter.module) + clear_has_module(); + return module_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void PythonParameter::set_allocated_module(::std::string* module) { + if (module != NULL) { + set_has_module(); + } else { + clear_has_module(); + } + module_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), module); + // @@protoc_insertion_point(field_set_allocated:caffe.PythonParameter.module) +} + +// optional string layer = 2; +bool PythonParameter::has_layer() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void PythonParameter::set_has_layer() { + _has_bits_[0] |= 0x00000002u; +} +void PythonParameter::clear_has_layer() { + _has_bits_[0] &= ~0x00000002u; +} +void PythonParameter::clear_layer() { + layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_layer(); +} +const ::std::string& PythonParameter::layer() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.layer) + return layer_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void PythonParameter::set_layer(const ::std::string& value) { + set_has_layer(); + layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.PythonParameter.layer) +} +void PythonParameter::set_layer(const char* value) { + set_has_layer(); + layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.PythonParameter.layer) +} +void PythonParameter::set_layer(const char* value, size_t size) { + set_has_layer(); + layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.PythonParameter.layer) +} +::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + // @@protoc_insertion_point(field_mutable:caffe.PythonParameter.layer) + return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* PythonParameter::release_layer() { + // @@protoc_insertion_point(field_release:caffe.PythonParameter.layer) + clear_has_layer(); + return layer_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void PythonParameter::set_allocated_layer(::std::string* layer) { + if (layer != NULL) { + set_has_layer(); + } else { + clear_has_layer(); + } + layer_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), layer); + // @@protoc_insertion_point(field_set_allocated:caffe.PythonParameter.layer) +} + +// optional string param_str = 3 [default = ""]; +bool PythonParameter::has_param_str() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void PythonParameter::set_has_param_str() { + _has_bits_[0] |= 0x00000004u; +} +void PythonParameter::clear_has_param_str() { + _has_bits_[0] &= ~0x00000004u; +} +void PythonParameter::clear_param_str() { + param_str_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_param_str(); +} +const ::std::string& PythonParameter::param_str() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.param_str) + return param_str_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void PythonParameter::set_param_str(const ::std::string& value) { + set_has_param_str(); + param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.PythonParameter.param_str) +} +void PythonParameter::set_param_str(const char* value) { + set_has_param_str(); + param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.PythonParameter.param_str) +} +void PythonParameter::set_param_str(const char* value, size_t size) { + set_has_param_str(); + param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.PythonParameter.param_str) +} +::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + // @@protoc_insertion_point(field_mutable:caffe.PythonParameter.param_str) + return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* PythonParameter::release_param_str() { + // @@protoc_insertion_point(field_release:caffe.PythonParameter.param_str) + clear_has_param_str(); + return param_str_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void PythonParameter::set_allocated_param_str(::std::string* param_str) { + if (param_str != NULL) { + set_has_param_str(); + } else { + clear_has_param_str(); + } + param_str_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), param_str); + // @@protoc_insertion_point(field_set_allocated:caffe.PythonParameter.param_str) +} + +// optional bool share_in_parallel = 4 [default = false]; +bool PythonParameter::has_share_in_parallel() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void PythonParameter::set_has_share_in_parallel() { + _has_bits_[0] |= 0x00000008u; +} +void PythonParameter::clear_has_share_in_parallel() { + _has_bits_[0] &= ~0x00000008u; +} +void PythonParameter::clear_share_in_parallel() { + share_in_parallel_ = false; + clear_has_share_in_parallel(); +} +bool PythonParameter::share_in_parallel() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.share_in_parallel) + return share_in_parallel_; +} +void PythonParameter::set_share_in_parallel(bool value) { + set_has_share_in_parallel(); + share_in_parallel_ = value; + // @@protoc_insertion_point(field_set:caffe.PythonParameter.share_in_parallel) +} + +inline const PythonParameter* PythonParameter::internal_default_instance() { + return &PythonParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int RecurrentParameter::kNumOutputFieldNumber; +const int RecurrentParameter::kWeightFillerFieldNumber; +const int RecurrentParameter::kBiasFillerFieldNumber; +const int RecurrentParameter::kDebugInfoFieldNumber; +const int RecurrentParameter::kExposeHiddenFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +RecurrentParameter::RecurrentParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.RecurrentParameter) +} + +void RecurrentParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + bias_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +RecurrentParameter::RecurrentParameter(const RecurrentParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.RecurrentParameter) +} + +void RecurrentParameter::SharedCtor() { + _cached_size_ = 0; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(&num_output_, 0, reinterpret_cast(&expose_hidden_) - + reinterpret_cast(&num_output_) + sizeof(expose_hidden_)); +} + +RecurrentParameter::~RecurrentParameter() { + // @@protoc_insertion_point(destructor:caffe.RecurrentParameter) + SharedDtor(); +} + +void RecurrentParameter::SharedDtor() { + if (this != &RecurrentParameter_default_instance_.get()) { + delete weight_filler_; + delete bias_filler_; + } +} + +void RecurrentParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* RecurrentParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return RecurrentParameter_descriptor_; +} + +const RecurrentParameter& RecurrentParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed RecurrentParameter_default_instance_; + +RecurrentParameter* RecurrentParameter::New(::google::protobuf::Arena* arena) const { + RecurrentParameter* n = new RecurrentParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void RecurrentParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.RecurrentParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(RecurrentParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 31u) { + ZR_(num_output_, expose_hidden_); + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool RecurrentParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.RecurrentParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 num_output = 1 [default = 0]; + case 1: { + if (tag == 8) { + set_has_num_output(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_weight_filler; + break; + } + + // optional .caffe.FillerParameter weight_filler = 2; + case 2: { + if (tag == 18) { + parse_weight_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_weight_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_bias_filler; + break; + } + + // optional .caffe.FillerParameter bias_filler = 3; + case 3: { + if (tag == 26) { + parse_bias_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_debug_info; + break; + } + + // optional bool debug_info = 4 [default = false]; + case 4: { + if (tag == 32) { + parse_debug_info: + set_has_debug_info(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_expose_hidden; + break; + } + + // optional bool expose_hidden = 5 [default = false]; + case 5: { + if (tag == 40) { + parse_expose_hidden: + set_has_expose_hidden(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &expose_hidden_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.RecurrentParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.RecurrentParameter) + return false; +#undef DO_ +} + +void RecurrentParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.RecurrentParameter) + // optional uint32 num_output = 1 [default = 0]; + if (has_num_output()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_output(), output); + } + + // optional .caffe.FillerParameter weight_filler = 2; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *this->weight_filler_, output); + } + + // optional .caffe.FillerParameter bias_filler = 3; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->bias_filler_, output); + } + + // optional bool debug_info = 4 [default = false]; + if (has_debug_info()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->debug_info(), output); + } + + // optional bool expose_hidden = 5 [default = false]; + if (has_expose_hidden()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->expose_hidden(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.RecurrentParameter) +} + +::google::protobuf::uint8* RecurrentParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.RecurrentParameter) + // optional uint32 num_output = 1 [default = 0]; + if (has_num_output()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_output(), target); + } + + // optional .caffe.FillerParameter weight_filler = 2; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *this->weight_filler_, false, target); + } + + // optional .caffe.FillerParameter bias_filler = 3; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *this->bias_filler_, false, target); + } + + // optional bool debug_info = 4 [default = false]; + if (has_debug_info()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->debug_info(), target); + } + + // optional bool expose_hidden = 5 [default = false]; + if (has_expose_hidden()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->expose_hidden(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.RecurrentParameter) + return target; +} + +size_t RecurrentParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.RecurrentParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 31u) { + // optional uint32 num_output = 1 [default = 0]; + if (has_num_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_output()); + } + + // optional .caffe.FillerParameter weight_filler = 2; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .caffe.FillerParameter bias_filler = 3; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + // optional bool debug_info = 4 [default = false]; + if (has_debug_info()) { + total_size += 1 + 1; + } + + // optional bool expose_hidden = 5 [default = false]; + if (has_expose_hidden()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void RecurrentParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.RecurrentParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const RecurrentParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.RecurrentParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.RecurrentParameter) + UnsafeMergeFrom(*source); + } +} + +void RecurrentParameter::MergeFrom(const RecurrentParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.RecurrentParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void RecurrentParameter::UnsafeMergeFrom(const RecurrentParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_output()) { + set_num_output(from.num_output()); + } + if (from.has_weight_filler()) { + mutable_weight_filler()->::caffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::caffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + if (from.has_expose_hidden()) { + set_expose_hidden(from.expose_hidden()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void RecurrentParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.RecurrentParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RecurrentParameter::CopyFrom(const RecurrentParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.RecurrentParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool RecurrentParameter::IsInitialized() const { + + return true; +} + +void RecurrentParameter::Swap(RecurrentParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void RecurrentParameter::InternalSwap(RecurrentParameter* other) { + std::swap(num_output_, other->num_output_); + std::swap(weight_filler_, other->weight_filler_); + std::swap(bias_filler_, other->bias_filler_); + std::swap(debug_info_, other->debug_info_); + std::swap(expose_hidden_, other->expose_hidden_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata RecurrentParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = RecurrentParameter_descriptor_; + metadata.reflection = RecurrentParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// RecurrentParameter + +// optional uint32 num_output = 1 [default = 0]; +bool RecurrentParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void RecurrentParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +void RecurrentParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +void RecurrentParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +::google::protobuf::uint32 RecurrentParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.num_output) + return num_output_; +} +void RecurrentParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.RecurrentParameter.num_output) +} + +// optional .caffe.FillerParameter weight_filler = 2; +bool RecurrentParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void RecurrentParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000002u; +} +void RecurrentParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000002u; +} +void RecurrentParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::caffe::FillerParameter& RecurrentParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* RecurrentParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.RecurrentParameter.weight_filler) + return weight_filler_; +} +::caffe::FillerParameter* RecurrentParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.RecurrentParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void RecurrentParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.RecurrentParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 3; +bool RecurrentParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void RecurrentParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000004u; +} +void RecurrentParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000004u; +} +void RecurrentParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::caffe::FillerParameter& RecurrentParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* RecurrentParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.RecurrentParameter.bias_filler) + return bias_filler_; +} +::caffe::FillerParameter* RecurrentParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.RecurrentParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void RecurrentParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.RecurrentParameter.bias_filler) +} + +// optional bool debug_info = 4 [default = false]; +bool RecurrentParameter::has_debug_info() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void RecurrentParameter::set_has_debug_info() { + _has_bits_[0] |= 0x00000008u; +} +void RecurrentParameter::clear_has_debug_info() { + _has_bits_[0] &= ~0x00000008u; +} +void RecurrentParameter::clear_debug_info() { + debug_info_ = false; + clear_has_debug_info(); +} +bool RecurrentParameter::debug_info() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.debug_info) + return debug_info_; +} +void RecurrentParameter::set_debug_info(bool value) { + set_has_debug_info(); + debug_info_ = value; + // @@protoc_insertion_point(field_set:caffe.RecurrentParameter.debug_info) +} + +// optional bool expose_hidden = 5 [default = false]; +bool RecurrentParameter::has_expose_hidden() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void RecurrentParameter::set_has_expose_hidden() { + _has_bits_[0] |= 0x00000010u; +} +void RecurrentParameter::clear_has_expose_hidden() { + _has_bits_[0] &= ~0x00000010u; +} +void RecurrentParameter::clear_expose_hidden() { + expose_hidden_ = false; + clear_has_expose_hidden(); +} +bool RecurrentParameter::expose_hidden() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.expose_hidden) + return expose_hidden_; +} +void RecurrentParameter::set_expose_hidden(bool value) { + set_has_expose_hidden(); + expose_hidden_ = value; + // @@protoc_insertion_point(field_set:caffe.RecurrentParameter.expose_hidden) +} + +inline const RecurrentParameter* RecurrentParameter::internal_default_instance() { + return &RecurrentParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* ReductionParameter_ReductionOp_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ReductionParameter_ReductionOp_descriptor_; +} +bool ReductionParameter_ReductionOp_IsValid(int value) { + switch (value) { + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const ReductionParameter_ReductionOp ReductionParameter::SUM; +const ReductionParameter_ReductionOp ReductionParameter::ASUM; +const ReductionParameter_ReductionOp ReductionParameter::SUMSQ; +const ReductionParameter_ReductionOp ReductionParameter::MEAN; +const ReductionParameter_ReductionOp ReductionParameter::ReductionOp_MIN; +const ReductionParameter_ReductionOp ReductionParameter::ReductionOp_MAX; +const int ReductionParameter::ReductionOp_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ReductionParameter::kOperationFieldNumber; +const int ReductionParameter::kAxisFieldNumber; +const int ReductionParameter::kCoeffFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ReductionParameter::ReductionParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ReductionParameter) +} + +void ReductionParameter::InitAsDefaultInstance() { +} + +ReductionParameter::ReductionParameter(const ReductionParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ReductionParameter) +} + +void ReductionParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 0; + operation_ = 1; + coeff_ = 1; +} + +ReductionParameter::~ReductionParameter() { + // @@protoc_insertion_point(destructor:caffe.ReductionParameter) + SharedDtor(); +} + +void ReductionParameter::SharedDtor() { +} + +void ReductionParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ReductionParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ReductionParameter_descriptor_; +} + +const ReductionParameter& ReductionParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ReductionParameter_default_instance_; + +ReductionParameter* ReductionParameter::New(::google::protobuf::Arena* arena) const { + ReductionParameter* n = new ReductionParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ReductionParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ReductionParameter) + if (_has_bits_[0 / 32] & 7u) { + operation_ = 1; + axis_ = 0; + coeff_ = 1; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ReductionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ReductionParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::ReductionParameter_ReductionOp_IsValid(value)) { + set_operation(static_cast< ::caffe::ReductionParameter_ReductionOp >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_axis; + break; + } + + // optional int32 axis = 2 [default = 0]; + case 2: { + if (tag == 16) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_coeff; + break; + } + + // optional float coeff = 3 [default = 1]; + case 3: { + if (tag == 29) { + parse_coeff: + set_has_coeff(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &coeff_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ReductionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ReductionParameter) + return false; +#undef DO_ +} + +void ReductionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ReductionParameter) + // optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + if (has_operation()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->operation(), output); + } + + // optional int32 axis = 2 [default = 0]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output); + } + + // optional float coeff = 3 [default = 1]; + if (has_coeff()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->coeff(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ReductionParameter) +} + +::google::protobuf::uint8* ReductionParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ReductionParameter) + // optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + if (has_operation()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->operation(), target); + } + + // optional int32 axis = 2 [default = 0]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target); + } + + // optional float coeff = 3 [default = 1]; + if (has_coeff()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->coeff(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ReductionParameter) + return target; +} + +size_t ReductionParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ReductionParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + if (has_operation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->operation()); + } + + // optional int32 axis = 2 [default = 0]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional float coeff = 3 [default = 1]; + if (has_coeff()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReductionParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ReductionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ReductionParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ReductionParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ReductionParameter) + UnsafeMergeFrom(*source); + } +} + +void ReductionParameter::MergeFrom(const ReductionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ReductionParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ReductionParameter::UnsafeMergeFrom(const ReductionParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_operation()) { + set_operation(from.operation()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_coeff()) { + set_coeff(from.coeff()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ReductionParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ReductionParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReductionParameter::CopyFrom(const ReductionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ReductionParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ReductionParameter::IsInitialized() const { + + return true; +} + +void ReductionParameter::Swap(ReductionParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ReductionParameter::InternalSwap(ReductionParameter* other) { + std::swap(operation_, other->operation_); + std::swap(axis_, other->axis_); + std::swap(coeff_, other->coeff_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ReductionParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ReductionParameter_descriptor_; + metadata.reflection = ReductionParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ReductionParameter + +// optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; +bool ReductionParameter::has_operation() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ReductionParameter::set_has_operation() { + _has_bits_[0] |= 0x00000001u; +} +void ReductionParameter::clear_has_operation() { + _has_bits_[0] &= ~0x00000001u; +} +void ReductionParameter::clear_operation() { + operation_ = 1; + clear_has_operation(); +} +::caffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:caffe.ReductionParameter.operation) + return static_cast< ::caffe::ReductionParameter_ReductionOp >(operation_); +} +void ReductionParameter::set_operation(::caffe::ReductionParameter_ReductionOp value) { + assert(::caffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:caffe.ReductionParameter.operation) +} + +// optional int32 axis = 2 [default = 0]; +bool ReductionParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ReductionParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +void ReductionParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +void ReductionParameter::clear_axis() { + axis_ = 0; + clear_has_axis(); +} +::google::protobuf::int32 ReductionParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ReductionParameter.axis) + return axis_; +} +void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ReductionParameter.axis) +} + +// optional float coeff = 3 [default = 1]; +bool ReductionParameter::has_coeff() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ReductionParameter::set_has_coeff() { + _has_bits_[0] |= 0x00000004u; +} +void ReductionParameter::clear_has_coeff() { + _has_bits_[0] &= ~0x00000004u; +} +void ReductionParameter::clear_coeff() { + coeff_ = 1; + clear_has_coeff(); +} +float ReductionParameter::coeff() const { + // @@protoc_insertion_point(field_get:caffe.ReductionParameter.coeff) + return coeff_; +} +void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:caffe.ReductionParameter.coeff) +} + +inline const ReductionParameter* ReductionParameter::internal_default_instance() { + return &ReductionParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* ReLUParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ReLUParameter_Engine_descriptor_; +} +bool ReLUParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const ReLUParameter_Engine ReLUParameter::DEFAULT; +const ReLUParameter_Engine ReLUParameter::CAFFE; +const ReLUParameter_Engine ReLUParameter::CUDNN; +const ReLUParameter_Engine ReLUParameter::Engine_MIN; +const ReLUParameter_Engine ReLUParameter::Engine_MAX; +const int ReLUParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ReLUParameter::kNegativeSlopeFieldNumber; +const int ReLUParameter::kEngineFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ReLUParameter::ReLUParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ReLUParameter) +} + +void ReLUParameter::InitAsDefaultInstance() { +} + +ReLUParameter::ReLUParameter(const ReLUParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ReLUParameter) +} + +void ReLUParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&negative_slope_, 0, reinterpret_cast(&engine_) - + reinterpret_cast(&negative_slope_) + sizeof(engine_)); +} + +ReLUParameter::~ReLUParameter() { + // @@protoc_insertion_point(destructor:caffe.ReLUParameter) + SharedDtor(); +} + +void ReLUParameter::SharedDtor() { +} + +void ReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ReLUParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ReLUParameter_descriptor_; +} + +const ReLUParameter& ReLUParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ReLUParameter_default_instance_; + +ReLUParameter* ReLUParameter::New(::google::protobuf::Arena* arena) const { + ReLUParameter* n = new ReLUParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ReLUParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ReLUParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(ReLUParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(negative_slope_, engine_); + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ReLUParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float negative_slope = 1 [default = 0]; + case 1: { + if (tag == 13) { + set_has_negative_slope(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &negative_slope_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_engine; + break; + } + + // optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + case 2: { + if (tag == 16) { + parse_engine: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::ReLUParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::ReLUParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ReLUParameter) + return false; +#undef DO_ +} + +void ReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->negative_slope(), output); + } + + // optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->engine(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ReLUParameter) +} + +::google::protobuf::uint8* ReLUParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->negative_slope(), target); + } + + // optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->engine(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ReLUParameter) + return target; +} + +size_t ReLUParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ReLUParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + total_size += 1 + 4; + } + + // optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ReLUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ReLUParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ReLUParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ReLUParameter) + UnsafeMergeFrom(*source); + } +} + +void ReLUParameter::MergeFrom(const ReLUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ReLUParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ReLUParameter::UnsafeMergeFrom(const ReLUParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_negative_slope()) { + set_negative_slope(from.negative_slope()); + } + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReLUParameter::CopyFrom(const ReLUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ReLUParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ReLUParameter::IsInitialized() const { + + return true; +} + +void ReLUParameter::Swap(ReLUParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ReLUParameter::InternalSwap(ReLUParameter* other) { + std::swap(negative_slope_, other->negative_slope_); + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ReLUParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ReLUParameter_descriptor_; + metadata.reflection = ReLUParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ReLUParameter + +// optional float negative_slope = 1 [default = 0]; +bool ReLUParameter::has_negative_slope() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ReLUParameter::set_has_negative_slope() { + _has_bits_[0] |= 0x00000001u; +} +void ReLUParameter::clear_has_negative_slope() { + _has_bits_[0] &= ~0x00000001u; +} +void ReLUParameter::clear_negative_slope() { + negative_slope_ = 0; + clear_has_negative_slope(); +} +float ReLUParameter::negative_slope() const { + // @@protoc_insertion_point(field_get:caffe.ReLUParameter.negative_slope) + return negative_slope_; +} +void ReLUParameter::set_negative_slope(float value) { + set_has_negative_slope(); + negative_slope_ = value; + // @@protoc_insertion_point(field_set:caffe.ReLUParameter.negative_slope) +} + +// optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; +bool ReLUParameter::has_engine() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ReLUParameter::set_has_engine() { + _has_bits_[0] |= 0x00000002u; +} +void ReLUParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000002u; +} +void ReLUParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.ReLUParameter.engine) + return static_cast< ::caffe::ReLUParameter_Engine >(engine_); +} +void ReLUParameter::set_engine(::caffe::ReLUParameter_Engine value) { + assert(::caffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.ReLUParameter.engine) +} + +inline const ReLUParameter* ReLUParameter::internal_default_instance() { + return &ReLUParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ReshapeParameter::kShapeFieldNumber; +const int ReshapeParameter::kAxisFieldNumber; +const int ReshapeParameter::kNumAxesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ReshapeParameter::ReshapeParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ReshapeParameter) +} + +void ReshapeParameter::InitAsDefaultInstance() { + shape_ = const_cast< ::caffe::BlobShape*>( + ::caffe::BlobShape::internal_default_instance()); +} + +ReshapeParameter::ReshapeParameter(const ReshapeParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ReshapeParameter) +} + +void ReshapeParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + axis_ = 0; + num_axes_ = -1; +} + +ReshapeParameter::~ReshapeParameter() { + // @@protoc_insertion_point(destructor:caffe.ReshapeParameter) + SharedDtor(); +} + +void ReshapeParameter::SharedDtor() { + if (this != &ReshapeParameter_default_instance_.get()) { + delete shape_; + } +} + +void ReshapeParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ReshapeParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ReshapeParameter_descriptor_; +} + +const ReshapeParameter& ReshapeParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ReshapeParameter_default_instance_; + +ReshapeParameter* ReshapeParameter::New(::google::protobuf::Arena* arena) const { + ReshapeParameter* n = new ReshapeParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ReshapeParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ReshapeParameter) + if (_has_bits_[0 / 32] & 7u) { + if (has_shape()) { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + } + axis_ = 0; + num_axes_ = -1; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ReshapeParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ReshapeParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.BlobShape shape = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_axis; + break; + } + + // optional int32 axis = 2 [default = 0]; + case 2: { + if (tag == 16) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_num_axes; + break; + } + + // optional int32 num_axes = 3 [default = -1]; + case 3: { + if (tag == 24) { + parse_num_axes: + set_has_num_axes(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ReshapeParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ReshapeParameter) + return false; +#undef DO_ +} + +void ReshapeParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ReshapeParameter) + // optional .caffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *this->shape_, output); + } + + // optional int32 axis = 2 [default = 0]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output); + } + + // optional int32 num_axes = 3 [default = -1]; + if (has_num_axes()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->num_axes(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ReshapeParameter) +} + +::google::protobuf::uint8* ReshapeParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ReshapeParameter) + // optional .caffe.BlobShape shape = 1; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *this->shape_, false, target); + } + + // optional int32 axis = 2 [default = 0]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target); + } + + // optional int32 num_axes = 3 [default = -1]; + if (has_num_axes()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->num_axes(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ReshapeParameter) + return target; +} + +size_t ReshapeParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ReshapeParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .caffe.BlobShape shape = 1; + if (has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->shape_); + } + + // optional int32 axis = 2 [default = 0]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional int32 num_axes = 3 [default = -1]; + if (has_num_axes()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_axes()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReshapeParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ReshapeParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ReshapeParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ReshapeParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ReshapeParameter) + UnsafeMergeFrom(*source); + } +} + +void ReshapeParameter::MergeFrom(const ReshapeParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ReshapeParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ReshapeParameter::UnsafeMergeFrom(const ReshapeParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::caffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_num_axes()) { + set_num_axes(from.num_axes()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ReshapeParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ReshapeParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReshapeParameter::CopyFrom(const ReshapeParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ReshapeParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ReshapeParameter::IsInitialized() const { + + return true; +} + +void ReshapeParameter::Swap(ReshapeParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ReshapeParameter::InternalSwap(ReshapeParameter* other) { + std::swap(shape_, other->shape_); + std::swap(axis_, other->axis_); + std::swap(num_axes_, other->num_axes_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ReshapeParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ReshapeParameter_descriptor_; + metadata.reflection = ReshapeParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ReshapeParameter + +// optional .caffe.BlobShape shape = 1; +bool ReshapeParameter::has_shape() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ReshapeParameter::set_has_shape() { + _has_bits_[0] |= 0x00000001u; +} +void ReshapeParameter::clear_has_shape() { + _has_bits_[0] &= ~0x00000001u; +} +void ReshapeParameter::clear_shape() { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::caffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:caffe.ReshapeParameter.shape) + return shape_ != NULL ? *shape_ + : *::caffe::BlobShape::internal_default_instance(); +} +::caffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::caffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:caffe.ReshapeParameter.shape) + return shape_; +} +::caffe::BlobShape* ReshapeParameter::release_shape() { + // @@protoc_insertion_point(field_release:caffe.ReshapeParameter.shape) + clear_has_shape(); + ::caffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void ReshapeParameter::set_allocated_shape(::caffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ReshapeParameter.shape) +} + +// optional int32 axis = 2 [default = 0]; +bool ReshapeParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ReshapeParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +void ReshapeParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +void ReshapeParameter::clear_axis() { + axis_ = 0; + clear_has_axis(); +} +::google::protobuf::int32 ReshapeParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ReshapeParameter.axis) + return axis_; +} +void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ReshapeParameter.axis) +} + +// optional int32 num_axes = 3 [default = -1]; +bool ReshapeParameter::has_num_axes() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ReshapeParameter::set_has_num_axes() { + _has_bits_[0] |= 0x00000004u; +} +void ReshapeParameter::clear_has_num_axes() { + _has_bits_[0] &= ~0x00000004u; +} +void ReshapeParameter::clear_num_axes() { + num_axes_ = -1; + clear_has_num_axes(); +} +::google::protobuf::int32 ReshapeParameter::num_axes() const { + // @@protoc_insertion_point(field_get:caffe.ReshapeParameter.num_axes) + return num_axes_; +} +void ReshapeParameter::set_num_axes(::google::protobuf::int32 value) { + set_has_num_axes(); + num_axes_ = value; + // @@protoc_insertion_point(field_set:caffe.ReshapeParameter.num_axes) +} + +inline const ReshapeParameter* ReshapeParameter::internal_default_instance() { + return &ReshapeParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ScaleParameter::kAxisFieldNumber; +const int ScaleParameter::kNumAxesFieldNumber; +const int ScaleParameter::kFillerFieldNumber; +const int ScaleParameter::kBiasTermFieldNumber; +const int ScaleParameter::kBiasFillerFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ScaleParameter::ScaleParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ScaleParameter) +} + +void ScaleParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + bias_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +ScaleParameter::ScaleParameter(const ScaleParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ScaleParameter) +} + +void ScaleParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + bias_filler_ = NULL; + bias_term_ = false; + axis_ = 1; + num_axes_ = 1; +} + +ScaleParameter::~ScaleParameter() { + // @@protoc_insertion_point(destructor:caffe.ScaleParameter) + SharedDtor(); +} + +void ScaleParameter::SharedDtor() { + if (this != &ScaleParameter_default_instance_.get()) { + delete filler_; + delete bias_filler_; + } +} + +void ScaleParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ScaleParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ScaleParameter_descriptor_; +} + +const ScaleParameter& ScaleParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ScaleParameter_default_instance_; + +ScaleParameter* ScaleParameter::New(::google::protobuf::Arena* arena) const { + ScaleParameter* n = new ScaleParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ScaleParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ScaleParameter) + if (_has_bits_[0 / 32] & 31u) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + } + bias_term_ = false; + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + } + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ScaleParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ScaleParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 axis = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_num_axes; + break; + } + + // optional int32 num_axes = 2 [default = 1]; + case 2: { + if (tag == 16) { + parse_num_axes: + set_has_num_axes(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .caffe.FillerParameter filler = 3; + case 3: { + if (tag == 26) { + parse_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_bias_term; + break; + } + + // optional bool bias_term = 4 [default = false]; + case 4: { + if (tag == 32) { + parse_bias_term: + set_has_bias_term(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_bias_filler; + break; + } + + // optional .caffe.FillerParameter bias_filler = 5; + case 5: { + if (tag == 42) { + parse_bias_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ScaleParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ScaleParameter) + return false; +#undef DO_ +} + +void ScaleParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ScaleParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output); + } + + // optional int32 num_axes = 2 [default = 1]; + if (has_num_axes()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_axes(), output); + } + + // optional .caffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->filler_, output); + } + + // optional bool bias_term = 4 [default = false]; + if (has_bias_term()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bias_term(), output); + } + + // optional .caffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *this->bias_filler_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ScaleParameter) +} + +::google::protobuf::uint8* ScaleParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ScaleParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target); + } + + // optional int32 num_axes = 2 [default = 1]; + if (has_num_axes()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_axes(), target); + } + + // optional .caffe.FillerParameter filler = 3; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *this->filler_, false, target); + } + + // optional bool bias_term = 4 [default = false]; + if (has_bias_term()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bias_term(), target); + } + + // optional .caffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *this->bias_filler_, false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ScaleParameter) + return target; +} + +size_t ScaleParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ScaleParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 31u) { + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional int32 num_axes = 2 [default = 1]; + if (has_num_axes()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_axes()); + } + + // optional .caffe.FillerParameter filler = 3; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->filler_); + } + + // optional bool bias_term = 4 [default = false]; + if (has_bias_term()) { + total_size += 1 + 1; + } + + // optional .caffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ScaleParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ScaleParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ScaleParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ScaleParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ScaleParameter) + UnsafeMergeFrom(*source); + } +} + +void ScaleParameter::MergeFrom(const ScaleParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ScaleParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ScaleParameter::UnsafeMergeFrom(const ScaleParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_num_axes()) { + set_num_axes(from.num_axes()); + } + if (from.has_filler()) { + mutable_filler()->::caffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::caffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ScaleParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ScaleParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ScaleParameter::CopyFrom(const ScaleParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ScaleParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ScaleParameter::IsInitialized() const { + + return true; +} + +void ScaleParameter::Swap(ScaleParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ScaleParameter::InternalSwap(ScaleParameter* other) { + std::swap(axis_, other->axis_); + std::swap(num_axes_, other->num_axes_); + std::swap(filler_, other->filler_); + std::swap(bias_term_, other->bias_term_); + std::swap(bias_filler_, other->bias_filler_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ScaleParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ScaleParameter_descriptor_; + metadata.reflection = ScaleParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ScaleParameter + +// optional int32 axis = 1 [default = 1]; +bool ScaleParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ScaleParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void ScaleParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void ScaleParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 ScaleParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.axis) + return axis_; +} +void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ScaleParameter.axis) +} + +// optional int32 num_axes = 2 [default = 1]; +bool ScaleParameter::has_num_axes() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void ScaleParameter::set_has_num_axes() { + _has_bits_[0] |= 0x00000002u; +} +void ScaleParameter::clear_has_num_axes() { + _has_bits_[0] &= ~0x00000002u; +} +void ScaleParameter::clear_num_axes() { + num_axes_ = 1; + clear_has_num_axes(); +} +::google::protobuf::int32 ScaleParameter::num_axes() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.num_axes) + return num_axes_; +} +void ScaleParameter::set_num_axes(::google::protobuf::int32 value) { + set_has_num_axes(); + num_axes_ = value; + // @@protoc_insertion_point(field_set:caffe.ScaleParameter.num_axes) +} + +// optional .caffe.FillerParameter filler = 3; +bool ScaleParameter::has_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ScaleParameter::set_has_filler() { + _has_bits_[0] |= 0x00000004u; +} +void ScaleParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000004u; +} +void ScaleParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::caffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.filler) + return filler_ != NULL ? *filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ScaleParameter.filler) + return filler_; +} +::caffe::FillerParameter* ScaleParameter::release_filler() { + // @@protoc_insertion_point(field_release:caffe.ScaleParameter.filler) + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void ScaleParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ScaleParameter.filler) +} + +// optional bool bias_term = 4 [default = false]; +bool ScaleParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void ScaleParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000008u; +} +void ScaleParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000008u; +} +void ScaleParameter::clear_bias_term() { + bias_term_ = false; + clear_has_bias_term(); +} +bool ScaleParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.bias_term) + return bias_term_; +} +void ScaleParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.ScaleParameter.bias_term) +} + +// optional .caffe.FillerParameter bias_filler = 5; +bool ScaleParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void ScaleParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000010u; +} +void ScaleParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000010u; +} +void ScaleParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::caffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ScaleParameter.bias_filler) + return bias_filler_; +} +::caffe::FillerParameter* ScaleParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.ScaleParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void ScaleParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ScaleParameter.bias_filler) +} + +inline const ScaleParameter* ScaleParameter::internal_default_instance() { + return &ScaleParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* SigmoidParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SigmoidParameter_Engine_descriptor_; +} +bool SigmoidParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SigmoidParameter_Engine SigmoidParameter::DEFAULT; +const SigmoidParameter_Engine SigmoidParameter::CAFFE; +const SigmoidParameter_Engine SigmoidParameter::CUDNN; +const SigmoidParameter_Engine SigmoidParameter::Engine_MIN; +const SigmoidParameter_Engine SigmoidParameter::Engine_MAX; +const int SigmoidParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SigmoidParameter::kEngineFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SigmoidParameter::SigmoidParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SigmoidParameter) +} + +void SigmoidParameter::InitAsDefaultInstance() { +} + +SigmoidParameter::SigmoidParameter(const SigmoidParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SigmoidParameter) +} + +void SigmoidParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; +} + +SigmoidParameter::~SigmoidParameter() { + // @@protoc_insertion_point(destructor:caffe.SigmoidParameter) + SharedDtor(); +} + +void SigmoidParameter::SharedDtor() { +} + +void SigmoidParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SigmoidParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SigmoidParameter_descriptor_; +} + +const SigmoidParameter& SigmoidParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SigmoidParameter_default_instance_; + +SigmoidParameter* SigmoidParameter::New(::google::protobuf::Arena* arena) const { + SigmoidParameter* n = new SigmoidParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SigmoidParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SigmoidParameter) + engine_ = 0; + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SigmoidParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SigmoidParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SigmoidParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::SigmoidParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SigmoidParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SigmoidParameter) + return false; +#undef DO_ +} + +void SigmoidParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SigmoidParameter) + // optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SigmoidParameter) +} + +::google::protobuf::uint8* SigmoidParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SigmoidParameter) + // optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->engine(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SigmoidParameter) + return target; +} + +size_t SigmoidParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SigmoidParameter) + size_t total_size = 0; + + // optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SigmoidParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SigmoidParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SigmoidParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SigmoidParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SigmoidParameter) + UnsafeMergeFrom(*source); + } +} + +void SigmoidParameter::MergeFrom(const SigmoidParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SigmoidParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SigmoidParameter::UnsafeMergeFrom(const SigmoidParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SigmoidParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SigmoidParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SigmoidParameter::CopyFrom(const SigmoidParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SigmoidParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SigmoidParameter::IsInitialized() const { + + return true; +} + +void SigmoidParameter::Swap(SigmoidParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void SigmoidParameter::InternalSwap(SigmoidParameter* other) { + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SigmoidParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SigmoidParameter_descriptor_; + metadata.reflection = SigmoidParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SigmoidParameter + +// optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; +bool SigmoidParameter::has_engine() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SigmoidParameter::set_has_engine() { + _has_bits_[0] |= 0x00000001u; +} +void SigmoidParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000001u; +} +void SigmoidParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.SigmoidParameter.engine) + return static_cast< ::caffe::SigmoidParameter_Engine >(engine_); +} +void SigmoidParameter::set_engine(::caffe::SigmoidParameter_Engine value) { + assert(::caffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.SigmoidParameter.engine) +} + +inline const SigmoidParameter* SigmoidParameter::internal_default_instance() { + return &SigmoidParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SliceParameter::kAxisFieldNumber; +const int SliceParameter::kSlicePointFieldNumber; +const int SliceParameter::kSliceDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SliceParameter::SliceParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SliceParameter) +} + +void SliceParameter::InitAsDefaultInstance() { +} + +SliceParameter::SliceParameter(const SliceParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SliceParameter) +} + +void SliceParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + slice_dim_ = 1u; +} + +SliceParameter::~SliceParameter() { + // @@protoc_insertion_point(destructor:caffe.SliceParameter) + SharedDtor(); +} + +void SliceParameter::SharedDtor() { +} + +void SliceParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SliceParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SliceParameter_descriptor_; +} + +const SliceParameter& SliceParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SliceParameter_default_instance_; + +SliceParameter* SliceParameter::New(::google::protobuf::Arena* arena) const { + SliceParameter* n = new SliceParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SliceParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SliceParameter) + if (_has_bits_[0 / 32] & 5u) { + axis_ = 1; + slice_dim_ = 1u; + } + slice_point_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SliceParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SliceParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 slice_dim = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_slice_dim(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &slice_dim_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_slice_point; + break; + } + + // repeated uint32 slice_point = 2; + case 2: { + if (tag == 16) { + parse_slice_point: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 16, input, this->mutable_slice_point()))); + } else if (tag == 18) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_slice_point()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_slice_point; + if (input->ExpectTag(24)) goto parse_axis; + break; + } + + // optional int32 axis = 3 [default = 1]; + case 3: { + if (tag == 24) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SliceParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SliceParameter) + return false; +#undef DO_ +} + +void SliceParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SliceParameter) + // optional uint32 slice_dim = 1 [default = 1]; + if (has_slice_dim()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->slice_dim(), output); + } + + // repeated uint32 slice_point = 2; + for (int i = 0; i < this->slice_point_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 2, this->slice_point(i), output); + } + + // optional int32 axis = 3 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->axis(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SliceParameter) +} + +::google::protobuf::uint8* SliceParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SliceParameter) + // optional uint32 slice_dim = 1 [default = 1]; + if (has_slice_dim()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->slice_dim(), target); + } + + // repeated uint32 slice_point = 2; + for (int i = 0; i < this->slice_point_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(2, this->slice_point(i), target); + } + + // optional int32 axis = 3 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->axis(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SliceParameter) + return target; +} + +size_t SliceParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SliceParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 5u) { + // optional int32 axis = 3 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional uint32 slice_dim = 1 [default = 1]; + if (has_slice_dim()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->slice_dim()); + } + + } + // repeated uint32 slice_point = 2; + { + size_t data_size = 0; + unsigned int count = this->slice_point_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->slice_point(i)); + } + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->slice_point_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SliceParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SliceParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SliceParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SliceParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SliceParameter) + UnsafeMergeFrom(*source); + } +} + +void SliceParameter::MergeFrom(const SliceParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SliceParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SliceParameter::UnsafeMergeFrom(const SliceParameter& from) { + GOOGLE_DCHECK(&from != this); + slice_point_.UnsafeMergeFrom(from.slice_point_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_slice_dim()) { + set_slice_dim(from.slice_dim()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SliceParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SliceParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SliceParameter::CopyFrom(const SliceParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SliceParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SliceParameter::IsInitialized() const { + + return true; +} + +void SliceParameter::Swap(SliceParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void SliceParameter::InternalSwap(SliceParameter* other) { + std::swap(axis_, other->axis_); + slice_point_.UnsafeArenaSwap(&other->slice_point_); + std::swap(slice_dim_, other->slice_dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SliceParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SliceParameter_descriptor_; + metadata.reflection = SliceParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SliceParameter + +// optional int32 axis = 3 [default = 1]; +bool SliceParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SliceParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void SliceParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void SliceParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 SliceParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.SliceParameter.axis) + return axis_; +} +void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.SliceParameter.axis) +} + +// repeated uint32 slice_point = 2; +int SliceParameter::slice_point_size() const { + return slice_point_.size(); +} +void SliceParameter::clear_slice_point() { + slice_point_.Clear(); +} +::google::protobuf::uint32 SliceParameter::slice_point(int index) const { + // @@protoc_insertion_point(field_get:caffe.SliceParameter.slice_point) + return slice_point_.Get(index); +} +void SliceParameter::set_slice_point(int index, ::google::protobuf::uint32 value) { + slice_point_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.SliceParameter.slice_point) +} +void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:caffe.SliceParameter.slice_point) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:caffe.SliceParameter.slice_point) + return slice_point_; +} +::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:caffe.SliceParameter.slice_point) + return &slice_point_; +} + +// optional uint32 slice_dim = 1 [default = 1]; +bool SliceParameter::has_slice_dim() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void SliceParameter::set_has_slice_dim() { + _has_bits_[0] |= 0x00000004u; +} +void SliceParameter::clear_has_slice_dim() { + _has_bits_[0] &= ~0x00000004u; +} +void SliceParameter::clear_slice_dim() { + slice_dim_ = 1u; + clear_has_slice_dim(); +} +::google::protobuf::uint32 SliceParameter::slice_dim() const { + // @@protoc_insertion_point(field_get:caffe.SliceParameter.slice_dim) + return slice_dim_; +} +void SliceParameter::set_slice_dim(::google::protobuf::uint32 value) { + set_has_slice_dim(); + slice_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.SliceParameter.slice_dim) +} + +inline const SliceParameter* SliceParameter::internal_default_instance() { + return &SliceParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* SoftmaxParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SoftmaxParameter_Engine_descriptor_; +} +bool SoftmaxParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SoftmaxParameter_Engine SoftmaxParameter::DEFAULT; +const SoftmaxParameter_Engine SoftmaxParameter::CAFFE; +const SoftmaxParameter_Engine SoftmaxParameter::CUDNN; +const SoftmaxParameter_Engine SoftmaxParameter::Engine_MIN; +const SoftmaxParameter_Engine SoftmaxParameter::Engine_MAX; +const int SoftmaxParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SoftmaxParameter::kEngineFieldNumber; +const int SoftmaxParameter::kAxisFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SoftmaxParameter::SoftmaxParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SoftmaxParameter) +} + +void SoftmaxParameter::InitAsDefaultInstance() { +} + +SoftmaxParameter::SoftmaxParameter(const SoftmaxParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SoftmaxParameter) +} + +void SoftmaxParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + axis_ = 1; +} + +SoftmaxParameter::~SoftmaxParameter() { + // @@protoc_insertion_point(destructor:caffe.SoftmaxParameter) + SharedDtor(); +} + +void SoftmaxParameter::SharedDtor() { +} + +void SoftmaxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SoftmaxParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SoftmaxParameter_descriptor_; +} + +const SoftmaxParameter& SoftmaxParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SoftmaxParameter_default_instance_; + +SoftmaxParameter* SoftmaxParameter::New(::google::protobuf::Arena* arena) const { + SoftmaxParameter* n = new SoftmaxParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SoftmaxParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SoftmaxParameter) + if (_has_bits_[0 / 32] & 3u) { + engine_ = 0; + axis_ = 1; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SoftmaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SoftmaxParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SoftmaxParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::SoftmaxParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_axis; + break; + } + + // optional int32 axis = 2 [default = 1]; + case 2: { + if (tag == 16) { + parse_axis: + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SoftmaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SoftmaxParameter) + return false; +#undef DO_ +} + +void SoftmaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SoftmaxParameter) + // optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->axis(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SoftmaxParameter) +} + +::google::protobuf::uint8* SoftmaxParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SoftmaxParameter) + // optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->engine(), target); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->axis(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SoftmaxParameter) + return target; +} + +size_t SoftmaxParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SoftmaxParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + // optional int32 axis = 2 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SoftmaxParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SoftmaxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SoftmaxParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SoftmaxParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SoftmaxParameter) + UnsafeMergeFrom(*source); + } +} + +void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SoftmaxParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SoftmaxParameter::UnsafeMergeFrom(const SoftmaxParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SoftmaxParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SoftmaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SoftmaxParameter::CopyFrom(const SoftmaxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SoftmaxParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SoftmaxParameter::IsInitialized() const { + + return true; +} + +void SoftmaxParameter::Swap(SoftmaxParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void SoftmaxParameter::InternalSwap(SoftmaxParameter* other) { + std::swap(engine_, other->engine_); + std::swap(axis_, other->axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SoftmaxParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SoftmaxParameter_descriptor_; + metadata.reflection = SoftmaxParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SoftmaxParameter + +// optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; +bool SoftmaxParameter::has_engine() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SoftmaxParameter::set_has_engine() { + _has_bits_[0] |= 0x00000001u; +} +void SoftmaxParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000001u; +} +void SoftmaxParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.SoftmaxParameter.engine) + return static_cast< ::caffe::SoftmaxParameter_Engine >(engine_); +} +void SoftmaxParameter::set_engine(::caffe::SoftmaxParameter_Engine value) { + assert(::caffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.SoftmaxParameter.engine) +} + +// optional int32 axis = 2 [default = 1]; +bool SoftmaxParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void SoftmaxParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +void SoftmaxParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +void SoftmaxParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 SoftmaxParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.SoftmaxParameter.axis) + return axis_; +} +void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.SoftmaxParameter.axis) +} + +inline const SoftmaxParameter* SoftmaxParameter::internal_default_instance() { + return &SoftmaxParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* TanHParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return TanHParameter_Engine_descriptor_; +} +bool TanHParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const TanHParameter_Engine TanHParameter::DEFAULT; +const TanHParameter_Engine TanHParameter::CAFFE; +const TanHParameter_Engine TanHParameter::CUDNN; +const TanHParameter_Engine TanHParameter::Engine_MIN; +const TanHParameter_Engine TanHParameter::Engine_MAX; +const int TanHParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TanHParameter::kEngineFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TanHParameter::TanHParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.TanHParameter) +} + +void TanHParameter::InitAsDefaultInstance() { +} + +TanHParameter::TanHParameter(const TanHParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.TanHParameter) +} + +void TanHParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; +} + +TanHParameter::~TanHParameter() { + // @@protoc_insertion_point(destructor:caffe.TanHParameter) + SharedDtor(); +} + +void TanHParameter::SharedDtor() { +} + +void TanHParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TanHParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TanHParameter_descriptor_; +} + +const TanHParameter& TanHParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed TanHParameter_default_instance_; + +TanHParameter* TanHParameter::New(::google::protobuf::Arena* arena) const { + TanHParameter* n = new TanHParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void TanHParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.TanHParameter) + engine_ = 0; + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool TanHParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.TanHParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::TanHParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::TanHParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.TanHParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.TanHParameter) + return false; +#undef DO_ +} + +void TanHParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.TanHParameter) + // optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.TanHParameter) +} + +::google::protobuf::uint8* TanHParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.TanHParameter) + // optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->engine(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.TanHParameter) + return target; +} + +size_t TanHParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.TanHParameter) + size_t total_size = 0; + + // optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TanHParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.TanHParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const TanHParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.TanHParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.TanHParameter) + UnsafeMergeFrom(*source); + } +} + +void TanHParameter::MergeFrom(const TanHParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.TanHParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void TanHParameter::UnsafeMergeFrom(const TanHParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void TanHParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.TanHParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TanHParameter::CopyFrom(const TanHParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.TanHParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool TanHParameter::IsInitialized() const { + + return true; +} + +void TanHParameter::Swap(TanHParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void TanHParameter::InternalSwap(TanHParameter* other) { + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata TanHParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TanHParameter_descriptor_; + metadata.reflection = TanHParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// TanHParameter + +// optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; +bool TanHParameter::has_engine() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void TanHParameter::set_has_engine() { + _has_bits_[0] |= 0x00000001u; +} +void TanHParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000001u; +} +void TanHParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.TanHParameter.engine) + return static_cast< ::caffe::TanHParameter_Engine >(engine_); +} +void TanHParameter::set_engine(::caffe::TanHParameter_Engine value) { + assert(::caffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.TanHParameter.engine) +} + +inline const TanHParameter* TanHParameter::internal_default_instance() { + return &TanHParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TileParameter::kAxisFieldNumber; +const int TileParameter::kTilesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TileParameter::TileParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.TileParameter) +} + +void TileParameter::InitAsDefaultInstance() { +} + +TileParameter::TileParameter(const TileParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.TileParameter) +} + +void TileParameter::SharedCtor() { + _cached_size_ = 0; + tiles_ = 0; + axis_ = 1; +} + +TileParameter::~TileParameter() { + // @@protoc_insertion_point(destructor:caffe.TileParameter) + SharedDtor(); +} + +void TileParameter::SharedDtor() { +} + +void TileParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TileParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TileParameter_descriptor_; +} + +const TileParameter& TileParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed TileParameter_default_instance_; + +TileParameter* TileParameter::New(::google::protobuf::Arena* arena) const { + TileParameter* n = new TileParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void TileParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.TileParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + tiles_ = 0; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool TileParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.TileParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 axis = 1 [default = 1]; + case 1: { + if (tag == 8) { + set_has_axis(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_tiles; + break; + } + + // optional int32 tiles = 2; + case 2: { + if (tag == 16) { + parse_tiles: + set_has_tiles(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &tiles_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.TileParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.TileParameter) + return false; +#undef DO_ +} + +void TileParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.TileParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->axis(), output); + } + + // optional int32 tiles = 2; + if (has_tiles()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->tiles(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.TileParameter) +} + +::google::protobuf::uint8* TileParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.TileParameter) + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->axis(), target); + } + + // optional int32 tiles = 2; + if (has_tiles()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->tiles(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.TileParameter) + return target; +} + +size_t TileParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.TileParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional int32 axis = 1 [default = 1]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + // optional int32 tiles = 2; + if (has_tiles()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->tiles()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TileParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.TileParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const TileParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.TileParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.TileParameter) + UnsafeMergeFrom(*source); + } +} + +void TileParameter::MergeFrom(const TileParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.TileParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void TileParameter::UnsafeMergeFrom(const TileParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_tiles()) { + set_tiles(from.tiles()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void TileParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.TileParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TileParameter::CopyFrom(const TileParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.TileParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool TileParameter::IsInitialized() const { + + return true; +} + +void TileParameter::Swap(TileParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void TileParameter::InternalSwap(TileParameter* other) { + std::swap(axis_, other->axis_); + std::swap(tiles_, other->tiles_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata TileParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TileParameter_descriptor_; + metadata.reflection = TileParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// TileParameter + +// optional int32 axis = 1 [default = 1]; +bool TileParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void TileParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +void TileParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +void TileParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +::google::protobuf::int32 TileParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.TileParameter.axis) + return axis_; +} +void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.TileParameter.axis) +} + +// optional int32 tiles = 2; +bool TileParameter::has_tiles() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void TileParameter::set_has_tiles() { + _has_bits_[0] |= 0x00000002u; +} +void TileParameter::clear_has_tiles() { + _has_bits_[0] &= ~0x00000002u; +} +void TileParameter::clear_tiles() { + tiles_ = 0; + clear_has_tiles(); +} +::google::protobuf::int32 TileParameter::tiles() const { + // @@protoc_insertion_point(field_get:caffe.TileParameter.tiles) + return tiles_; +} +void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:caffe.TileParameter.tiles) +} + +inline const TileParameter* TileParameter::internal_default_instance() { + return &TileParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ThresholdParameter::kThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ThresholdParameter::ThresholdParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.ThresholdParameter) +} + +void ThresholdParameter::InitAsDefaultInstance() { +} + +ThresholdParameter::ThresholdParameter(const ThresholdParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.ThresholdParameter) +} + +void ThresholdParameter::SharedCtor() { + _cached_size_ = 0; + threshold_ = 0; +} + +ThresholdParameter::~ThresholdParameter() { + // @@protoc_insertion_point(destructor:caffe.ThresholdParameter) + SharedDtor(); +} + +void ThresholdParameter::SharedDtor() { +} + +void ThresholdParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ThresholdParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ThresholdParameter_descriptor_; +} + +const ThresholdParameter& ThresholdParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed ThresholdParameter_default_instance_; + +ThresholdParameter* ThresholdParameter::New(::google::protobuf::Arena* arena) const { + ThresholdParameter* n = new ThresholdParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ThresholdParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.ThresholdParameter) + threshold_ = 0; + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ThresholdParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.ThresholdParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float threshold = 1 [default = 0]; + case 1: { + if (tag == 13) { + set_has_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.ThresholdParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.ThresholdParameter) + return false; +#undef DO_ +} + +void ThresholdParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.ThresholdParameter) + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->threshold(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.ThresholdParameter) +} + +::google::protobuf::uint8* ThresholdParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.ThresholdParameter) + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->threshold(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.ThresholdParameter) + return target; +} + +size_t ThresholdParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.ThresholdParameter) + size_t total_size = 0; + + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + total_size += 1 + 4; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ThresholdParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.ThresholdParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ThresholdParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.ThresholdParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.ThresholdParameter) + UnsafeMergeFrom(*source); + } +} + +void ThresholdParameter::MergeFrom(const ThresholdParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.ThresholdParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void ThresholdParameter::UnsafeMergeFrom(const ThresholdParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_threshold()) { + set_threshold(from.threshold()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void ThresholdParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.ThresholdParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ThresholdParameter::CopyFrom(const ThresholdParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.ThresholdParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool ThresholdParameter::IsInitialized() const { + + return true; +} + +void ThresholdParameter::Swap(ThresholdParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void ThresholdParameter::InternalSwap(ThresholdParameter* other) { + std::swap(threshold_, other->threshold_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ThresholdParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ThresholdParameter_descriptor_; + metadata.reflection = ThresholdParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ThresholdParameter + +// optional float threshold = 1 [default = 0]; +bool ThresholdParameter::has_threshold() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ThresholdParameter::set_has_threshold() { + _has_bits_[0] |= 0x00000001u; +} +void ThresholdParameter::clear_has_threshold() { + _has_bits_[0] &= ~0x00000001u; +} +void ThresholdParameter::clear_threshold() { + threshold_ = 0; + clear_has_threshold(); +} +float ThresholdParameter::threshold() const { + // @@protoc_insertion_point(field_get:caffe.ThresholdParameter.threshold) + return threshold_; +} +void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.ThresholdParameter.threshold) +} + +inline const ThresholdParameter* ThresholdParameter::internal_default_instance() { + return &ThresholdParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +::std::string* WindowDataParameter::_default_crop_mode_ = NULL; +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int WindowDataParameter::kSourceFieldNumber; +const int WindowDataParameter::kScaleFieldNumber; +const int WindowDataParameter::kMeanFileFieldNumber; +const int WindowDataParameter::kBatchSizeFieldNumber; +const int WindowDataParameter::kCropSizeFieldNumber; +const int WindowDataParameter::kMirrorFieldNumber; +const int WindowDataParameter::kFgThresholdFieldNumber; +const int WindowDataParameter::kBgThresholdFieldNumber; +const int WindowDataParameter::kFgFractionFieldNumber; +const int WindowDataParameter::kContextPadFieldNumber; +const int WindowDataParameter::kCropModeFieldNumber; +const int WindowDataParameter::kCacheImagesFieldNumber; +const int WindowDataParameter::kRootFolderFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +WindowDataParameter::WindowDataParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.WindowDataParameter) +} + +void WindowDataParameter::InitAsDefaultInstance() { +} + +WindowDataParameter::WindowDataParameter(const WindowDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.WindowDataParameter) +} + +void WindowDataParameter::SharedCtor() { + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_mode_.UnsafeSetDefault(_default_crop_mode_); + root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&batch_size_, 0, reinterpret_cast(&context_pad_) - + reinterpret_cast(&batch_size_) + sizeof(context_pad_)); + scale_ = 1; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + fg_fraction_ = 0.25f; +} + +WindowDataParameter::~WindowDataParameter() { + // @@protoc_insertion_point(destructor:caffe.WindowDataParameter) + SharedDtor(); +} + +void WindowDataParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_mode_.DestroyNoArena(_default_crop_mode_); + root_folder_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void WindowDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* WindowDataParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return WindowDataParameter_descriptor_; +} + +const WindowDataParameter& WindowDataParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed WindowDataParameter_default_instance_; + +WindowDataParameter* WindowDataParameter::New(::google::protobuf::Arena* arena) const { + WindowDataParameter* n = new WindowDataParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void WindowDataParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.WindowDataParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(WindowDataParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(batch_size_, mirror_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + } + if (_has_bits_[8 / 32] & 7936u) { + ZR_(cache_images_, context_pad_); + fg_fraction_ = 0.25f; + if (has_crop_mode()) { + crop_mode_.ClearToDefaultNoArena(_default_crop_mode_); + } + if (has_root_folder()) { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool WindowDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.WindowDataParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string source = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.WindowDataParameter.source"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_scale; + break; + } + + // optional float scale = 2 [default = 1]; + case 2: { + if (tag == 21) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_mean_file; + break; + } + + // optional string mean_file = 3; + case 3: { + if (tag == 26) { + parse_mean_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_mean_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.WindowDataParameter.mean_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_batch_size; + break; + } + + // optional uint32 batch_size = 4; + case 4: { + if (tag == 32) { + parse_batch_size: + set_has_batch_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_crop_size; + break; + } + + // optional uint32 crop_size = 5 [default = 0]; + case 5: { + if (tag == 40) { + parse_crop_size: + set_has_crop_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_mirror; + break; + } + + // optional bool mirror = 6 [default = false]; + case 6: { + if (tag == 48) { + parse_mirror: + set_has_mirror(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(61)) goto parse_fg_threshold; + break; + } + + // optional float fg_threshold = 7 [default = 0.5]; + case 7: { + if (tag == 61) { + parse_fg_threshold: + set_has_fg_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(69)) goto parse_bg_threshold; + break; + } + + // optional float bg_threshold = 8 [default = 0.5]; + case 8: { + if (tag == 69) { + parse_bg_threshold: + set_has_bg_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bg_threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(77)) goto parse_fg_fraction; + break; + } + + // optional float fg_fraction = 9 [default = 0.25]; + case 9: { + if (tag == 77) { + parse_fg_fraction: + set_has_fg_fraction(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_fraction_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_context_pad; + break; + } + + // optional uint32 context_pad = 10 [default = 0]; + case 10: { + if (tag == 80) { + parse_context_pad: + set_has_context_pad(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &context_pad_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_crop_mode; + break; + } + + // optional string crop_mode = 11 [default = "warp"]; + case 11: { + if (tag == 90) { + parse_crop_mode: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_crop_mode())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->crop_mode().data(), this->crop_mode().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.WindowDataParameter.crop_mode"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_cache_images; + break; + } + + // optional bool cache_images = 12 [default = false]; + case 12: { + if (tag == 96) { + parse_cache_images: + set_has_cache_images(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cache_images_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(106)) goto parse_root_folder; + break; + } + + // optional string root_folder = 13 [default = ""]; + case 13: { + if (tag == 106) { + parse_root_folder: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_root_folder())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->root_folder().data(), this->root_folder().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.WindowDataParameter.root_folder"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.WindowDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.WindowDataParameter) + return false; +#undef DO_ +} + +void WindowDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.WindowDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->scale(), output); + } + + // optional string mean_file = 3; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.mean_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->mean_file(), output); + } + + // optional uint32 batch_size = 4; + if (has_batch_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->batch_size(), output); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->crop_size(), output); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->mirror(), output); + } + + // optional float fg_threshold = 7 [default = 0.5]; + if (has_fg_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->fg_threshold(), output); + } + + // optional float bg_threshold = 8 [default = 0.5]; + if (has_bg_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->bg_threshold(), output); + } + + // optional float fg_fraction = 9 [default = 0.25]; + if (has_fg_fraction()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->fg_fraction(), output); + } + + // optional uint32 context_pad = 10 [default = 0]; + if (has_context_pad()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->context_pad(), output); + } + + // optional string crop_mode = 11 [default = "warp"]; + if (has_crop_mode()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->crop_mode().data(), this->crop_mode().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.crop_mode"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->crop_mode(), output); + } + + // optional bool cache_images = 12 [default = false]; + if (has_cache_images()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->cache_images(), output); + } + + // optional string root_folder = 13 [default = ""]; + if (has_root_folder()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->root_folder().data(), this->root_folder().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.root_folder"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 13, this->root_folder(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.WindowDataParameter) +} + +::google::protobuf::uint8* WindowDataParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.WindowDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->source(), target); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->scale(), target); + } + + // optional string mean_file = 3; + if (has_mean_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->mean_file().data(), this->mean_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.mean_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->mean_file(), target); + } + + // optional uint32 batch_size = 4; + if (has_batch_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->batch_size(), target); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->crop_size(), target); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->mirror(), target); + } + + // optional float fg_threshold = 7 [default = 0.5]; + if (has_fg_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->fg_threshold(), target); + } + + // optional float bg_threshold = 8 [default = 0.5]; + if (has_bg_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->bg_threshold(), target); + } + + // optional float fg_fraction = 9 [default = 0.25]; + if (has_fg_fraction()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->fg_fraction(), target); + } + + // optional uint32 context_pad = 10 [default = 0]; + if (has_context_pad()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->context_pad(), target); + } + + // optional string crop_mode = 11 [default = "warp"]; + if (has_crop_mode()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->crop_mode().data(), this->crop_mode().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.crop_mode"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 11, this->crop_mode(), target); + } + + // optional bool cache_images = 12 [default = false]; + if (has_cache_images()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->cache_images(), target); + } + + // optional string root_folder = 13 [default = ""]; + if (has_root_folder()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->root_folder().data(), this->root_folder().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.WindowDataParameter.root_folder"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 13, this->root_folder(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.WindowDataParameter) + return target; +} + +size_t WindowDataParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.WindowDataParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + // optional float scale = 2 [default = 1]; + if (has_scale()) { + total_size += 1 + 4; + } + + // optional string mean_file = 3; + if (has_mean_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->mean_file()); + } + + // optional uint32 batch_size = 4; + if (has_batch_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_size()); + } + + // optional uint32 crop_size = 5 [default = 0]; + if (has_crop_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->crop_size()); + } + + // optional bool mirror = 6 [default = false]; + if (has_mirror()) { + total_size += 1 + 1; + } + + // optional float fg_threshold = 7 [default = 0.5]; + if (has_fg_threshold()) { + total_size += 1 + 4; + } + + // optional float bg_threshold = 8 [default = 0.5]; + if (has_bg_threshold()) { + total_size += 1 + 4; + } + + } + if (_has_bits_[8 / 32] & 7936u) { + // optional float fg_fraction = 9 [default = 0.25]; + if (has_fg_fraction()) { + total_size += 1 + 4; + } + + // optional uint32 context_pad = 10 [default = 0]; + if (has_context_pad()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->context_pad()); + } + + // optional string crop_mode = 11 [default = "warp"]; + if (has_crop_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->crop_mode()); + } + + // optional bool cache_images = 12 [default = false]; + if (has_cache_images()) { + total_size += 1 + 1; + } + + // optional string root_folder = 13 [default = ""]; + if (has_root_folder()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->root_folder()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void WindowDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.WindowDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const WindowDataParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.WindowDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.WindowDataParameter) + UnsafeMergeFrom(*source); + } +} + +void WindowDataParameter::MergeFrom(const WindowDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.WindowDataParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void WindowDataParameter::UnsafeMergeFrom(const WindowDataParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_mean_file()) { + set_has_mean_file(); + mean_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.mean_file_); + } + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_crop_size()) { + set_crop_size(from.crop_size()); + } + if (from.has_mirror()) { + set_mirror(from.mirror()); + } + if (from.has_fg_threshold()) { + set_fg_threshold(from.fg_threshold()); + } + if (from.has_bg_threshold()) { + set_bg_threshold(from.bg_threshold()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_fg_fraction()) { + set_fg_fraction(from.fg_fraction()); + } + if (from.has_context_pad()) { + set_context_pad(from.context_pad()); + } + if (from.has_crop_mode()) { + set_has_crop_mode(); + crop_mode_.AssignWithDefault(_default_crop_mode_, from.crop_mode_); + } + if (from.has_cache_images()) { + set_cache_images(from.cache_images()); + } + if (from.has_root_folder()) { + set_has_root_folder(); + root_folder_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.root_folder_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void WindowDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.WindowDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WindowDataParameter::CopyFrom(const WindowDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.WindowDataParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool WindowDataParameter::IsInitialized() const { + + return true; +} + +void WindowDataParameter::Swap(WindowDataParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void WindowDataParameter::InternalSwap(WindowDataParameter* other) { + source_.Swap(&other->source_); + std::swap(scale_, other->scale_); + mean_file_.Swap(&other->mean_file_); + std::swap(batch_size_, other->batch_size_); + std::swap(crop_size_, other->crop_size_); + std::swap(mirror_, other->mirror_); + std::swap(fg_threshold_, other->fg_threshold_); + std::swap(bg_threshold_, other->bg_threshold_); + std::swap(fg_fraction_, other->fg_fraction_); + std::swap(context_pad_, other->context_pad_); + crop_mode_.Swap(&other->crop_mode_); + std::swap(cache_images_, other->cache_images_); + root_folder_.Swap(&other->root_folder_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata WindowDataParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = WindowDataParameter_descriptor_; + metadata.reflection = WindowDataParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// WindowDataParameter + +// optional string source = 1; +bool WindowDataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void WindowDataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +void WindowDataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +void WindowDataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +const ::std::string& WindowDataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void WindowDataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.source) +} +void WindowDataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.source) +} +void WindowDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.source) +} +::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* WindowDataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void WindowDataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.source) +} + +// optional float scale = 2 [default = 1]; +bool WindowDataParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void WindowDataParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +void WindowDataParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +void WindowDataParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float WindowDataParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.scale) + return scale_; +} +void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.scale) +} + +// optional string mean_file = 3; +bool WindowDataParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void WindowDataParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000004u; +} +void WindowDataParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000004u; +} +void WindowDataParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +const ::std::string& WindowDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void WindowDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.mean_file) +} +void WindowDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.mean_file) +} +void WindowDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.mean_file) +} +::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* WindowDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void WindowDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.mean_file) +} + +// optional uint32 batch_size = 4; +bool WindowDataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void WindowDataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000008u; +} +void WindowDataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000008u; +} +void WindowDataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +::google::protobuf::uint32 WindowDataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.batch_size) + return batch_size_; +} +void WindowDataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.batch_size) +} + +// optional uint32 crop_size = 5 [default = 0]; +bool WindowDataParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void WindowDataParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000010u; +} +void WindowDataParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000010u; +} +void WindowDataParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +::google::protobuf::uint32 WindowDataParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.crop_size) + return crop_size_; +} +void WindowDataParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.crop_size) +} + +// optional bool mirror = 6 [default = false]; +bool WindowDataParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void WindowDataParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000020u; +} +void WindowDataParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000020u; +} +void WindowDataParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +bool WindowDataParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.mirror) + return mirror_; +} +void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.mirror) +} + +// optional float fg_threshold = 7 [default = 0.5]; +bool WindowDataParameter::has_fg_threshold() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void WindowDataParameter::set_has_fg_threshold() { + _has_bits_[0] |= 0x00000040u; +} +void WindowDataParameter::clear_has_fg_threshold() { + _has_bits_[0] &= ~0x00000040u; +} +void WindowDataParameter::clear_fg_threshold() { + fg_threshold_ = 0.5f; + clear_has_fg_threshold(); +} +float WindowDataParameter::fg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.fg_threshold) + return fg_threshold_; +} +void WindowDataParameter::set_fg_threshold(float value) { + set_has_fg_threshold(); + fg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.fg_threshold) +} + +// optional float bg_threshold = 8 [default = 0.5]; +bool WindowDataParameter::has_bg_threshold() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void WindowDataParameter::set_has_bg_threshold() { + _has_bits_[0] |= 0x00000080u; +} +void WindowDataParameter::clear_has_bg_threshold() { + _has_bits_[0] &= ~0x00000080u; +} +void WindowDataParameter::clear_bg_threshold() { + bg_threshold_ = 0.5f; + clear_has_bg_threshold(); +} +float WindowDataParameter::bg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.bg_threshold) + return bg_threshold_; +} +void WindowDataParameter::set_bg_threshold(float value) { + set_has_bg_threshold(); + bg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.bg_threshold) +} + +// optional float fg_fraction = 9 [default = 0.25]; +bool WindowDataParameter::has_fg_fraction() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void WindowDataParameter::set_has_fg_fraction() { + _has_bits_[0] |= 0x00000100u; +} +void WindowDataParameter::clear_has_fg_fraction() { + _has_bits_[0] &= ~0x00000100u; +} +void WindowDataParameter::clear_fg_fraction() { + fg_fraction_ = 0.25f; + clear_has_fg_fraction(); +} +float WindowDataParameter::fg_fraction() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.fg_fraction) + return fg_fraction_; +} +void WindowDataParameter::set_fg_fraction(float value) { + set_has_fg_fraction(); + fg_fraction_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.fg_fraction) +} + +// optional uint32 context_pad = 10 [default = 0]; +bool WindowDataParameter::has_context_pad() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void WindowDataParameter::set_has_context_pad() { + _has_bits_[0] |= 0x00000200u; +} +void WindowDataParameter::clear_has_context_pad() { + _has_bits_[0] &= ~0x00000200u; +} +void WindowDataParameter::clear_context_pad() { + context_pad_ = 0u; + clear_has_context_pad(); +} +::google::protobuf::uint32 WindowDataParameter::context_pad() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.context_pad) + return context_pad_; +} +void WindowDataParameter::set_context_pad(::google::protobuf::uint32 value) { + set_has_context_pad(); + context_pad_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.context_pad) +} + +// optional string crop_mode = 11 [default = "warp"]; +bool WindowDataParameter::has_crop_mode() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void WindowDataParameter::set_has_crop_mode() { + _has_bits_[0] |= 0x00000400u; +} +void WindowDataParameter::clear_has_crop_mode() { + _has_bits_[0] &= ~0x00000400u; +} +void WindowDataParameter::clear_crop_mode() { + crop_mode_.ClearToDefaultNoArena(_default_crop_mode_); + clear_has_crop_mode(); +} +const ::std::string& WindowDataParameter::crop_mode() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.crop_mode) + return crop_mode_.GetNoArena(_default_crop_mode_); +} +void WindowDataParameter::set_crop_mode(const ::std::string& value) { + set_has_crop_mode(); + crop_mode_.SetNoArena(_default_crop_mode_, value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.crop_mode) +} +void WindowDataParameter::set_crop_mode(const char* value) { + set_has_crop_mode(); + crop_mode_.SetNoArena(_default_crop_mode_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.crop_mode) +} +void WindowDataParameter::set_crop_mode(const char* value, size_t size) { + set_has_crop_mode(); + crop_mode_.SetNoArena(_default_crop_mode_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.crop_mode) +} +::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.crop_mode) + return crop_mode_.MutableNoArena(_default_crop_mode_); +} +::std::string* WindowDataParameter::release_crop_mode() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.crop_mode) + clear_has_crop_mode(); + return crop_mode_.ReleaseNoArena(_default_crop_mode_); +} +void WindowDataParameter::set_allocated_crop_mode(::std::string* crop_mode) { + if (crop_mode != NULL) { + set_has_crop_mode(); + } else { + clear_has_crop_mode(); + } + crop_mode_.SetAllocatedNoArena(_default_crop_mode_, crop_mode); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.crop_mode) +} + +// optional bool cache_images = 12 [default = false]; +bool WindowDataParameter::has_cache_images() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void WindowDataParameter::set_has_cache_images() { + _has_bits_[0] |= 0x00000800u; +} +void WindowDataParameter::clear_has_cache_images() { + _has_bits_[0] &= ~0x00000800u; +} +void WindowDataParameter::clear_cache_images() { + cache_images_ = false; + clear_has_cache_images(); +} +bool WindowDataParameter::cache_images() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.cache_images) + return cache_images_; +} +void WindowDataParameter::set_cache_images(bool value) { + set_has_cache_images(); + cache_images_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.cache_images) +} + +// optional string root_folder = 13 [default = ""]; +bool WindowDataParameter::has_root_folder() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void WindowDataParameter::set_has_root_folder() { + _has_bits_[0] |= 0x00001000u; +} +void WindowDataParameter::clear_has_root_folder() { + _has_bits_[0] &= ~0x00001000u; +} +void WindowDataParameter::clear_root_folder() { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_root_folder(); +} +const ::std::string& WindowDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.root_folder) + return root_folder_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void WindowDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.root_folder) +} +void WindowDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.root_folder) +} +void WindowDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.root_folder) +} +::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* WindowDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.root_folder) + clear_has_root_folder(); + return root_folder_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void WindowDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder != NULL) { + set_has_root_folder(); + } else { + clear_has_root_folder(); + } + root_folder_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root_folder); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.root_folder) +} + +inline const WindowDataParameter* WindowDataParameter::internal_default_instance() { + return &WindowDataParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* SPPParameter_PoolMethod_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SPPParameter_PoolMethod_descriptor_; +} +bool SPPParameter_PoolMethod_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SPPParameter_PoolMethod SPPParameter::MAX; +const SPPParameter_PoolMethod SPPParameter::AVE; +const SPPParameter_PoolMethod SPPParameter::STOCHASTIC; +const SPPParameter_PoolMethod SPPParameter::PoolMethod_MIN; +const SPPParameter_PoolMethod SPPParameter::PoolMethod_MAX; +const int SPPParameter::PoolMethod_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* SPPParameter_Engine_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SPPParameter_Engine_descriptor_; +} +bool SPPParameter_Engine_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const SPPParameter_Engine SPPParameter::DEFAULT; +const SPPParameter_Engine SPPParameter::CAFFE; +const SPPParameter_Engine SPPParameter::CUDNN; +const SPPParameter_Engine SPPParameter::Engine_MIN; +const SPPParameter_Engine SPPParameter::Engine_MAX; +const int SPPParameter::Engine_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SPPParameter::kPyramidHeightFieldNumber; +const int SPPParameter::kPoolFieldNumber; +const int SPPParameter::kEngineFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SPPParameter::SPPParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.SPPParameter) +} + +void SPPParameter::InitAsDefaultInstance() { +} + +SPPParameter::SPPParameter(const SPPParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.SPPParameter) +} + +void SPPParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(&pyramid_height_, 0, reinterpret_cast(&engine_) - + reinterpret_cast(&pyramid_height_) + sizeof(engine_)); +} + +SPPParameter::~SPPParameter() { + // @@protoc_insertion_point(destructor:caffe.SPPParameter) + SharedDtor(); +} + +void SPPParameter::SharedDtor() { +} + +void SPPParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SPPParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SPPParameter_descriptor_; +} + +const SPPParameter& SPPParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed SPPParameter_default_instance_; + +SPPParameter* SPPParameter::New(::google::protobuf::Arena* arena) const { + SPPParameter* n = new SPPParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SPPParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.SPPParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(SPPParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(pyramid_height_, engine_); + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SPPParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.SPPParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 pyramid_height = 1; + case 1: { + if (tag == 8) { + set_has_pyramid_height(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pyramid_height_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_pool; + break; + } + + // optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + case 2: { + if (tag == 16) { + parse_pool: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SPPParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::caffe::SPPParameter_PoolMethod >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + case 6: { + if (tag == 48) { + parse_engine: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::SPPParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::caffe::SPPParameter_Engine >(value)); + } else { + mutable_unknown_fields()->AddVarint(6, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.SPPParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.SPPParameter) + return false; +#undef DO_ +} + +void SPPParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pyramid_height(), output); + } + + // optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->pool(), output); + } + + // optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.SPPParameter) +} + +::google::protobuf::uint8* SPPParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->pyramid_height(), target); + } + + // optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->pool(), target); + } + + // optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->engine(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.SPPParameter) + return target; +} + +size_t SPPParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.SPPParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pyramid_height()); + } + + // optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SPPParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.SPPParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SPPParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.SPPParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.SPPParameter) + UnsafeMergeFrom(*source); + } +} + +void SPPParameter::MergeFrom(const SPPParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.SPPParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void SPPParameter::UnsafeMergeFrom(const SPPParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_pyramid_height()) { + set_pyramid_height(from.pyramid_height()); + } + if (from.has_pool()) { + set_pool(from.pool()); + } + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void SPPParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.SPPParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SPPParameter::CopyFrom(const SPPParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.SPPParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool SPPParameter::IsInitialized() const { + + return true; +} + +void SPPParameter::Swap(SPPParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void SPPParameter::InternalSwap(SPPParameter* other) { + std::swap(pyramid_height_, other->pyramid_height_); + std::swap(pool_, other->pool_); + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SPPParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SPPParameter_descriptor_; + metadata.reflection = SPPParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SPPParameter + +// optional uint32 pyramid_height = 1; +bool SPPParameter::has_pyramid_height() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void SPPParameter::set_has_pyramid_height() { + _has_bits_[0] |= 0x00000001u; +} +void SPPParameter::clear_has_pyramid_height() { + _has_bits_[0] &= ~0x00000001u; +} +void SPPParameter::clear_pyramid_height() { + pyramid_height_ = 0u; + clear_has_pyramid_height(); +} +::google::protobuf::uint32 SPPParameter::pyramid_height() const { + // @@protoc_insertion_point(field_get:caffe.SPPParameter.pyramid_height) + return pyramid_height_; +} +void SPPParameter::set_pyramid_height(::google::protobuf::uint32 value) { + set_has_pyramid_height(); + pyramid_height_ = value; + // @@protoc_insertion_point(field_set:caffe.SPPParameter.pyramid_height) +} + +// optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; +bool SPPParameter::has_pool() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void SPPParameter::set_has_pool() { + _has_bits_[0] |= 0x00000002u; +} +void SPPParameter::clear_has_pool() { + _has_bits_[0] &= ~0x00000002u; +} +void SPPParameter::clear_pool() { + pool_ = 0; + clear_has_pool(); +} +::caffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:caffe.SPPParameter.pool) + return static_cast< ::caffe::SPPParameter_PoolMethod >(pool_); +} +void SPPParameter::set_pool(::caffe::SPPParameter_PoolMethod value) { + assert(::caffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:caffe.SPPParameter.pool) +} + +// optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; +bool SPPParameter::has_engine() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void SPPParameter::set_has_engine() { + _has_bits_[0] |= 0x00000004u; +} +void SPPParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000004u; +} +void SPPParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +::caffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.SPPParameter.engine) + return static_cast< ::caffe::SPPParameter_Engine >(engine_); +} +void SPPParameter::set_engine(::caffe::SPPParameter_Engine value) { + assert(::caffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.SPPParameter.engine) +} + +inline const SPPParameter* SPPParameter::internal_default_instance() { + return &SPPParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* V1LayerParameter_LayerType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return V1LayerParameter_LayerType_descriptor_; +} +bool V1LayerParameter_LayerType_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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const V1LayerParameter_LayerType V1LayerParameter::NONE; +const V1LayerParameter_LayerType V1LayerParameter::ABSVAL; +const V1LayerParameter_LayerType V1LayerParameter::ACCURACY; +const V1LayerParameter_LayerType V1LayerParameter::ARGMAX; +const V1LayerParameter_LayerType V1LayerParameter::BNLL; +const V1LayerParameter_LayerType V1LayerParameter::CONCAT; +const V1LayerParameter_LayerType V1LayerParameter::CONTRASTIVE_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::CONVOLUTION; +const V1LayerParameter_LayerType V1LayerParameter::DATA; +const V1LayerParameter_LayerType V1LayerParameter::DECONVOLUTION; +const V1LayerParameter_LayerType V1LayerParameter::DROPOUT; +const V1LayerParameter_LayerType V1LayerParameter::DUMMY_DATA; +const V1LayerParameter_LayerType V1LayerParameter::EUCLIDEAN_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::ELTWISE; +const V1LayerParameter_LayerType V1LayerParameter::EXP; +const V1LayerParameter_LayerType V1LayerParameter::FLATTEN; +const V1LayerParameter_LayerType V1LayerParameter::HDF5_DATA; +const V1LayerParameter_LayerType V1LayerParameter::HDF5_OUTPUT; +const V1LayerParameter_LayerType V1LayerParameter::HINGE_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::IM2COL; +const V1LayerParameter_LayerType V1LayerParameter::IMAGE_DATA; +const V1LayerParameter_LayerType V1LayerParameter::INFOGAIN_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::INNER_PRODUCT; +const V1LayerParameter_LayerType V1LayerParameter::LRN; +const V1LayerParameter_LayerType V1LayerParameter::MEMORY_DATA; +const V1LayerParameter_LayerType V1LayerParameter::MULTINOMIAL_LOGISTIC_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::MVN; +const V1LayerParameter_LayerType V1LayerParameter::POOLING; +const V1LayerParameter_LayerType V1LayerParameter::POWER; +const V1LayerParameter_LayerType V1LayerParameter::RELU; +const V1LayerParameter_LayerType V1LayerParameter::SIGMOID; +const V1LayerParameter_LayerType V1LayerParameter::SIGMOID_CROSS_ENTROPY_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::SILENCE; +const V1LayerParameter_LayerType V1LayerParameter::SOFTMAX; +const V1LayerParameter_LayerType V1LayerParameter::SOFTMAX_LOSS; +const V1LayerParameter_LayerType V1LayerParameter::SPLIT; +const V1LayerParameter_LayerType V1LayerParameter::SLICE; +const V1LayerParameter_LayerType V1LayerParameter::TANH; +const V1LayerParameter_LayerType V1LayerParameter::WINDOW_DATA; +const V1LayerParameter_LayerType V1LayerParameter::THRESHOLD; +const V1LayerParameter_LayerType V1LayerParameter::LayerType_MIN; +const V1LayerParameter_LayerType V1LayerParameter::LayerType_MAX; +const int V1LayerParameter::LayerType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return V1LayerParameter_DimCheckMode_descriptor_; +} +bool V1LayerParameter_DimCheckMode_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const V1LayerParameter_DimCheckMode V1LayerParameter::STRICT; +const V1LayerParameter_DimCheckMode V1LayerParameter::PERMISSIVE; +const V1LayerParameter_DimCheckMode V1LayerParameter::DimCheckMode_MIN; +const V1LayerParameter_DimCheckMode V1LayerParameter::DimCheckMode_MAX; +const int V1LayerParameter::DimCheckMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int V1LayerParameter::kBottomFieldNumber; +const int V1LayerParameter::kTopFieldNumber; +const int V1LayerParameter::kNameFieldNumber; +const int V1LayerParameter::kIncludeFieldNumber; +const int V1LayerParameter::kExcludeFieldNumber; +const int V1LayerParameter::kTypeFieldNumber; +const int V1LayerParameter::kBlobsFieldNumber; +const int V1LayerParameter::kParamFieldNumber; +const int V1LayerParameter::kBlobShareModeFieldNumber; +const int V1LayerParameter::kBlobsLrFieldNumber; +const int V1LayerParameter::kWeightDecayFieldNumber; +const int V1LayerParameter::kLossWeightFieldNumber; +const int V1LayerParameter::kAccuracyParamFieldNumber; +const int V1LayerParameter::kArgmaxParamFieldNumber; +const int V1LayerParameter::kConcatParamFieldNumber; +const int V1LayerParameter::kContrastiveLossParamFieldNumber; +const int V1LayerParameter::kConvolutionParamFieldNumber; +const int V1LayerParameter::kDataParamFieldNumber; +const int V1LayerParameter::kDropoutParamFieldNumber; +const int V1LayerParameter::kDummyDataParamFieldNumber; +const int V1LayerParameter::kEltwiseParamFieldNumber; +const int V1LayerParameter::kExpParamFieldNumber; +const int V1LayerParameter::kHdf5DataParamFieldNumber; +const int V1LayerParameter::kHdf5OutputParamFieldNumber; +const int V1LayerParameter::kHingeLossParamFieldNumber; +const int V1LayerParameter::kImageDataParamFieldNumber; +const int V1LayerParameter::kInfogainLossParamFieldNumber; +const int V1LayerParameter::kInnerProductParamFieldNumber; +const int V1LayerParameter::kLrnParamFieldNumber; +const int V1LayerParameter::kMemoryDataParamFieldNumber; +const int V1LayerParameter::kMvnParamFieldNumber; +const int V1LayerParameter::kPoolingParamFieldNumber; +const int V1LayerParameter::kPowerParamFieldNumber; +const int V1LayerParameter::kReluParamFieldNumber; +const int V1LayerParameter::kSigmoidParamFieldNumber; +const int V1LayerParameter::kSoftmaxParamFieldNumber; +const int V1LayerParameter::kSliceParamFieldNumber; +const int V1LayerParameter::kTanhParamFieldNumber; +const int V1LayerParameter::kThresholdParamFieldNumber; +const int V1LayerParameter::kWindowDataParamFieldNumber; +const int V1LayerParameter::kTransformParamFieldNumber; +const int V1LayerParameter::kLossParamFieldNumber; +const int V1LayerParameter::kLayerFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +V1LayerParameter::V1LayerParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.V1LayerParameter) +} + +void V1LayerParameter::InitAsDefaultInstance() { + accuracy_param_ = const_cast< ::caffe::AccuracyParameter*>( + ::caffe::AccuracyParameter::internal_default_instance()); + argmax_param_ = const_cast< ::caffe::ArgMaxParameter*>( + ::caffe::ArgMaxParameter::internal_default_instance()); + concat_param_ = const_cast< ::caffe::ConcatParameter*>( + ::caffe::ConcatParameter::internal_default_instance()); + contrastive_loss_param_ = const_cast< ::caffe::ContrastiveLossParameter*>( + ::caffe::ContrastiveLossParameter::internal_default_instance()); + convolution_param_ = const_cast< ::caffe::ConvolutionParameter*>( + ::caffe::ConvolutionParameter::internal_default_instance()); + data_param_ = const_cast< ::caffe::DataParameter*>( + ::caffe::DataParameter::internal_default_instance()); + dropout_param_ = const_cast< ::caffe::DropoutParameter*>( + ::caffe::DropoutParameter::internal_default_instance()); + dummy_data_param_ = const_cast< ::caffe::DummyDataParameter*>( + ::caffe::DummyDataParameter::internal_default_instance()); + eltwise_param_ = const_cast< ::caffe::EltwiseParameter*>( + ::caffe::EltwiseParameter::internal_default_instance()); + exp_param_ = const_cast< ::caffe::ExpParameter*>( + ::caffe::ExpParameter::internal_default_instance()); + hdf5_data_param_ = const_cast< ::caffe::HDF5DataParameter*>( + ::caffe::HDF5DataParameter::internal_default_instance()); + hdf5_output_param_ = const_cast< ::caffe::HDF5OutputParameter*>( + ::caffe::HDF5OutputParameter::internal_default_instance()); + hinge_loss_param_ = const_cast< ::caffe::HingeLossParameter*>( + ::caffe::HingeLossParameter::internal_default_instance()); + image_data_param_ = const_cast< ::caffe::ImageDataParameter*>( + ::caffe::ImageDataParameter::internal_default_instance()); + infogain_loss_param_ = const_cast< ::caffe::InfogainLossParameter*>( + ::caffe::InfogainLossParameter::internal_default_instance()); + inner_product_param_ = const_cast< ::caffe::InnerProductParameter*>( + ::caffe::InnerProductParameter::internal_default_instance()); + lrn_param_ = const_cast< ::caffe::LRNParameter*>( + ::caffe::LRNParameter::internal_default_instance()); + memory_data_param_ = const_cast< ::caffe::MemoryDataParameter*>( + ::caffe::MemoryDataParameter::internal_default_instance()); + mvn_param_ = const_cast< ::caffe::MVNParameter*>( + ::caffe::MVNParameter::internal_default_instance()); + pooling_param_ = const_cast< ::caffe::PoolingParameter*>( + ::caffe::PoolingParameter::internal_default_instance()); + power_param_ = const_cast< ::caffe::PowerParameter*>( + ::caffe::PowerParameter::internal_default_instance()); + relu_param_ = const_cast< ::caffe::ReLUParameter*>( + ::caffe::ReLUParameter::internal_default_instance()); + sigmoid_param_ = const_cast< ::caffe::SigmoidParameter*>( + ::caffe::SigmoidParameter::internal_default_instance()); + softmax_param_ = const_cast< ::caffe::SoftmaxParameter*>( + ::caffe::SoftmaxParameter::internal_default_instance()); + slice_param_ = const_cast< ::caffe::SliceParameter*>( + ::caffe::SliceParameter::internal_default_instance()); + tanh_param_ = const_cast< ::caffe::TanHParameter*>( + ::caffe::TanHParameter::internal_default_instance()); + threshold_param_ = const_cast< ::caffe::ThresholdParameter*>( + ::caffe::ThresholdParameter::internal_default_instance()); + window_data_param_ = const_cast< ::caffe::WindowDataParameter*>( + ::caffe::WindowDataParameter::internal_default_instance()); + transform_param_ = const_cast< ::caffe::TransformationParameter*>( + ::caffe::TransformationParameter::internal_default_instance()); + loss_param_ = const_cast< ::caffe::LossParameter*>( + ::caffe::LossParameter::internal_default_instance()); + layer_ = const_cast< ::caffe::V0LayerParameter*>( + ::caffe::V0LayerParameter::internal_default_instance()); +} + +V1LayerParameter::V1LayerParameter(const V1LayerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.V1LayerParameter) +} + +void V1LayerParameter::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + accuracy_param_ = NULL; + argmax_param_ = NULL; + concat_param_ = NULL; + contrastive_loss_param_ = NULL; + convolution_param_ = NULL; + data_param_ = NULL; + dropout_param_ = NULL; + dummy_data_param_ = NULL; + eltwise_param_ = NULL; + exp_param_ = NULL; + hdf5_data_param_ = NULL; + hdf5_output_param_ = NULL; + hinge_loss_param_ = NULL; + image_data_param_ = NULL; + infogain_loss_param_ = NULL; + inner_product_param_ = NULL; + lrn_param_ = NULL; + memory_data_param_ = NULL; + mvn_param_ = NULL; + pooling_param_ = NULL; + power_param_ = NULL; + relu_param_ = NULL; + sigmoid_param_ = NULL; + softmax_param_ = NULL; + slice_param_ = NULL; + tanh_param_ = NULL; + threshold_param_ = NULL; + window_data_param_ = NULL; + transform_param_ = NULL; + loss_param_ = NULL; + layer_ = NULL; + type_ = 0; + _cached_size_ = 0; +} + +V1LayerParameter::~V1LayerParameter() { + // @@protoc_insertion_point(destructor:caffe.V1LayerParameter) + SharedDtor(); +} + +void V1LayerParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != &V1LayerParameter_default_instance_.get()) { + delete accuracy_param_; + delete argmax_param_; + delete concat_param_; + delete contrastive_loss_param_; + delete convolution_param_; + delete data_param_; + delete dropout_param_; + delete dummy_data_param_; + delete eltwise_param_; + delete exp_param_; + delete hdf5_data_param_; + delete hdf5_output_param_; + delete hinge_loss_param_; + delete image_data_param_; + delete infogain_loss_param_; + delete inner_product_param_; + delete lrn_param_; + delete memory_data_param_; + delete mvn_param_; + delete pooling_param_; + delete power_param_; + delete relu_param_; + delete sigmoid_param_; + delete softmax_param_; + delete slice_param_; + delete tanh_param_; + delete threshold_param_; + delete window_data_param_; + delete transform_param_; + delete loss_param_; + delete layer_; + } +} + +void V1LayerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* V1LayerParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return V1LayerParameter_descriptor_; +} + +const V1LayerParameter& V1LayerParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed V1LayerParameter_default_instance_; + +V1LayerParameter* V1LayerParameter::New(::google::protobuf::Arena* arena) const { + V1LayerParameter* n = new V1LayerParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void V1LayerParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.V1LayerParameter) + if (_has_bits_[0 / 32] & 36u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + type_ = 0; + } + if (_has_bits_[8 / 32] & 61440u) { + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::caffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::caffe::ArgMaxParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::caffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::caffe::ContrastiveLossParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680u) { + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::caffe::ConvolutionParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::caffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::caffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::caffe::DummyDataParameter::Clear(); + } + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::caffe::EltwiseParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::caffe::ExpParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::caffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080u) { + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::caffe::HingeLossParameter::Clear(); + } + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::caffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::caffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::caffe::InnerProductParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::caffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::caffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::caffe::MVNParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::caffe::PoolingParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255u) { + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 1792u) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::caffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::caffe::LossParameter::Clear(); + } + if (has_layer()) { + if (layer_ != NULL) layer_->::caffe::V0LayerParameter::Clear(); + } + } + bottom_.Clear(); + top_.Clear(); + include_.Clear(); + exclude_.Clear(); + blobs_.Clear(); + param_.Clear(); + blob_share_mode_.Clear(); + blobs_lr_.Clear(); + weight_decay_.Clear(); + loss_weight_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool V1LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.V1LayerParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.V0LayerParameter layer = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_layer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_bottom; + break; + } + + // repeated string bottom = 2; + case 2: { + if (tag == 18) { + parse_bottom: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_bottom())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->bottom(this->bottom_size() - 1).data(), + this->bottom(this->bottom_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V1LayerParameter.bottom"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_bottom; + if (input->ExpectTag(26)) goto parse_top; + break; + } + + // repeated string top = 3; + case 3: { + if (tag == 26) { + parse_top: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_top())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->top(this->top_size() - 1).data(), + this->top(this->top_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V1LayerParameter.top"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_top; + if (input->ExpectTag(34)) goto parse_name; + break; + } + + // optional string name = 4; + case 4: { + if (tag == 34) { + parse_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V1LayerParameter.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_type; + break; + } + + // optional .caffe.V1LayerParameter.LayerType type = 5; + case 5: { + if (tag == 40) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::V1LayerParameter_LayerType_IsValid(value)) { + set_type(static_cast< ::caffe::V1LayerParameter_LayerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + break; + } + + // repeated .caffe.BlobProto blobs = 6; + case 6: { + if (tag == 50) { + parse_blobs: + DO_(input->IncrementRecursionDepth()); + parse_loop_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_loop_blobs; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(61)) goto parse_blobs_lr; + break; + } + + // repeated float blobs_lr = 7; + case 7: { + if (tag == 61) { + parse_blobs_lr: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 61, input, this->mutable_blobs_lr()))); + } else if (tag == 58) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_blobs_lr()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(61)) goto parse_blobs_lr; + if (input->ExpectTag(69)) goto parse_weight_decay; + break; + } + + // repeated float weight_decay = 8; + case 8: { + if (tag == 69) { + parse_weight_decay: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 69, input, this->mutable_weight_decay()))); + } else if (tag == 66) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_weight_decay()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(69)) goto parse_weight_decay; + if (input->ExpectTag(74)) goto parse_concat_param; + break; + } + + // optional .caffe.ConcatParameter concat_param = 9; + case 9: { + if (tag == 74) { + parse_concat_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_concat_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_convolution_param; + break; + } + + // optional .caffe.ConvolutionParameter convolution_param = 10; + case 10: { + if (tag == 82) { + parse_convolution_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_convolution_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_data_param; + break; + } + + // optional .caffe.DataParameter data_param = 11; + case 11: { + if (tag == 90) { + parse_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(98)) goto parse_dropout_param; + break; + } + + // optional .caffe.DropoutParameter dropout_param = 12; + case 12: { + if (tag == 98) { + parse_dropout_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dropout_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(106)) goto parse_hdf5_data_param; + break; + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 13; + case 13: { + if (tag == 106) { + parse_hdf5_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hdf5_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(114)) goto parse_hdf5_output_param; + break; + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 14; + case 14: { + if (tag == 114) { + parse_hdf5_output_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hdf5_output_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(122)) goto parse_image_data_param; + break; + } + + // optional .caffe.ImageDataParameter image_data_param = 15; + case 15: { + if (tag == 122) { + parse_image_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(130)) goto parse_infogain_loss_param; + break; + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 16; + case 16: { + if (tag == 130) { + parse_infogain_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_infogain_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(138)) goto parse_inner_product_param; + break; + } + + // optional .caffe.InnerProductParameter inner_product_param = 17; + case 17: { + if (tag == 138) { + parse_inner_product_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_inner_product_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(146)) goto parse_lrn_param; + break; + } + + // optional .caffe.LRNParameter lrn_param = 18; + case 18: { + if (tag == 146) { + parse_lrn_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_lrn_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(154)) goto parse_pooling_param; + break; + } + + // optional .caffe.PoolingParameter pooling_param = 19; + case 19: { + if (tag == 154) { + parse_pooling_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_pooling_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(162)) goto parse_window_data_param; + break; + } + + // optional .caffe.WindowDataParameter window_data_param = 20; + case 20: { + if (tag == 162) { + parse_window_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_window_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(170)) goto parse_power_param; + break; + } + + // optional .caffe.PowerParameter power_param = 21; + case 21: { + if (tag == 170) { + parse_power_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_power_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_memory_data_param; + break; + } + + // optional .caffe.MemoryDataParameter memory_data_param = 22; + case 22: { + if (tag == 178) { + parse_memory_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_memory_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(186)) goto parse_argmax_param; + break; + } + + // optional .caffe.ArgMaxParameter argmax_param = 23; + case 23: { + if (tag == 186) { + parse_argmax_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_argmax_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(194)) goto parse_eltwise_param; + break; + } + + // optional .caffe.EltwiseParameter eltwise_param = 24; + case 24: { + if (tag == 194) { + parse_eltwise_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_eltwise_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(202)) goto parse_threshold_param; + break; + } + + // optional .caffe.ThresholdParameter threshold_param = 25; + case 25: { + if (tag == 202) { + parse_threshold_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_threshold_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(210)) goto parse_dummy_data_param; + break; + } + + // optional .caffe.DummyDataParameter dummy_data_param = 26; + case 26: { + if (tag == 210) { + parse_dummy_data_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dummy_data_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(218)) goto parse_accuracy_param; + break; + } + + // optional .caffe.AccuracyParameter accuracy_param = 27; + case 27: { + if (tag == 218) { + parse_accuracy_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_accuracy_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(234)) goto parse_hinge_loss_param; + break; + } + + // optional .caffe.HingeLossParameter hinge_loss_param = 29; + case 29: { + if (tag == 234) { + parse_hinge_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hinge_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(242)) goto parse_relu_param; + break; + } + + // optional .caffe.ReLUParameter relu_param = 30; + case 30: { + if (tag == 242) { + parse_relu_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_relu_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(250)) goto parse_slice_param; + break; + } + + // optional .caffe.SliceParameter slice_param = 31; + case 31: { + if (tag == 250) { + parse_slice_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_slice_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(258)) goto parse_include; + break; + } + + // repeated .caffe.NetStateRule include = 32; + case 32: { + if (tag == 258) { + parse_include: + DO_(input->IncrementRecursionDepth()); + parse_loop_include: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_include())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(258)) goto parse_loop_include; + if (input->ExpectTag(266)) goto parse_loop_exclude; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .caffe.NetStateRule exclude = 33; + case 33: { + if (tag == 266) { + DO_(input->IncrementRecursionDepth()); + parse_loop_exclude: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_exclude())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(266)) goto parse_loop_exclude; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(274)) goto parse_mvn_param; + break; + } + + // optional .caffe.MVNParameter mvn_param = 34; + case 34: { + if (tag == 274) { + parse_mvn_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_mvn_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(285)) goto parse_loss_weight; + break; + } + + // repeated float loss_weight = 35; + case 35: { + if (tag == 285) { + parse_loss_weight: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 2, 285, input, this->mutable_loss_weight()))); + } else if (tag == 282) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_loss_weight()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(285)) goto parse_loss_weight; + if (input->ExpectTag(290)) goto parse_transform_param; + break; + } + + // optional .caffe.TransformationParameter transform_param = 36; + case 36: { + if (tag == 290) { + parse_transform_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_transform_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(298)) goto parse_tanh_param; + break; + } + + // optional .caffe.TanHParameter tanh_param = 37; + case 37: { + if (tag == 298) { + parse_tanh_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tanh_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(306)) goto parse_sigmoid_param; + break; + } + + // optional .caffe.SigmoidParameter sigmoid_param = 38; + case 38: { + if (tag == 306) { + parse_sigmoid_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_sigmoid_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(314)) goto parse_softmax_param; + break; + } + + // optional .caffe.SoftmaxParameter softmax_param = 39; + case 39: { + if (tag == 314) { + parse_softmax_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_softmax_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(322)) goto parse_contrastive_loss_param; + break; + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; + case 40: { + if (tag == 322) { + parse_contrastive_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_contrastive_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(330)) goto parse_exp_param; + break; + } + + // optional .caffe.ExpParameter exp_param = 41; + case 41: { + if (tag == 330) { + parse_exp_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_exp_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(338)) goto parse_loss_param; + break; + } + + // optional .caffe.LossParameter loss_param = 42; + case 42: { + if (tag == 338) { + parse_loss_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_loss_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_param; + break; + } + + // repeated string param = 1001; + case 1001: { + if (tag == 8010) { + parse_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_param())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->param(this->param_size() - 1).data(), + this->param(this->param_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V1LayerParameter.param"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_param; + if (input->ExpectTag(8016)) goto parse_blob_share_mode; + break; + } + + // repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + case 1002: { + if (tag == 8016) { + parse_blob_share_mode: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::V1LayerParameter_DimCheckMode_IsValid(value)) { + add_blob_share_mode(static_cast< ::caffe::V1LayerParameter_DimCheckMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(1002, value); + } + } else if (tag == 8018) { + DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns( + input, + 1002, + ::caffe::V1LayerParameter_DimCheckMode_IsValid, + mutable_unknown_fields(), + this->mutable_blob_share_mode()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8016)) goto parse_blob_share_mode; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.V1LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.V1LayerParameter) + return false; +#undef DO_ +} + +void V1LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.V1LayerParameter) + // optional .caffe.V0LayerParameter layer = 1; + if (has_layer()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *this->layer_, output); + } + + // repeated string bottom = 2; + for (int i = 0; i < this->bottom_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->bottom(i).data(), this->bottom(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.bottom"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->bottom(i), output); + } + + // repeated string top = 3; + for (int i = 0; i < this->top_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->top(i).data(), this->top(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.top"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->top(i), output); + } + + // optional string name = 4; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->name(), output); + } + + // optional .caffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // repeated .caffe.BlobProto blobs = 6; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->blobs(i), output); + } + + // repeated float blobs_lr = 7; + for (int i = 0; i < this->blobs_lr_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 7, this->blobs_lr(i), output); + } + + // repeated float weight_decay = 8; + for (int i = 0; i < this->weight_decay_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 8, this->weight_decay(i), output); + } + + // optional .caffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *this->concat_param_, output); + } + + // optional .caffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *this->convolution_param_, output); + } + + // optional .caffe.DataParameter data_param = 11; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, *this->data_param_, output); + } + + // optional .caffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, *this->dropout_param_, output); + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, *this->hdf5_data_param_, output); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 14, *this->hdf5_output_param_, output); + } + + // optional .caffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 15, *this->image_data_param_, output); + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 16, *this->infogain_loss_param_, output); + } + + // optional .caffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 17, *this->inner_product_param_, output); + } + + // optional .caffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 18, *this->lrn_param_, output); + } + + // optional .caffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 19, *this->pooling_param_, output); + } + + // optional .caffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 20, *this->window_data_param_, output); + } + + // optional .caffe.PowerParameter power_param = 21; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, *this->power_param_, output); + } + + // optional .caffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 22, *this->memory_data_param_, output); + } + + // optional .caffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 23, *this->argmax_param_, output); + } + + // optional .caffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 24, *this->eltwise_param_, output); + } + + // optional .caffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 25, *this->threshold_param_, output); + } + + // optional .caffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 26, *this->dummy_data_param_, output); + } + + // optional .caffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 27, *this->accuracy_param_, output); + } + + // optional .caffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 29, *this->hinge_loss_param_, output); + } + + // optional .caffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 30, *this->relu_param_, output); + } + + // optional .caffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 31, *this->slice_param_, output); + } + + // repeated .caffe.NetStateRule include = 32; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 32, this->include(i), output); + } + + // repeated .caffe.NetStateRule exclude = 33; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 33, this->exclude(i), output); + } + + // optional .caffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 34, *this->mvn_param_, output); + } + + // repeated float loss_weight = 35; + for (int i = 0; i < this->loss_weight_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 35, this->loss_weight(i), output); + } + + // optional .caffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 36, *this->transform_param_, output); + } + + // optional .caffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 37, *this->tanh_param_, output); + } + + // optional .caffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 38, *this->sigmoid_param_, output); + } + + // optional .caffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 39, *this->softmax_param_, output); + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 40, *this->contrastive_loss_param_, output); + } + + // optional .caffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 41, *this->exp_param_, output); + } + + // optional .caffe.LossParameter loss_param = 42; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 42, *this->loss_param_, output); + } + + // repeated string param = 1001; + for (int i = 0; i < this->param_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->param(i).data(), this->param(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.param"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1001, this->param(i), output); + } + + // repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + for (int i = 0; i < this->blob_share_mode_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1002, this->blob_share_mode(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.V1LayerParameter) +} + +::google::protobuf::uint8* V1LayerParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.V1LayerParameter) + // optional .caffe.V0LayerParameter layer = 1; + if (has_layer()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *this->layer_, false, target); + } + + // repeated string bottom = 2; + for (int i = 0; i < this->bottom_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->bottom(i).data(), this->bottom(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.bottom"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(2, this->bottom(i), target); + } + + // repeated string top = 3; + for (int i = 0; i < this->top_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->top(i).data(), this->top(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.top"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->top(i), target); + } + + // optional string name = 4; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->name(), target); + } + + // optional .caffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->type(), target); + } + + // repeated .caffe.BlobProto blobs = 6; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, this->blobs(i), false, target); + } + + // repeated float blobs_lr = 7; + for (int i = 0; i < this->blobs_lr_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(7, this->blobs_lr(i), target); + } + + // repeated float weight_decay = 8; + for (int i = 0; i < this->weight_decay_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(8, this->weight_decay(i), target); + } + + // optional .caffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 9, *this->concat_param_, false, target); + } + + // optional .caffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 10, *this->convolution_param_, false, target); + } + + // optional .caffe.DataParameter data_param = 11; + if (has_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 11, *this->data_param_, false, target); + } + + // optional .caffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 12, *this->dropout_param_, false, target); + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 13, *this->hdf5_data_param_, false, target); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 14, *this->hdf5_output_param_, false, target); + } + + // optional .caffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 15, *this->image_data_param_, false, target); + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 16, *this->infogain_loss_param_, false, target); + } + + // optional .caffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 17, *this->inner_product_param_, false, target); + } + + // optional .caffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 18, *this->lrn_param_, false, target); + } + + // optional .caffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 19, *this->pooling_param_, false, target); + } + + // optional .caffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 20, *this->window_data_param_, false, target); + } + + // optional .caffe.PowerParameter power_param = 21; + if (has_power_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 21, *this->power_param_, false, target); + } + + // optional .caffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 22, *this->memory_data_param_, false, target); + } + + // optional .caffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 23, *this->argmax_param_, false, target); + } + + // optional .caffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 24, *this->eltwise_param_, false, target); + } + + // optional .caffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 25, *this->threshold_param_, false, target); + } + + // optional .caffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 26, *this->dummy_data_param_, false, target); + } + + // optional .caffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 27, *this->accuracy_param_, false, target); + } + + // optional .caffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 29, *this->hinge_loss_param_, false, target); + } + + // optional .caffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 30, *this->relu_param_, false, target); + } + + // optional .caffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 31, *this->slice_param_, false, target); + } + + // repeated .caffe.NetStateRule include = 32; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 32, this->include(i), false, target); + } + + // repeated .caffe.NetStateRule exclude = 33; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 33, this->exclude(i), false, target); + } + + // optional .caffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 34, *this->mvn_param_, false, target); + } + + // repeated float loss_weight = 35; + for (int i = 0; i < this->loss_weight_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(35, this->loss_weight(i), target); + } + + // optional .caffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 36, *this->transform_param_, false, target); + } + + // optional .caffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 37, *this->tanh_param_, false, target); + } + + // optional .caffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 38, *this->sigmoid_param_, false, target); + } + + // optional .caffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 39, *this->softmax_param_, false, target); + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 40, *this->contrastive_loss_param_, false, target); + } + + // optional .caffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 41, *this->exp_param_, false, target); + } + + // optional .caffe.LossParameter loss_param = 42; + if (has_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 42, *this->loss_param_, false, target); + } + + // repeated string param = 1001; + for (int i = 0; i < this->param_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->param(i).data(), this->param(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V1LayerParameter.param"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1001, this->param(i), target); + } + + // repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + for (int i = 0; i < this->blob_share_mode_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1002, this->blob_share_mode(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.V1LayerParameter) + return target; +} + +size_t V1LayerParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.V1LayerParameter) + size_t total_size = 0; + + if (_has_bits_[2 / 32] & 36u) { + // optional string name = 4; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .caffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + } + if (_has_bits_[12 / 32] & 61440u) { + // optional .caffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->accuracy_param_); + } + + // optional .caffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->argmax_param_); + } + + // optional .caffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->concat_param_); + } + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->contrastive_loss_param_); + } + + } + if (_has_bits_[16 / 32] & 16711680u) { + // optional .caffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->convolution_param_); + } + + // optional .caffe.DataParameter data_param = 11; + if (has_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->data_param_); + } + + // optional .caffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dropout_param_); + } + + // optional .caffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dummy_data_param_); + } + + // optional .caffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->eltwise_param_); + } + + // optional .caffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->exp_param_); + } + + // optional .caffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_data_param_); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + } + if (_has_bits_[24 / 32] & 4278190080u) { + // optional .caffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hinge_loss_param_); + } + + // optional .caffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->image_data_param_); + } + + // optional .caffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->infogain_loss_param_); + } + + // optional .caffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->inner_product_param_); + } + + // optional .caffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lrn_param_); + } + + // optional .caffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->memory_data_param_); + } + + // optional .caffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->mvn_param_); + } + + // optional .caffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->pooling_param_); + } + + } + if (_has_bits_[32 / 32] & 255u) { + // optional .caffe.PowerParameter power_param = 21; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->power_param_); + } + + // optional .caffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->relu_param_); + } + + // optional .caffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->sigmoid_param_); + } + + // optional .caffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->softmax_param_); + } + + // optional .caffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->slice_param_); + } + + // optional .caffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tanh_param_); + } + + // optional .caffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->threshold_param_); + } + + // optional .caffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->window_data_param_); + } + + } + if (_has_bits_[40 / 32] & 1792u) { + // optional .caffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->transform_param_); + } + + // optional .caffe.LossParameter loss_param = 42; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->loss_param_); + } + + // optional .caffe.V0LayerParameter layer = 1; + if (has_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->layer_); + } + + } + // repeated string bottom = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->bottom_size()); + for (int i = 0; i < this->bottom_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->bottom(i)); + } + + // repeated string top = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->top_size()); + for (int i = 0; i < this->top_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->top(i)); + } + + // repeated .caffe.NetStateRule include = 32; + { + unsigned int count = this->include_size(); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + } + + // repeated .caffe.NetStateRule exclude = 33; + { + unsigned int count = this->exclude_size(); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + } + + // repeated .caffe.BlobProto blobs = 6; + { + unsigned int count = this->blobs_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + } + + // repeated string param = 1001; + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->param_size()); + for (int i = 0; i < this->param_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->param(i)); + } + + // repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + { + size_t data_size = 0; + unsigned int count = this->blob_share_mode_size();for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->blob_share_mode(i)); + } + total_size += (2UL * count) + data_size; + } + + // repeated float blobs_lr = 7; + { + size_t data_size = 0; + unsigned int count = this->blobs_lr_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->blobs_lr_size()); + total_size += data_size; + } + + // repeated float weight_decay = 8; + { + size_t data_size = 0; + unsigned int count = this->weight_decay_size(); + data_size = 4UL * count; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->weight_decay_size()); + total_size += data_size; + } + + // repeated float loss_weight = 35; + { + size_t data_size = 0; + unsigned int count = this->loss_weight_size(); + data_size = 4UL * count; + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->loss_weight_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V1LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.V1LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const V1LayerParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.V1LayerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.V1LayerParameter) + UnsafeMergeFrom(*source); + } +} + +void V1LayerParameter::MergeFrom(const V1LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.V1LayerParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void V1LayerParameter::UnsafeMergeFrom(const V1LayerParameter& from) { + GOOGLE_DCHECK(&from != this); + bottom_.UnsafeMergeFrom(from.bottom_); + top_.UnsafeMergeFrom(from.top_); + include_.MergeFrom(from.include_); + exclude_.MergeFrom(from.exclude_); + blobs_.MergeFrom(from.blobs_); + param_.UnsafeMergeFrom(from.param_); + blob_share_mode_.UnsafeMergeFrom(from.blob_share_mode_); + blobs_lr_.UnsafeMergeFrom(from.blobs_lr_); + weight_decay_.UnsafeMergeFrom(from.weight_decay_); + loss_weight_.UnsafeMergeFrom(from.loss_weight_); + if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_type()) { + set_type(from.type()); + } + } + if (from._has_bits_[12 / 32] & (0xffu << (12 % 32))) { + if (from.has_accuracy_param()) { + mutable_accuracy_param()->::caffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::caffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::caffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::caffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_convolution_param()) { + mutable_convolution_param()->::caffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::caffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::caffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::caffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::caffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::caffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::caffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::caffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_hinge_loss_param()) { + mutable_hinge_loss_param()->::caffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + if (from.has_image_data_param()) { + mutable_image_data_param()->::caffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::caffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::caffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::caffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::caffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::caffe::MVNParameter::MergeFrom(from.mvn_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::caffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_power_param()) { + mutable_power_param()->::caffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::caffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::caffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::caffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::caffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::caffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::caffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_window_data_param()) { + mutable_window_data_param()->::caffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_transform_param()) { + mutable_transform_param()->::caffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::caffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_layer()) { + mutable_layer()->::caffe::V0LayerParameter::MergeFrom(from.layer()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void V1LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.V1LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void V1LayerParameter::CopyFrom(const V1LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.V1LayerParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool V1LayerParameter::IsInitialized() const { + + return true; +} + +void V1LayerParameter::Swap(V1LayerParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void V1LayerParameter::InternalSwap(V1LayerParameter* other) { + bottom_.UnsafeArenaSwap(&other->bottom_); + top_.UnsafeArenaSwap(&other->top_); + name_.Swap(&other->name_); + include_.UnsafeArenaSwap(&other->include_); + exclude_.UnsafeArenaSwap(&other->exclude_); + std::swap(type_, other->type_); + blobs_.UnsafeArenaSwap(&other->blobs_); + param_.UnsafeArenaSwap(&other->param_); + blob_share_mode_.UnsafeArenaSwap(&other->blob_share_mode_); + blobs_lr_.UnsafeArenaSwap(&other->blobs_lr_); + weight_decay_.UnsafeArenaSwap(&other->weight_decay_); + loss_weight_.UnsafeArenaSwap(&other->loss_weight_); + std::swap(accuracy_param_, other->accuracy_param_); + std::swap(argmax_param_, other->argmax_param_); + std::swap(concat_param_, other->concat_param_); + std::swap(contrastive_loss_param_, other->contrastive_loss_param_); + std::swap(convolution_param_, other->convolution_param_); + std::swap(data_param_, other->data_param_); + std::swap(dropout_param_, other->dropout_param_); + std::swap(dummy_data_param_, other->dummy_data_param_); + std::swap(eltwise_param_, other->eltwise_param_); + std::swap(exp_param_, other->exp_param_); + std::swap(hdf5_data_param_, other->hdf5_data_param_); + std::swap(hdf5_output_param_, other->hdf5_output_param_); + std::swap(hinge_loss_param_, other->hinge_loss_param_); + std::swap(image_data_param_, other->image_data_param_); + std::swap(infogain_loss_param_, other->infogain_loss_param_); + std::swap(inner_product_param_, other->inner_product_param_); + std::swap(lrn_param_, other->lrn_param_); + std::swap(memory_data_param_, other->memory_data_param_); + std::swap(mvn_param_, other->mvn_param_); + std::swap(pooling_param_, other->pooling_param_); + std::swap(power_param_, other->power_param_); + std::swap(relu_param_, other->relu_param_); + std::swap(sigmoid_param_, other->sigmoid_param_); + std::swap(softmax_param_, other->softmax_param_); + std::swap(slice_param_, other->slice_param_); + std::swap(tanh_param_, other->tanh_param_); + std::swap(threshold_param_, other->threshold_param_); + std::swap(window_data_param_, other->window_data_param_); + std::swap(transform_param_, other->transform_param_); + std::swap(loss_param_, other->loss_param_); + std::swap(layer_, other->layer_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_has_bits_[1], other->_has_bits_[1]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata V1LayerParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = V1LayerParameter_descriptor_; + metadata.reflection = V1LayerParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// V1LayerParameter + +// repeated string bottom = 2; +int V1LayerParameter::bottom_size() const { + return bottom_.size(); +} +void V1LayerParameter::clear_bottom() { + bottom_.Clear(); +} +const ::std::string& V1LayerParameter::bottom(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} +::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} +void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.bottom) + bottom_.Mutable(index)->assign(value); +} +void V1LayerParameter::set_bottom(int index, const char* value) { + bottom_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.bottom) +} +void V1LayerParameter::set_bottom(int index, const char* value, size_t size) { + bottom_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.bottom) +} +::std::string* V1LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:caffe.V1LayerParameter.bottom) + return bottom_.Add(); +} +void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.bottom) +} +void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.V1LayerParameter.bottom) +} +void V1LayerParameter::add_bottom(const char* value, size_t size) { + bottom_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.V1LayerParameter.bottom) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.bottom) + return bottom_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.bottom) + return &bottom_; +} + +// repeated string top = 3; +int V1LayerParameter::top_size() const { + return top_.size(); +} +void V1LayerParameter::clear_top() { + top_.Clear(); +} +const ::std::string& V1LayerParameter::top(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.top) + return top_.Get(index); +} +::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.top) + return top_.Mutable(index); +} +void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.top) + top_.Mutable(index)->assign(value); +} +void V1LayerParameter::set_top(int index, const char* value) { + top_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.top) +} +void V1LayerParameter::set_top(int index, const char* value, size_t size) { + top_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.top) +} +::std::string* V1LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:caffe.V1LayerParameter.top) + return top_.Add(); +} +void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.top) +} +void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.V1LayerParameter.top) +} +void V1LayerParameter::add_top(const char* value, size_t size) { + top_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.V1LayerParameter.top) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.top) + return top_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.top) + return &top_; +} + +// optional string name = 4; +bool V1LayerParameter::has_name() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void V1LayerParameter::set_has_name() { + _has_bits_[0] |= 0x00000004u; +} +void V1LayerParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000004u; +} +void V1LayerParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +const ::std::string& V1LayerParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V1LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.name) +} +void V1LayerParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.name) +} +void V1LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.name) +} +::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* V1LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V1LayerParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.name) +} + +// repeated .caffe.NetStateRule include = 32; +int V1LayerParameter::include_size() const { + return include_.size(); +} +void V1LayerParameter::clear_include() { + include_.Clear(); +} +const ::caffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.include) + return include_.Get(index); +} +::caffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.include) + return include_.Mutable(index); +} +::caffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.include) + return include_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.include) + return &include_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.include) + return include_; +} + +// repeated .caffe.NetStateRule exclude = 33; +int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +const ::caffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +::caffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +::caffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.exclude) + return &exclude_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.exclude) + return exclude_; +} + +// optional .caffe.V1LayerParameter.LayerType type = 5; +bool V1LayerParameter::has_type() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void V1LayerParameter::set_has_type() { + _has_bits_[0] |= 0x00000020u; +} +void V1LayerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000020u; +} +void V1LayerParameter::clear_type() { + type_ = 0; + clear_has_type(); +} +::caffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.type) + return static_cast< ::caffe::V1LayerParameter_LayerType >(type_); +} +void V1LayerParameter::set_type(::caffe::V1LayerParameter_LayerType value) { + assert(::caffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.type) +} + +// repeated .caffe.BlobProto blobs = 6; +int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::caffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +::caffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +::caffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.blobs) + return blobs_; +} + +// repeated string param = 1001; +int V1LayerParameter::param_size() const { + return param_.size(); +} +void V1LayerParameter::clear_param() { + param_.Clear(); +} +const ::std::string& V1LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.param) + return param_.Get(index); +} +::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.param) + return param_.Mutable(index); +} +void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.param) + param_.Mutable(index)->assign(value); +} +void V1LayerParameter::set_param(int index, const char* value) { + param_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.param) +} +void V1LayerParameter::set_param(int index, const char* value, size_t size) { + param_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.param) +} +::std::string* V1LayerParameter::add_param() { + // @@protoc_insertion_point(field_add_mutable:caffe.V1LayerParameter.param) + return param_.Add(); +} +void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.param) +} +void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.V1LayerParameter.param) +} +void V1LayerParameter::add_param(const char* value, size_t size) { + param_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.V1LayerParameter.param) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.param) + return param_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; +int V1LayerParameter::blob_share_mode_size() const { + return blob_share_mode_.size(); +} +void V1LayerParameter::clear_blob_share_mode() { + blob_share_mode_.Clear(); +} +::caffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.blob_share_mode) + return static_cast< ::caffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} +void V1LayerParameter::set_blob_share_mode(int index, ::caffe::V1LayerParameter_DimCheckMode value) { + assert(::caffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.blob_share_mode) +} +void V1LayerParameter::add_blob_share_mode(::caffe::V1LayerParameter_DimCheckMode value) { + assert(::caffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.blob_share_mode) +} +const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} +::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.blob_share_mode) + return &blob_share_mode_; +} + +// repeated float blobs_lr = 7; +int V1LayerParameter::blobs_lr_size() const { + return blobs_lr_.size(); +} +void V1LayerParameter::clear_blobs_lr() { + blobs_lr_.Clear(); +} +float V1LayerParameter::blobs_lr(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.blobs_lr) + return blobs_lr_.Get(index); +} +void V1LayerParameter::set_blobs_lr(int index, float value) { + blobs_lr_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.blobs_lr) +} +void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.blobs_lr) +} +const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} +::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.blobs_lr) + return &blobs_lr_; +} + +// repeated float weight_decay = 8; +int V1LayerParameter::weight_decay_size() const { + return weight_decay_.size(); +} +void V1LayerParameter::clear_weight_decay() { + weight_decay_.Clear(); +} +float V1LayerParameter::weight_decay(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.weight_decay) + return weight_decay_.Get(index); +} +void V1LayerParameter::set_weight_decay(int index, float value) { + weight_decay_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.weight_decay) +} +void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.weight_decay) +} +const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.weight_decay) + return weight_decay_; +} +::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.weight_decay) + return &weight_decay_; +} + +// repeated float loss_weight = 35; +int V1LayerParameter::loss_weight_size() const { + return loss_weight_.size(); +} +void V1LayerParameter::clear_loss_weight() { + loss_weight_.Clear(); +} +float V1LayerParameter::loss_weight(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.loss_weight) + return loss_weight_.Get(index); +} +void V1LayerParameter::set_loss_weight(int index, float value) { + loss_weight_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.loss_weight) +} +void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.loss_weight) +} +const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.loss_weight) + return loss_weight_; +} +::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .caffe.AccuracyParameter accuracy_param = 27; +bool V1LayerParameter::has_accuracy_param() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void V1LayerParameter::set_has_accuracy_param() { + _has_bits_[0] |= 0x00001000u; +} +void V1LayerParameter::clear_has_accuracy_param() { + _has_bits_[0] &= ~0x00001000u; +} +void V1LayerParameter::clear_accuracy_param() { + if (accuracy_param_ != NULL) accuracy_param_->::caffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +const ::caffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ + : *::caffe::AccuracyParameter::internal_default_instance(); +} +::caffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::caffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +::caffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::caffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_accuracy_param(::caffe::AccuracyParameter* accuracy_param) { + delete accuracy_param_; + accuracy_param_ = accuracy_param; + if (accuracy_param) { + set_has_accuracy_param(); + } else { + clear_has_accuracy_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.accuracy_param) +} + +// optional .caffe.ArgMaxParameter argmax_param = 23; +bool V1LayerParameter::has_argmax_param() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +void V1LayerParameter::set_has_argmax_param() { + _has_bits_[0] |= 0x00002000u; +} +void V1LayerParameter::clear_has_argmax_param() { + _has_bits_[0] &= ~0x00002000u; +} +void V1LayerParameter::clear_argmax_param() { + if (argmax_param_ != NULL) argmax_param_->::caffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +const ::caffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ + : *::caffe::ArgMaxParameter::internal_default_instance(); +} +::caffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::caffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +::caffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.argmax_param) + clear_has_argmax_param(); + ::caffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_argmax_param(::caffe::ArgMaxParameter* argmax_param) { + delete argmax_param_; + argmax_param_ = argmax_param; + if (argmax_param) { + set_has_argmax_param(); + } else { + clear_has_argmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.argmax_param) +} + +// optional .caffe.ConcatParameter concat_param = 9; +bool V1LayerParameter::has_concat_param() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +void V1LayerParameter::set_has_concat_param() { + _has_bits_[0] |= 0x00004000u; +} +void V1LayerParameter::clear_has_concat_param() { + _has_bits_[0] &= ~0x00004000u; +} +void V1LayerParameter::clear_concat_param() { + if (concat_param_ != NULL) concat_param_->::caffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +const ::caffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ + : *::caffe::ConcatParameter::internal_default_instance(); +} +::caffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::caffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.concat_param) + return concat_param_; +} +::caffe::ConcatParameter* V1LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.concat_param) + clear_has_concat_param(); + ::caffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_concat_param(::caffe::ConcatParameter* concat_param) { + delete concat_param_; + concat_param_ = concat_param; + if (concat_param) { + set_has_concat_param(); + } else { + clear_has_concat_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.concat_param) +} + +// optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; +bool V1LayerParameter::has_contrastive_loss_param() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +void V1LayerParameter::set_has_contrastive_loss_param() { + _has_bits_[0] |= 0x00008000u; +} +void V1LayerParameter::clear_has_contrastive_loss_param() { + _has_bits_[0] &= ~0x00008000u; +} +void V1LayerParameter::clear_contrastive_loss_param() { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::caffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +const ::caffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ + : *::caffe::ContrastiveLossParameter::internal_default_instance(); +} +::caffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::caffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +::caffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::caffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_contrastive_loss_param(::caffe::ContrastiveLossParameter* contrastive_loss_param) { + delete contrastive_loss_param_; + contrastive_loss_param_ = contrastive_loss_param; + if (contrastive_loss_param) { + set_has_contrastive_loss_param(); + } else { + clear_has_contrastive_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .caffe.ConvolutionParameter convolution_param = 10; +bool V1LayerParameter::has_convolution_param() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +void V1LayerParameter::set_has_convolution_param() { + _has_bits_[0] |= 0x00010000u; +} +void V1LayerParameter::clear_has_convolution_param() { + _has_bits_[0] &= ~0x00010000u; +} +void V1LayerParameter::clear_convolution_param() { + if (convolution_param_ != NULL) convolution_param_->::caffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +const ::caffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ + : *::caffe::ConvolutionParameter::internal_default_instance(); +} +::caffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::caffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +::caffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.convolution_param) + clear_has_convolution_param(); + ::caffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_convolution_param(::caffe::ConvolutionParameter* convolution_param) { + delete convolution_param_; + convolution_param_ = convolution_param; + if (convolution_param) { + set_has_convolution_param(); + } else { + clear_has_convolution_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.convolution_param) +} + +// optional .caffe.DataParameter data_param = 11; +bool V1LayerParameter::has_data_param() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +void V1LayerParameter::set_has_data_param() { + _has_bits_[0] |= 0x00020000u; +} +void V1LayerParameter::clear_has_data_param() { + _has_bits_[0] &= ~0x00020000u; +} +void V1LayerParameter::clear_data_param() { + if (data_param_ != NULL) data_param_->::caffe::DataParameter::Clear(); + clear_has_data_param(); +} +const ::caffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ + : *::caffe::DataParameter::internal_default_instance(); +} +::caffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::caffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.data_param) + return data_param_; +} +::caffe::DataParameter* V1LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.data_param) + clear_has_data_param(); + ::caffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_data_param(::caffe::DataParameter* data_param) { + delete data_param_; + data_param_ = data_param; + if (data_param) { + set_has_data_param(); + } else { + clear_has_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.data_param) +} + +// optional .caffe.DropoutParameter dropout_param = 12; +bool V1LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +void V1LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00040000u; +} +void V1LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00040000u; +} +void V1LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::caffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +const ::caffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ + : *::caffe::DropoutParameter::internal_default_instance(); +} +::caffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::caffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +::caffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.dropout_param) + clear_has_dropout_param(); + ::caffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_dropout_param(::caffe::DropoutParameter* dropout_param) { + delete dropout_param_; + dropout_param_ = dropout_param; + if (dropout_param) { + set_has_dropout_param(); + } else { + clear_has_dropout_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.dropout_param) +} + +// optional .caffe.DummyDataParameter dummy_data_param = 26; +bool V1LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +void V1LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00080000u; +} +void V1LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00080000u; +} +void V1LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::caffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +const ::caffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ + : *::caffe::DummyDataParameter::internal_default_instance(); +} +::caffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::caffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +::caffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::caffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_dummy_data_param(::caffe::DummyDataParameter* dummy_data_param) { + delete dummy_data_param_; + dummy_data_param_ = dummy_data_param; + if (dummy_data_param) { + set_has_dummy_data_param(); + } else { + clear_has_dummy_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.dummy_data_param) +} + +// optional .caffe.EltwiseParameter eltwise_param = 24; +bool V1LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +void V1LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x00100000u; +} +void V1LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x00100000u; +} +void V1LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::caffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +const ::caffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ + : *::caffe::EltwiseParameter::internal_default_instance(); +} +::caffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::caffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +::caffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::caffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_eltwise_param(::caffe::EltwiseParameter* eltwise_param) { + delete eltwise_param_; + eltwise_param_ = eltwise_param; + if (eltwise_param) { + set_has_eltwise_param(); + } else { + clear_has_eltwise_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.eltwise_param) +} + +// optional .caffe.ExpParameter exp_param = 41; +bool V1LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +void V1LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x00200000u; +} +void V1LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x00200000u; +} +void V1LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::caffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +const ::caffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ + : *::caffe::ExpParameter::internal_default_instance(); +} +::caffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::caffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.exp_param) + return exp_param_; +} +::caffe::ExpParameter* V1LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.exp_param) + clear_has_exp_param(); + ::caffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_exp_param(::caffe::ExpParameter* exp_param) { + delete exp_param_; + exp_param_ = exp_param; + if (exp_param) { + set_has_exp_param(); + } else { + clear_has_exp_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.exp_param) +} + +// optional .caffe.HDF5DataParameter hdf5_data_param = 13; +bool V1LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +void V1LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x00400000u; +} +void V1LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x00400000u; +} +void V1LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::caffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +const ::caffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ + : *::caffe::HDF5DataParameter::internal_default_instance(); +} +::caffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::caffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +::caffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::caffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hdf5_data_param(::caffe::HDF5DataParameter* hdf5_data_param) { + delete hdf5_data_param_; + hdf5_data_param_ = hdf5_data_param; + if (hdf5_data_param) { + set_has_hdf5_data_param(); + } else { + clear_has_hdf5_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.hdf5_data_param) +} + +// optional .caffe.HDF5OutputParameter hdf5_output_param = 14; +bool V1LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +void V1LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x00800000u; +} +void V1LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x00800000u; +} +void V1LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::caffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ + : *::caffe::HDF5OutputParameter::internal_default_instance(); +} +::caffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::caffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::caffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::caffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param) { + delete hdf5_output_param_; + hdf5_output_param_ = hdf5_output_param; + if (hdf5_output_param) { + set_has_hdf5_output_param(); + } else { + clear_has_hdf5_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.hdf5_output_param) +} + +// optional .caffe.HingeLossParameter hinge_loss_param = 29; +bool V1LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +void V1LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x01000000u; +} +void V1LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x01000000u; +} +void V1LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::caffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +const ::caffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ + : *::caffe::HingeLossParameter::internal_default_instance(); +} +::caffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::caffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +::caffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::caffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hinge_loss_param(::caffe::HingeLossParameter* hinge_loss_param) { + delete hinge_loss_param_; + hinge_loss_param_ = hinge_loss_param; + if (hinge_loss_param) { + set_has_hinge_loss_param(); + } else { + clear_has_hinge_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.hinge_loss_param) +} + +// optional .caffe.ImageDataParameter image_data_param = 15; +bool V1LayerParameter::has_image_data_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +void V1LayerParameter::set_has_image_data_param() { + _has_bits_[0] |= 0x02000000u; +} +void V1LayerParameter::clear_has_image_data_param() { + _has_bits_[0] &= ~0x02000000u; +} +void V1LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::caffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +const ::caffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ + : *::caffe::ImageDataParameter::internal_default_instance(); +} +::caffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::caffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +::caffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.image_data_param) + clear_has_image_data_param(); + ::caffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_image_data_param(::caffe::ImageDataParameter* image_data_param) { + delete image_data_param_; + image_data_param_ = image_data_param; + if (image_data_param) { + set_has_image_data_param(); + } else { + clear_has_image_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.image_data_param) +} + +// optional .caffe.InfogainLossParameter infogain_loss_param = 16; +bool V1LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +void V1LayerParameter::set_has_infogain_loss_param() { + _has_bits_[0] |= 0x04000000u; +} +void V1LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[0] &= ~0x04000000u; +} +void V1LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::caffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +const ::caffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ + : *::caffe::InfogainLossParameter::internal_default_instance(); +} +::caffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::caffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +::caffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::caffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_infogain_loss_param(::caffe::InfogainLossParameter* infogain_loss_param) { + delete infogain_loss_param_; + infogain_loss_param_ = infogain_loss_param; + if (infogain_loss_param) { + set_has_infogain_loss_param(); + } else { + clear_has_infogain_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.infogain_loss_param) +} + +// optional .caffe.InnerProductParameter inner_product_param = 17; +bool V1LayerParameter::has_inner_product_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +void V1LayerParameter::set_has_inner_product_param() { + _has_bits_[0] |= 0x08000000u; +} +void V1LayerParameter::clear_has_inner_product_param() { + _has_bits_[0] &= ~0x08000000u; +} +void V1LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::caffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +const ::caffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ + : *::caffe::InnerProductParameter::internal_default_instance(); +} +::caffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::caffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +::caffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::caffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_inner_product_param(::caffe::InnerProductParameter* inner_product_param) { + delete inner_product_param_; + inner_product_param_ = inner_product_param; + if (inner_product_param) { + set_has_inner_product_param(); + } else { + clear_has_inner_product_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.inner_product_param) +} + +// optional .caffe.LRNParameter lrn_param = 18; +bool V1LayerParameter::has_lrn_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +void V1LayerParameter::set_has_lrn_param() { + _has_bits_[0] |= 0x10000000u; +} +void V1LayerParameter::clear_has_lrn_param() { + _has_bits_[0] &= ~0x10000000u; +} +void V1LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::caffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +const ::caffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ + : *::caffe::LRNParameter::internal_default_instance(); +} +::caffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::caffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +::caffe::LRNParameter* V1LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.lrn_param) + clear_has_lrn_param(); + ::caffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_lrn_param(::caffe::LRNParameter* lrn_param) { + delete lrn_param_; + lrn_param_ = lrn_param; + if (lrn_param) { + set_has_lrn_param(); + } else { + clear_has_lrn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.lrn_param) +} + +// optional .caffe.MemoryDataParameter memory_data_param = 22; +bool V1LayerParameter::has_memory_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +void V1LayerParameter::set_has_memory_data_param() { + _has_bits_[0] |= 0x20000000u; +} +void V1LayerParameter::clear_has_memory_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +void V1LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::caffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +const ::caffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ + : *::caffe::MemoryDataParameter::internal_default_instance(); +} +::caffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::caffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +::caffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::caffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_memory_data_param(::caffe::MemoryDataParameter* memory_data_param) { + delete memory_data_param_; + memory_data_param_ = memory_data_param; + if (memory_data_param) { + set_has_memory_data_param(); + } else { + clear_has_memory_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.memory_data_param) +} + +// optional .caffe.MVNParameter mvn_param = 34; +bool V1LayerParameter::has_mvn_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +void V1LayerParameter::set_has_mvn_param() { + _has_bits_[0] |= 0x40000000u; +} +void V1LayerParameter::clear_has_mvn_param() { + _has_bits_[0] &= ~0x40000000u; +} +void V1LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::caffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +const ::caffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ + : *::caffe::MVNParameter::internal_default_instance(); +} +::caffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::caffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +::caffe::MVNParameter* V1LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.mvn_param) + clear_has_mvn_param(); + ::caffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_mvn_param(::caffe::MVNParameter* mvn_param) { + delete mvn_param_; + mvn_param_ = mvn_param; + if (mvn_param) { + set_has_mvn_param(); + } else { + clear_has_mvn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.mvn_param) +} + +// optional .caffe.PoolingParameter pooling_param = 19; +bool V1LayerParameter::has_pooling_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +void V1LayerParameter::set_has_pooling_param() { + _has_bits_[0] |= 0x80000000u; +} +void V1LayerParameter::clear_has_pooling_param() { + _has_bits_[0] &= ~0x80000000u; +} +void V1LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::caffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +const ::caffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ + : *::caffe::PoolingParameter::internal_default_instance(); +} +::caffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::caffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +::caffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.pooling_param) + clear_has_pooling_param(); + ::caffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_pooling_param(::caffe::PoolingParameter* pooling_param) { + delete pooling_param_; + pooling_param_ = pooling_param; + if (pooling_param) { + set_has_pooling_param(); + } else { + clear_has_pooling_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.pooling_param) +} + +// optional .caffe.PowerParameter power_param = 21; +bool V1LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +void V1LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000001u; +} +void V1LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000001u; +} +void V1LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); + clear_has_power_param(); +} +const ::caffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ + : *::caffe::PowerParameter::internal_default_instance(); +} +::caffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::caffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.power_param) + return power_param_; +} +::caffe::PowerParameter* V1LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.power_param) + clear_has_power_param(); + ::caffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_power_param(::caffe::PowerParameter* power_param) { + delete power_param_; + power_param_ = power_param; + if (power_param) { + set_has_power_param(); + } else { + clear_has_power_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.power_param) +} + +// optional .caffe.ReLUParameter relu_param = 30; +bool V1LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +void V1LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00000002u; +} +void V1LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00000002u; +} +void V1LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +const ::caffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ + : *::caffe::ReLUParameter::internal_default_instance(); +} +::caffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::caffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.relu_param) + return relu_param_; +} +::caffe::ReLUParameter* V1LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.relu_param) + clear_has_relu_param(); + ::caffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_relu_param(::caffe::ReLUParameter* relu_param) { + delete relu_param_; + relu_param_ = relu_param; + if (relu_param) { + set_has_relu_param(); + } else { + clear_has_relu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.relu_param) +} + +// optional .caffe.SigmoidParameter sigmoid_param = 38; +bool V1LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +void V1LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00000004u; +} +void V1LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00000004u; +} +void V1LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +const ::caffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ + : *::caffe::SigmoidParameter::internal_default_instance(); +} +::caffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::caffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +::caffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::caffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_sigmoid_param(::caffe::SigmoidParameter* sigmoid_param) { + delete sigmoid_param_; + sigmoid_param_ = sigmoid_param; + if (sigmoid_param) { + set_has_sigmoid_param(); + } else { + clear_has_sigmoid_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.sigmoid_param) +} + +// optional .caffe.SoftmaxParameter softmax_param = 39; +bool V1LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +void V1LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00000008u; +} +void V1LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00000008u; +} +void V1LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +const ::caffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ + : *::caffe::SoftmaxParameter::internal_default_instance(); +} +::caffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::caffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +::caffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.softmax_param) + clear_has_softmax_param(); + ::caffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_softmax_param(::caffe::SoftmaxParameter* softmax_param) { + delete softmax_param_; + softmax_param_ = softmax_param; + if (softmax_param) { + set_has_softmax_param(); + } else { + clear_has_softmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.softmax_param) +} + +// optional .caffe.SliceParameter slice_param = 31; +bool V1LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +void V1LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00000010u; +} +void V1LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00000010u; +} +void V1LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +const ::caffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ + : *::caffe::SliceParameter::internal_default_instance(); +} +::caffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::caffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.slice_param) + return slice_param_; +} +::caffe::SliceParameter* V1LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.slice_param) + clear_has_slice_param(); + ::caffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_slice_param(::caffe::SliceParameter* slice_param) { + delete slice_param_; + slice_param_ = slice_param; + if (slice_param) { + set_has_slice_param(); + } else { + clear_has_slice_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.slice_param) +} + +// optional .caffe.TanHParameter tanh_param = 37; +bool V1LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +void V1LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00000020u; +} +void V1LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00000020u; +} +void V1LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +const ::caffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ + : *::caffe::TanHParameter::internal_default_instance(); +} +::caffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::caffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +::caffe::TanHParameter* V1LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.tanh_param) + clear_has_tanh_param(); + ::caffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_tanh_param(::caffe::TanHParameter* tanh_param) { + delete tanh_param_; + tanh_param_ = tanh_param; + if (tanh_param) { + set_has_tanh_param(); + } else { + clear_has_tanh_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.tanh_param) +} + +// optional .caffe.ThresholdParameter threshold_param = 25; +bool V1LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +void V1LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00000040u; +} +void V1LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00000040u; +} +void V1LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +const ::caffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ + : *::caffe::ThresholdParameter::internal_default_instance(); +} +::caffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::caffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +::caffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.threshold_param) + clear_has_threshold_param(); + ::caffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_threshold_param(::caffe::ThresholdParameter* threshold_param) { + delete threshold_param_; + threshold_param_ = threshold_param; + if (threshold_param) { + set_has_threshold_param(); + } else { + clear_has_threshold_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.threshold_param) +} + +// optional .caffe.WindowDataParameter window_data_param = 20; +bool V1LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +void V1LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x00000080u; +} +void V1LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x00000080u; +} +void V1LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +const ::caffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ + : *::caffe::WindowDataParameter::internal_default_instance(); +} +::caffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::caffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +::caffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.window_data_param) + clear_has_window_data_param(); + ::caffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_window_data_param(::caffe::WindowDataParameter* window_data_param) { + delete window_data_param_; + window_data_param_ = window_data_param; + if (window_data_param) { + set_has_window_data_param(); + } else { + clear_has_window_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.window_data_param) +} + +// optional .caffe.TransformationParameter transform_param = 36; +bool V1LayerParameter::has_transform_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +void V1LayerParameter::set_has_transform_param() { + _has_bits_[1] |= 0x00000100u; +} +void V1LayerParameter::clear_has_transform_param() { + _has_bits_[1] &= ~0x00000100u; +} +void V1LayerParameter::clear_transform_param() { + if (transform_param_ != NULL) transform_param_->::caffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +const ::caffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ + : *::caffe::TransformationParameter::internal_default_instance(); +} +::caffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::caffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.transform_param) + return transform_param_; +} +::caffe::TransformationParameter* V1LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.transform_param) + clear_has_transform_param(); + ::caffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_transform_param(::caffe::TransformationParameter* transform_param) { + delete transform_param_; + transform_param_ = transform_param; + if (transform_param) { + set_has_transform_param(); + } else { + clear_has_transform_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.transform_param) +} + +// optional .caffe.LossParameter loss_param = 42; +bool V1LayerParameter::has_loss_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +void V1LayerParameter::set_has_loss_param() { + _has_bits_[1] |= 0x00000200u; +} +void V1LayerParameter::clear_has_loss_param() { + _has_bits_[1] &= ~0x00000200u; +} +void V1LayerParameter::clear_loss_param() { + if (loss_param_ != NULL) loss_param_->::caffe::LossParameter::Clear(); + clear_has_loss_param(); +} +const ::caffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ + : *::caffe::LossParameter::internal_default_instance(); +} +::caffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::caffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.loss_param) + return loss_param_; +} +::caffe::LossParameter* V1LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.loss_param) + clear_has_loss_param(); + ::caffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_loss_param(::caffe::LossParameter* loss_param) { + delete loss_param_; + loss_param_ = loss_param; + if (loss_param) { + set_has_loss_param(); + } else { + clear_has_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.loss_param) +} + +// optional .caffe.V0LayerParameter layer = 1; +bool V1LayerParameter::has_layer() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +void V1LayerParameter::set_has_layer() { + _has_bits_[1] |= 0x00000400u; +} +void V1LayerParameter::clear_has_layer() { + _has_bits_[1] &= ~0x00000400u; +} +void V1LayerParameter::clear_layer() { + if (layer_ != NULL) layer_->::caffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +const ::caffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.layer) + return layer_ != NULL ? *layer_ + : *::caffe::V0LayerParameter::internal_default_instance(); +} +::caffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) { + layer_ = new ::caffe::V0LayerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.layer) + return layer_; +} +::caffe::V0LayerParameter* V1LayerParameter::release_layer() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.layer) + clear_has_layer(); + ::caffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_layer(::caffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.layer) +} + +inline const V1LayerParameter* V1LayerParameter::internal_default_instance() { + return &V1LayerParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor() { + protobuf_AssignDescriptorsOnce(); + return V0LayerParameter_PoolMethod_descriptor_; +} +bool V0LayerParameter_PoolMethod_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const V0LayerParameter_PoolMethod V0LayerParameter::MAX; +const V0LayerParameter_PoolMethod V0LayerParameter::AVE; +const V0LayerParameter_PoolMethod V0LayerParameter::STOCHASTIC; +const V0LayerParameter_PoolMethod V0LayerParameter::PoolMethod_MIN; +const V0LayerParameter_PoolMethod V0LayerParameter::PoolMethod_MAX; +const int V0LayerParameter::PoolMethod_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +::std::string* V0LayerParameter::_default_det_crop_mode_ = NULL; +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int V0LayerParameter::kNameFieldNumber; +const int V0LayerParameter::kTypeFieldNumber; +const int V0LayerParameter::kNumOutputFieldNumber; +const int V0LayerParameter::kBiastermFieldNumber; +const int V0LayerParameter::kWeightFillerFieldNumber; +const int V0LayerParameter::kBiasFillerFieldNumber; +const int V0LayerParameter::kPadFieldNumber; +const int V0LayerParameter::kKernelsizeFieldNumber; +const int V0LayerParameter::kGroupFieldNumber; +const int V0LayerParameter::kStrideFieldNumber; +const int V0LayerParameter::kPoolFieldNumber; +const int V0LayerParameter::kDropoutRatioFieldNumber; +const int V0LayerParameter::kLocalSizeFieldNumber; +const int V0LayerParameter::kAlphaFieldNumber; +const int V0LayerParameter::kBetaFieldNumber; +const int V0LayerParameter::kKFieldNumber; +const int V0LayerParameter::kSourceFieldNumber; +const int V0LayerParameter::kScaleFieldNumber; +const int V0LayerParameter::kMeanfileFieldNumber; +const int V0LayerParameter::kBatchsizeFieldNumber; +const int V0LayerParameter::kCropsizeFieldNumber; +const int V0LayerParameter::kMirrorFieldNumber; +const int V0LayerParameter::kBlobsFieldNumber; +const int V0LayerParameter::kBlobsLrFieldNumber; +const int V0LayerParameter::kWeightDecayFieldNumber; +const int V0LayerParameter::kRandSkipFieldNumber; +const int V0LayerParameter::kDetFgThresholdFieldNumber; +const int V0LayerParameter::kDetBgThresholdFieldNumber; +const int V0LayerParameter::kDetFgFractionFieldNumber; +const int V0LayerParameter::kDetContextPadFieldNumber; +const int V0LayerParameter::kDetCropModeFieldNumber; +const int V0LayerParameter::kNewNumFieldNumber; +const int V0LayerParameter::kNewChannelsFieldNumber; +const int V0LayerParameter::kNewHeightFieldNumber; +const int V0LayerParameter::kNewWidthFieldNumber; +const int V0LayerParameter::kShuffleImagesFieldNumber; +const int V0LayerParameter::kConcatDimFieldNumber; +const int V0LayerParameter::kHdf5OutputParamFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +V0LayerParameter::V0LayerParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.V0LayerParameter) +} + +void V0LayerParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + bias_filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); + hdf5_output_param_ = const_cast< ::caffe::HDF5OutputParameter*>( + ::caffe::HDF5OutputParameter::internal_default_instance()); +} + +V0LayerParameter::V0LayerParameter(const V0LayerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.V0LayerParameter) +} + +void V0LayerParameter::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + meanfile_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + det_crop_mode_.UnsafeSetDefault(_default_det_crop_mode_); + weight_filler_ = NULL; + bias_filler_ = NULL; + hdf5_output_param_ = NULL; + ::memset(&num_output_, 0, reinterpret_cast(&new_width_) - + reinterpret_cast(&num_output_) + sizeof(new_width_)); + concat_dim_ = 1u; + biasterm_ = true; + group_ = 1u; + stride_ = 1u; + dropout_ratio_ = 0.5f; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + scale_ = 1; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + _cached_size_ = 0; +} + +V0LayerParameter::~V0LayerParameter() { + // @@protoc_insertion_point(destructor:caffe.V0LayerParameter) + SharedDtor(); +} + +void V0LayerParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + meanfile_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + det_crop_mode_.DestroyNoArena(_default_det_crop_mode_); + if (this != &V0LayerParameter_default_instance_.get()) { + delete weight_filler_; + delete bias_filler_; + delete hdf5_output_param_; + } +} + +void V0LayerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* V0LayerParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return V0LayerParameter_descriptor_; +} + +const V0LayerParameter& V0LayerParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed V0LayerParameter_default_instance_; + +V0LayerParameter* V0LayerParameter::New(::google::protobuf::Arena* arena) const { + V0LayerParameter* n = new V0LayerParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void V0LayerParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.V0LayerParameter) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(V0LayerParameter, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(num_output_, kernelsize_); + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_type()) { + type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + biasterm_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + } + } + if (_has_bits_[8 / 32] & 65280u) { + group_ = 1u; + stride_ = 1u; + pool_ = 0; + dropout_ratio_ = 0.5f; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + } + if (_has_bits_[16 / 32] & 4128768u) { + ZR_(batchsize_, cropsize_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_meanfile()) { + meanfile_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + mirror_ = false; + } + if (_has_bits_[24 / 32] & 4261412864u) { + ZR_(det_context_pad_, new_num_); + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + if (has_det_crop_mode()) { + det_crop_mode_.ClearToDefaultNoArena(_default_det_crop_mode_); + } + } + if (_has_bits_[32 / 32] & 63u) { + ZR_(new_channels_, new_width_); + shuffle_images_ = false; + concat_dim_ = 1u; + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + blobs_.Clear(); + blobs_lr_.Clear(); + weight_decay_.Clear(); + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool V0LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.V0LayerParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V0LayerParameter.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_type; + break; + } + + // optional string type = 2; + case 2: { + if (tag == 18) { + parse_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V0LayerParameter.type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_num_output; + break; + } + + // optional uint32 num_output = 3; + case 3: { + if (tag == 24) { + parse_num_output: + set_has_num_output(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_biasterm; + break; + } + + // optional bool biasterm = 4 [default = true]; + case 4: { + if (tag == 32) { + parse_biasterm: + set_has_biasterm(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &biasterm_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_weight_filler; + break; + } + + // optional .caffe.FillerParameter weight_filler = 5; + case 5: { + if (tag == 42) { + parse_weight_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_weight_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_bias_filler; + break; + } + + // optional .caffe.FillerParameter bias_filler = 6; + case 6: { + if (tag == 50) { + parse_bias_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bias_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_pad; + break; + } + + // optional uint32 pad = 7 [default = 0]; + case 7: { + if (tag == 56) { + parse_pad: + set_has_pad(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_kernelsize; + break; + } + + // optional uint32 kernelsize = 8; + case 8: { + if (tag == 64) { + parse_kernelsize: + set_has_kernelsize(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernelsize_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_group; + break; + } + + // optional uint32 group = 9 [default = 1]; + case 9: { + if (tag == 72) { + parse_group: + set_has_group(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_stride; + break; + } + + // optional uint32 stride = 10 [default = 1]; + case 10: { + if (tag == 80) { + parse_stride: + set_has_stride(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_pool; + break; + } + + // optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + case 11: { + if (tag == 88) { + parse_pool: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::caffe::V0LayerParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::caffe::V0LayerParameter_PoolMethod >(value)); + } else { + mutable_unknown_fields()->AddVarint(11, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(101)) goto parse_dropout_ratio; + break; + } + + // optional float dropout_ratio = 12 [default = 0.5]; + case 12: { + if (tag == 101) { + parse_dropout_ratio: + set_has_dropout_ratio(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_local_size; + break; + } + + // optional uint32 local_size = 13 [default = 5]; + case 13: { + if (tag == 104) { + parse_local_size: + set_has_local_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(117)) goto parse_alpha; + break; + } + + // optional float alpha = 14 [default = 1]; + case 14: { + if (tag == 117) { + parse_alpha: + set_has_alpha(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(125)) goto parse_beta; + break; + } + + // optional float beta = 15 [default = 0.75]; + case 15: { + if (tag == 125) { + parse_beta: + set_has_beta(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(130)) goto parse_source; + break; + } + + // optional string source = 16; + case 16: { + if (tag == 130) { + parse_source: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V0LayerParameter.source"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(141)) goto parse_scale; + break; + } + + // optional float scale = 17 [default = 1]; + case 17: { + if (tag == 141) { + parse_scale: + set_has_scale(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(146)) goto parse_meanfile; + break; + } + + // optional string meanfile = 18; + case 18: { + if (tag == 146) { + parse_meanfile: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_meanfile())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->meanfile().data(), this->meanfile().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V0LayerParameter.meanfile"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_batchsize; + break; + } + + // optional uint32 batchsize = 19; + case 19: { + if (tag == 152) { + parse_batchsize: + set_has_batchsize(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batchsize_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(160)) goto parse_cropsize; + break; + } + + // optional uint32 cropsize = 20 [default = 0]; + case 20: { + if (tag == 160) { + parse_cropsize: + set_has_cropsize(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &cropsize_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(168)) goto parse_mirror; + break; + } + + // optional bool mirror = 21 [default = false]; + case 21: { + if (tag == 168) { + parse_mirror: + set_has_mirror(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(181)) goto parse_k; + break; + } + + // optional float k = 22 [default = 1]; + case 22: { + if (tag == 181) { + parse_k: + set_has_k(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + break; + } + + // repeated .caffe.BlobProto blobs = 50; + case 50: { + if (tag == 402) { + parse_blobs: + DO_(input->IncrementRecursionDepth()); + parse_loop_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_loop_blobs; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(413)) goto parse_blobs_lr; + break; + } + + // repeated float blobs_lr = 51; + case 51: { + if (tag == 413) { + parse_blobs_lr: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 2, 413, input, this->mutable_blobs_lr()))); + } else if (tag == 410) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_blobs_lr()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(413)) goto parse_blobs_lr; + if (input->ExpectTag(421)) goto parse_weight_decay; + break; + } + + // repeated float weight_decay = 52; + case 52: { + if (tag == 421) { + parse_weight_decay: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 2, 421, input, this->mutable_weight_decay()))); + } else if (tag == 418) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_weight_decay()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(421)) goto parse_weight_decay; + if (input->ExpectTag(424)) goto parse_rand_skip; + break; + } + + // optional uint32 rand_skip = 53 [default = 0]; + case 53: { + if (tag == 424) { + parse_rand_skip: + set_has_rand_skip(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(437)) goto parse_det_fg_threshold; + break; + } + + // optional float det_fg_threshold = 54 [default = 0.5]; + case 54: { + if (tag == 437) { + parse_det_fg_threshold: + set_has_det_fg_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(445)) goto parse_det_bg_threshold; + break; + } + + // optional float det_bg_threshold = 55 [default = 0.5]; + case 55: { + if (tag == 445) { + parse_det_bg_threshold: + set_has_det_bg_threshold(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_bg_threshold_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(453)) goto parse_det_fg_fraction; + break; + } + + // optional float det_fg_fraction = 56 [default = 0.25]; + case 56: { + if (tag == 453) { + parse_det_fg_fraction: + set_has_det_fg_fraction(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_fraction_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(464)) goto parse_det_context_pad; + break; + } + + // optional uint32 det_context_pad = 58 [default = 0]; + case 58: { + if (tag == 464) { + parse_det_context_pad: + set_has_det_context_pad(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &det_context_pad_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(474)) goto parse_det_crop_mode; + break; + } + + // optional string det_crop_mode = 59 [default = "warp"]; + case 59: { + if (tag == 474) { + parse_det_crop_mode: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_det_crop_mode())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->det_crop_mode().data(), this->det_crop_mode().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "caffe.V0LayerParameter.det_crop_mode"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(480)) goto parse_new_num; + break; + } + + // optional int32 new_num = 60 [default = 0]; + case 60: { + if (tag == 480) { + parse_new_num: + set_has_new_num(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_num_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(488)) goto parse_new_channels; + break; + } + + // optional int32 new_channels = 61 [default = 0]; + case 61: { + if (tag == 488) { + parse_new_channels: + set_has_new_channels(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_channels_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(496)) goto parse_new_height; + break; + } + + // optional int32 new_height = 62 [default = 0]; + case 62: { + if (tag == 496) { + parse_new_height: + set_has_new_height(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_height_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(504)) goto parse_new_width; + break; + } + + // optional int32 new_width = 63 [default = 0]; + case 63: { + if (tag == 504) { + parse_new_width: + set_has_new_width(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_width_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(512)) goto parse_shuffle_images; + break; + } + + // optional bool shuffle_images = 64 [default = false]; + case 64: { + if (tag == 512) { + parse_shuffle_images: + set_has_shuffle_images(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_images_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(520)) goto parse_concat_dim; + break; + } + + // optional uint32 concat_dim = 65 [default = 1]; + case 65: { + if (tag == 520) { + parse_concat_dim: + set_has_concat_dim(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_hdf5_output_param; + break; + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; + case 1001: { + if (tag == 8010) { + parse_hdf5_output_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_hdf5_output_param())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.V0LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.V0LayerParameter) + return false; +#undef DO_ +} + +void V0LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->type(), output); + } + + // optional uint32 num_output = 3; + if (has_num_output()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->num_output(), output); + } + + // optional bool biasterm = 4 [default = true]; + if (has_biasterm()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->biasterm(), output); + } + + // optional .caffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *this->weight_filler_, output); + } + + // optional .caffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *this->bias_filler_, output); + } + + // optional uint32 pad = 7 [default = 0]; + if (has_pad()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->pad(), output); + } + + // optional uint32 kernelsize = 8; + if (has_kernelsize()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->kernelsize(), output); + } + + // optional uint32 group = 9 [default = 1]; + if (has_group()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->group(), output); + } + + // optional uint32 stride = 10 [default = 1]; + if (has_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->stride(), output); + } + + // optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 11, this->pool(), output); + } + + // optional float dropout_ratio = 12 [default = 0.5]; + if (has_dropout_ratio()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(12, this->dropout_ratio(), output); + } + + // optional uint32 local_size = 13 [default = 5]; + if (has_local_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->local_size(), output); + } + + // optional float alpha = 14 [default = 1]; + if (has_alpha()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(14, this->alpha(), output); + } + + // optional float beta = 15 [default = 0.75]; + if (has_beta()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(15, this->beta(), output); + } + + // optional string source = 16; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 16, this->source(), output); + } + + // optional float scale = 17 [default = 1]; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(17, this->scale(), output); + } + + // optional string meanfile = 18; + if (has_meanfile()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->meanfile().data(), this->meanfile().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.meanfile"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 18, this->meanfile(), output); + } + + // optional uint32 batchsize = 19; + if (has_batchsize()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(19, this->batchsize(), output); + } + + // optional uint32 cropsize = 20 [default = 0]; + if (has_cropsize()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(20, this->cropsize(), output); + } + + // optional bool mirror = 21 [default = false]; + if (has_mirror()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(21, this->mirror(), output); + } + + // optional float k = 22 [default = 1]; + if (has_k()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(22, this->k(), output); + } + + // repeated .caffe.BlobProto blobs = 50; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 50, this->blobs(i), output); + } + + // repeated float blobs_lr = 51; + for (int i = 0; i < this->blobs_lr_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 51, this->blobs_lr(i), output); + } + + // repeated float weight_decay = 52; + for (int i = 0; i < this->weight_decay_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat( + 52, this->weight_decay(i), output); + } + + // optional uint32 rand_skip = 53 [default = 0]; + if (has_rand_skip()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(53, this->rand_skip(), output); + } + + // optional float det_fg_threshold = 54 [default = 0.5]; + if (has_det_fg_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(54, this->det_fg_threshold(), output); + } + + // optional float det_bg_threshold = 55 [default = 0.5]; + if (has_det_bg_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(55, this->det_bg_threshold(), output); + } + + // optional float det_fg_fraction = 56 [default = 0.25]; + if (has_det_fg_fraction()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(56, this->det_fg_fraction(), output); + } + + // optional uint32 det_context_pad = 58 [default = 0]; + if (has_det_context_pad()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(58, this->det_context_pad(), output); + } + + // optional string det_crop_mode = 59 [default = "warp"]; + if (has_det_crop_mode()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->det_crop_mode().data(), this->det_crop_mode().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.det_crop_mode"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 59, this->det_crop_mode(), output); + } + + // optional int32 new_num = 60 [default = 0]; + if (has_new_num()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(60, this->new_num(), output); + } + + // optional int32 new_channels = 61 [default = 0]; + if (has_new_channels()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(61, this->new_channels(), output); + } + + // optional int32 new_height = 62 [default = 0]; + if (has_new_height()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(62, this->new_height(), output); + } + + // optional int32 new_width = 63 [default = 0]; + if (has_new_width()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(63, this->new_width(), output); + } + + // optional bool shuffle_images = 64 [default = false]; + if (has_shuffle_images()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(64, this->shuffle_images(), output); + } + + // optional uint32 concat_dim = 65 [default = 1]; + if (has_concat_dim()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(65, this->concat_dim(), output); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1001, *this->hdf5_output_param_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.V0LayerParameter) +} + +::google::protobuf::uint8* V0LayerParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->type(), target); + } + + // optional uint32 num_output = 3; + if (has_num_output()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->num_output(), target); + } + + // optional bool biasterm = 4 [default = true]; + if (has_biasterm()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->biasterm(), target); + } + + // optional .caffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *this->weight_filler_, false, target); + } + + // optional .caffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 6, *this->bias_filler_, false, target); + } + + // optional uint32 pad = 7 [default = 0]; + if (has_pad()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->pad(), target); + } + + // optional uint32 kernelsize = 8; + if (has_kernelsize()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->kernelsize(), target); + } + + // optional uint32 group = 9 [default = 1]; + if (has_group()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->group(), target); + } + + // optional uint32 stride = 10 [default = 1]; + if (has_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->stride(), target); + } + + // optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + if (has_pool()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 11, this->pool(), target); + } + + // optional float dropout_ratio = 12 [default = 0.5]; + if (has_dropout_ratio()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(12, this->dropout_ratio(), target); + } + + // optional uint32 local_size = 13 [default = 5]; + if (has_local_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->local_size(), target); + } + + // optional float alpha = 14 [default = 1]; + if (has_alpha()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(14, this->alpha(), target); + } + + // optional float beta = 15 [default = 0.75]; + if (has_beta()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(15, this->beta(), target); + } + + // optional string source = 16; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 16, this->source(), target); + } + + // optional float scale = 17 [default = 1]; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(17, this->scale(), target); + } + + // optional string meanfile = 18; + if (has_meanfile()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->meanfile().data(), this->meanfile().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.meanfile"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 18, this->meanfile(), target); + } + + // optional uint32 batchsize = 19; + if (has_batchsize()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(19, this->batchsize(), target); + } + + // optional uint32 cropsize = 20 [default = 0]; + if (has_cropsize()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(20, this->cropsize(), target); + } + + // optional bool mirror = 21 [default = false]; + if (has_mirror()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(21, this->mirror(), target); + } + + // optional float k = 22 [default = 1]; + if (has_k()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(22, this->k(), target); + } + + // repeated .caffe.BlobProto blobs = 50; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 50, this->blobs(i), false, target); + } + + // repeated float blobs_lr = 51; + for (int i = 0; i < this->blobs_lr_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(51, this->blobs_lr(i), target); + } + + // repeated float weight_decay = 52; + for (int i = 0; i < this->weight_decay_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatToArray(52, this->weight_decay(i), target); + } + + // optional uint32 rand_skip = 53 [default = 0]; + if (has_rand_skip()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(53, this->rand_skip(), target); + } + + // optional float det_fg_threshold = 54 [default = 0.5]; + if (has_det_fg_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(54, this->det_fg_threshold(), target); + } + + // optional float det_bg_threshold = 55 [default = 0.5]; + if (has_det_bg_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(55, this->det_bg_threshold(), target); + } + + // optional float det_fg_fraction = 56 [default = 0.25]; + if (has_det_fg_fraction()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(56, this->det_fg_fraction(), target); + } + + // optional uint32 det_context_pad = 58 [default = 0]; + if (has_det_context_pad()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(58, this->det_context_pad(), target); + } + + // optional string det_crop_mode = 59 [default = "warp"]; + if (has_det_crop_mode()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->det_crop_mode().data(), this->det_crop_mode().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "caffe.V0LayerParameter.det_crop_mode"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 59, this->det_crop_mode(), target); + } + + // optional int32 new_num = 60 [default = 0]; + if (has_new_num()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(60, this->new_num(), target); + } + + // optional int32 new_channels = 61 [default = 0]; + if (has_new_channels()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(61, this->new_channels(), target); + } + + // optional int32 new_height = 62 [default = 0]; + if (has_new_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(62, this->new_height(), target); + } + + // optional int32 new_width = 63 [default = 0]; + if (has_new_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(63, this->new_width(), target); + } + + // optional bool shuffle_images = 64 [default = false]; + if (has_shuffle_images()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(64, this->shuffle_images(), target); + } + + // optional uint32 concat_dim = 65 [default = 1]; + if (has_concat_dim()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(65, this->concat_dim(), target); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1001, *this->hdf5_output_param_, false, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.V0LayerParameter) + return target; +} + +size_t V0LayerParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.V0LayerParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // optional uint32 num_output = 3; + if (has_num_output()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_output()); + } + + // optional bool biasterm = 4 [default = true]; + if (has_biasterm()) { + total_size += 1 + 1; + } + + // optional .caffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .caffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + // optional uint32 pad = 7 [default = 0]; + if (has_pad()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad()); + } + + // optional uint32 kernelsize = 8; + if (has_kernelsize()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernelsize()); + } + + } + if (_has_bits_[8 / 32] & 65280u) { + // optional uint32 group = 9 [default = 1]; + if (has_group()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->group()); + } + + // optional uint32 stride = 10 [default = 1]; + if (has_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride()); + } + + // optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional float dropout_ratio = 12 [default = 0.5]; + if (has_dropout_ratio()) { + total_size += 1 + 4; + } + + // optional uint32 local_size = 13 [default = 5]; + if (has_local_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->local_size()); + } + + // optional float alpha = 14 [default = 1]; + if (has_alpha()) { + total_size += 1 + 4; + } + + // optional float beta = 15 [default = 0.75]; + if (has_beta()) { + total_size += 1 + 4; + } + + // optional float k = 22 [default = 1]; + if (has_k()) { + total_size += 2 + 4; + } + + } + if (_has_bits_[16 / 32] & 4128768u) { + // optional string source = 16; + if (has_source()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + // optional float scale = 17 [default = 1]; + if (has_scale()) { + total_size += 2 + 4; + } + + // optional string meanfile = 18; + if (has_meanfile()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->meanfile()); + } + + // optional uint32 batchsize = 19; + if (has_batchsize()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batchsize()); + } + + // optional uint32 cropsize = 20 [default = 0]; + if (has_cropsize()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->cropsize()); + } + + // optional bool mirror = 21 [default = false]; + if (has_mirror()) { + total_size += 2 + 1; + } + + } + if (_has_bits_[25 / 32] & 4261412864u) { + // optional uint32 rand_skip = 53 [default = 0]; + if (has_rand_skip()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->rand_skip()); + } + + // optional float det_fg_threshold = 54 [default = 0.5]; + if (has_det_fg_threshold()) { + total_size += 2 + 4; + } + + // optional float det_bg_threshold = 55 [default = 0.5]; + if (has_det_bg_threshold()) { + total_size += 2 + 4; + } + + // optional float det_fg_fraction = 56 [default = 0.25]; + if (has_det_fg_fraction()) { + total_size += 2 + 4; + } + + // optional uint32 det_context_pad = 58 [default = 0]; + if (has_det_context_pad()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->det_context_pad()); + } + + // optional string det_crop_mode = 59 [default = "warp"]; + if (has_det_crop_mode()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->det_crop_mode()); + } + + // optional int32 new_num = 60 [default = 0]; + if (has_new_num()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->new_num()); + } + + } + if (_has_bits_[32 / 32] & 63u) { + // optional int32 new_channels = 61 [default = 0]; + if (has_new_channels()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->new_channels()); + } + + // optional int32 new_height = 62 [default = 0]; + if (has_new_height()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->new_height()); + } + + // optional int32 new_width = 63 [default = 0]; + if (has_new_width()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->new_width()); + } + + // optional bool shuffle_images = 64 [default = false]; + if (has_shuffle_images()) { + total_size += 2 + 1; + } + + // optional uint32 concat_dim = 65 [default = 1]; + if (has_concat_dim()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->concat_dim()); + } + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + } + // repeated .caffe.BlobProto blobs = 50; + { + unsigned int count = this->blobs_size(); + total_size += 2UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + } + + // repeated float blobs_lr = 51; + { + size_t data_size = 0; + unsigned int count = this->blobs_lr_size(); + data_size = 4UL * count; + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->blobs_lr_size()); + total_size += data_size; + } + + // repeated float weight_decay = 52; + { + size_t data_size = 0; + unsigned int count = this->weight_decay_size(); + data_size = 4UL * count; + total_size += 2 * + ::google::protobuf::internal::FromIntSize(this->weight_decay_size()); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V0LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.V0LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const V0LayerParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.V0LayerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.V0LayerParameter) + UnsafeMergeFrom(*source); + } +} + +void V0LayerParameter::MergeFrom(const V0LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.V0LayerParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void V0LayerParameter::UnsafeMergeFrom(const V0LayerParameter& from) { + GOOGLE_DCHECK(&from != this); + blobs_.MergeFrom(from.blobs_); + blobs_lr_.UnsafeMergeFrom(from.blobs_lr_); + weight_decay_.UnsafeMergeFrom(from.weight_decay_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_type()) { + set_has_type(); + type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_); + } + if (from.has_num_output()) { + set_num_output(from.num_output()); + } + if (from.has_biasterm()) { + set_biasterm(from.biasterm()); + } + if (from.has_weight_filler()) { + mutable_weight_filler()->::caffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::caffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_pad()) { + set_pad(from.pad()); + } + if (from.has_kernelsize()) { + set_kernelsize(from.kernelsize()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_group()) { + set_group(from.group()); + } + if (from.has_stride()) { + set_stride(from.stride()); + } + if (from.has_pool()) { + set_pool(from.pool()); + } + if (from.has_dropout_ratio()) { + set_dropout_ratio(from.dropout_ratio()); + } + if (from.has_local_size()) { + set_local_size(from.local_size()); + } + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + if (from.has_beta()) { + set_beta(from.beta()); + } + if (from.has_k()) { + set_k(from.k()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_source()) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_meanfile()) { + set_has_meanfile(); + meanfile_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.meanfile_); + } + if (from.has_batchsize()) { + set_batchsize(from.batchsize()); + } + if (from.has_cropsize()) { + set_cropsize(from.cropsize()); + } + if (from.has_mirror()) { + set_mirror(from.mirror()); + } + } + if (from._has_bits_[25 / 32] & (0xffu << (25 % 32))) { + if (from.has_rand_skip()) { + set_rand_skip(from.rand_skip()); + } + if (from.has_det_fg_threshold()) { + set_det_fg_threshold(from.det_fg_threshold()); + } + if (from.has_det_bg_threshold()) { + set_det_bg_threshold(from.det_bg_threshold()); + } + if (from.has_det_fg_fraction()) { + set_det_fg_fraction(from.det_fg_fraction()); + } + if (from.has_det_context_pad()) { + set_det_context_pad(from.det_context_pad()); + } + if (from.has_det_crop_mode()) { + set_has_det_crop_mode(); + det_crop_mode_.AssignWithDefault(_default_det_crop_mode_, from.det_crop_mode_); + } + if (from.has_new_num()) { + set_new_num(from.new_num()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_new_channels()) { + set_new_channels(from.new_channels()); + } + if (from.has_new_height()) { + set_new_height(from.new_height()); + } + if (from.has_new_width()) { + set_new_width(from.new_width()); + } + if (from.has_shuffle_images()) { + set_shuffle_images(from.shuffle_images()); + } + if (from.has_concat_dim()) { + set_concat_dim(from.concat_dim()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::caffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void V0LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.V0LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void V0LayerParameter::CopyFrom(const V0LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.V0LayerParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool V0LayerParameter::IsInitialized() const { + + return true; +} + +void V0LayerParameter::Swap(V0LayerParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void V0LayerParameter::InternalSwap(V0LayerParameter* other) { + name_.Swap(&other->name_); + type_.Swap(&other->type_); + std::swap(num_output_, other->num_output_); + std::swap(biasterm_, other->biasterm_); + std::swap(weight_filler_, other->weight_filler_); + std::swap(bias_filler_, other->bias_filler_); + std::swap(pad_, other->pad_); + std::swap(kernelsize_, other->kernelsize_); + std::swap(group_, other->group_); + std::swap(stride_, other->stride_); + std::swap(pool_, other->pool_); + std::swap(dropout_ratio_, other->dropout_ratio_); + std::swap(local_size_, other->local_size_); + std::swap(alpha_, other->alpha_); + std::swap(beta_, other->beta_); + std::swap(k_, other->k_); + source_.Swap(&other->source_); + std::swap(scale_, other->scale_); + meanfile_.Swap(&other->meanfile_); + std::swap(batchsize_, other->batchsize_); + std::swap(cropsize_, other->cropsize_); + std::swap(mirror_, other->mirror_); + blobs_.UnsafeArenaSwap(&other->blobs_); + blobs_lr_.UnsafeArenaSwap(&other->blobs_lr_); + weight_decay_.UnsafeArenaSwap(&other->weight_decay_); + std::swap(rand_skip_, other->rand_skip_); + std::swap(det_fg_threshold_, other->det_fg_threshold_); + std::swap(det_bg_threshold_, other->det_bg_threshold_); + std::swap(det_fg_fraction_, other->det_fg_fraction_); + std::swap(det_context_pad_, other->det_context_pad_); + det_crop_mode_.Swap(&other->det_crop_mode_); + std::swap(new_num_, other->new_num_); + std::swap(new_channels_, other->new_channels_); + std::swap(new_height_, other->new_height_); + std::swap(new_width_, other->new_width_); + std::swap(shuffle_images_, other->shuffle_images_); + std::swap(concat_dim_, other->concat_dim_); + std::swap(hdf5_output_param_, other->hdf5_output_param_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_has_bits_[1], other->_has_bits_[1]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata V0LayerParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = V0LayerParameter_descriptor_; + metadata.reflection = V0LayerParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// V0LayerParameter + +// optional string name = 1; +bool V0LayerParameter::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void V0LayerParameter::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void V0LayerParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void V0LayerParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +const ::std::string& V0LayerParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.name) +} +void V0LayerParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.name) +} +void V0LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.name) +} +::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* V0LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.name) +} + +// optional string type = 2; +bool V0LayerParameter::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void V0LayerParameter::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +void V0LayerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +void V0LayerParameter::clear_type() { + type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); +} +const ::std::string& V0LayerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.type) + return type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.type) +} +void V0LayerParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.type) +} +void V0LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.type) +} +::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* V0LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.type) +} + +// optional uint32 num_output = 3; +bool V0LayerParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void V0LayerParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000004u; +} +void V0LayerParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000004u; +} +void V0LayerParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +::google::protobuf::uint32 V0LayerParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.num_output) + return num_output_; +} +void V0LayerParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.num_output) +} + +// optional bool biasterm = 4 [default = true]; +bool V0LayerParameter::has_biasterm() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void V0LayerParameter::set_has_biasterm() { + _has_bits_[0] |= 0x00000008u; +} +void V0LayerParameter::clear_has_biasterm() { + _has_bits_[0] &= ~0x00000008u; +} +void V0LayerParameter::clear_biasterm() { + biasterm_ = true; + clear_has_biasterm(); +} +bool V0LayerParameter::biasterm() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.biasterm) + return biasterm_; +} +void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.biasterm) +} + +// optional .caffe.FillerParameter weight_filler = 5; +bool V0LayerParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void V0LayerParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000010u; +} +void V0LayerParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000010u; +} +void V0LayerParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::caffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +::caffe::FillerParameter* V0LayerParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 6; +bool V0LayerParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void V0LayerParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000020u; +} +void V0LayerParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000020u; +} +void V0LayerParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::caffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +::caffe::FillerParameter* V0LayerParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.bias_filler) +} + +// optional uint32 pad = 7 [default = 0]; +bool V0LayerParameter::has_pad() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void V0LayerParameter::set_has_pad() { + _has_bits_[0] |= 0x00000040u; +} +void V0LayerParameter::clear_has_pad() { + _has_bits_[0] &= ~0x00000040u; +} +void V0LayerParameter::clear_pad() { + pad_ = 0u; + clear_has_pad(); +} +::google::protobuf::uint32 V0LayerParameter::pad() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.pad) + return pad_; +} +void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.pad) +} + +// optional uint32 kernelsize = 8; +bool V0LayerParameter::has_kernelsize() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void V0LayerParameter::set_has_kernelsize() { + _has_bits_[0] |= 0x00000080u; +} +void V0LayerParameter::clear_has_kernelsize() { + _has_bits_[0] &= ~0x00000080u; +} +void V0LayerParameter::clear_kernelsize() { + kernelsize_ = 0u; + clear_has_kernelsize(); +} +::google::protobuf::uint32 V0LayerParameter::kernelsize() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.kernelsize) + return kernelsize_; +} +void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.kernelsize) +} + +// optional uint32 group = 9 [default = 1]; +bool V0LayerParameter::has_group() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void V0LayerParameter::set_has_group() { + _has_bits_[0] |= 0x00000100u; +} +void V0LayerParameter::clear_has_group() { + _has_bits_[0] &= ~0x00000100u; +} +void V0LayerParameter::clear_group() { + group_ = 1u; + clear_has_group(); +} +::google::protobuf::uint32 V0LayerParameter::group() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.group) + return group_; +} +void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.group) +} + +// optional uint32 stride = 10 [default = 1]; +bool V0LayerParameter::has_stride() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void V0LayerParameter::set_has_stride() { + _has_bits_[0] |= 0x00000200u; +} +void V0LayerParameter::clear_has_stride() { + _has_bits_[0] &= ~0x00000200u; +} +void V0LayerParameter::clear_stride() { + stride_ = 1u; + clear_has_stride(); +} +::google::protobuf::uint32 V0LayerParameter::stride() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.stride) + return stride_; +} +void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.stride) +} + +// optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; +bool V0LayerParameter::has_pool() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void V0LayerParameter::set_has_pool() { + _has_bits_[0] |= 0x00000400u; +} +void V0LayerParameter::clear_has_pool() { + _has_bits_[0] &= ~0x00000400u; +} +void V0LayerParameter::clear_pool() { + pool_ = 0; + clear_has_pool(); +} +::caffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.pool) + return static_cast< ::caffe::V0LayerParameter_PoolMethod >(pool_); +} +void V0LayerParameter::set_pool(::caffe::V0LayerParameter_PoolMethod value) { + assert(::caffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.pool) +} + +// optional float dropout_ratio = 12 [default = 0.5]; +bool V0LayerParameter::has_dropout_ratio() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void V0LayerParameter::set_has_dropout_ratio() { + _has_bits_[0] |= 0x00000800u; +} +void V0LayerParameter::clear_has_dropout_ratio() { + _has_bits_[0] &= ~0x00000800u; +} +void V0LayerParameter::clear_dropout_ratio() { + dropout_ratio_ = 0.5f; + clear_has_dropout_ratio(); +} +float V0LayerParameter::dropout_ratio() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.dropout_ratio) + return dropout_ratio_; +} +void V0LayerParameter::set_dropout_ratio(float value) { + set_has_dropout_ratio(); + dropout_ratio_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.dropout_ratio) +} + +// optional uint32 local_size = 13 [default = 5]; +bool V0LayerParameter::has_local_size() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void V0LayerParameter::set_has_local_size() { + _has_bits_[0] |= 0x00001000u; +} +void V0LayerParameter::clear_has_local_size() { + _has_bits_[0] &= ~0x00001000u; +} +void V0LayerParameter::clear_local_size() { + local_size_ = 5u; + clear_has_local_size(); +} +::google::protobuf::uint32 V0LayerParameter::local_size() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.local_size) + return local_size_; +} +void V0LayerParameter::set_local_size(::google::protobuf::uint32 value) { + set_has_local_size(); + local_size_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.local_size) +} + +// optional float alpha = 14 [default = 1]; +bool V0LayerParameter::has_alpha() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +void V0LayerParameter::set_has_alpha() { + _has_bits_[0] |= 0x00002000u; +} +void V0LayerParameter::clear_has_alpha() { + _has_bits_[0] &= ~0x00002000u; +} +void V0LayerParameter::clear_alpha() { + alpha_ = 1; + clear_has_alpha(); +} +float V0LayerParameter::alpha() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.alpha) + return alpha_; +} +void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.alpha) +} + +// optional float beta = 15 [default = 0.75]; +bool V0LayerParameter::has_beta() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +void V0LayerParameter::set_has_beta() { + _has_bits_[0] |= 0x00004000u; +} +void V0LayerParameter::clear_has_beta() { + _has_bits_[0] &= ~0x00004000u; +} +void V0LayerParameter::clear_beta() { + beta_ = 0.75f; + clear_has_beta(); +} +float V0LayerParameter::beta() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.beta) + return beta_; +} +void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.beta) +} + +// optional float k = 22 [default = 1]; +bool V0LayerParameter::has_k() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +void V0LayerParameter::set_has_k() { + _has_bits_[0] |= 0x00008000u; +} +void V0LayerParameter::clear_has_k() { + _has_bits_[0] &= ~0x00008000u; +} +void V0LayerParameter::clear_k() { + k_ = 1; + clear_has_k(); +} +float V0LayerParameter::k() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.k) + return k_; +} +void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.k) +} + +// optional string source = 16; +bool V0LayerParameter::has_source() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +void V0LayerParameter::set_has_source() { + _has_bits_[0] |= 0x00010000u; +} +void V0LayerParameter::clear_has_source() { + _has_bits_[0] &= ~0x00010000u; +} +void V0LayerParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +const ::std::string& V0LayerParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.source) +} +void V0LayerParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.source) +} +void V0LayerParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.source) +} +::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* V0LayerParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.source) +} + +// optional float scale = 17 [default = 1]; +bool V0LayerParameter::has_scale() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +void V0LayerParameter::set_has_scale() { + _has_bits_[0] |= 0x00020000u; +} +void V0LayerParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00020000u; +} +void V0LayerParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +float V0LayerParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.scale) + return scale_; +} +void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.scale) +} + +// optional string meanfile = 18; +bool V0LayerParameter::has_meanfile() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +void V0LayerParameter::set_has_meanfile() { + _has_bits_[0] |= 0x00040000u; +} +void V0LayerParameter::clear_has_meanfile() { + _has_bits_[0] &= ~0x00040000u; +} +void V0LayerParameter::clear_meanfile() { + meanfile_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_meanfile(); +} +const ::std::string& V0LayerParameter::meanfile() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.meanfile) + return meanfile_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_meanfile(const ::std::string& value) { + set_has_meanfile(); + meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.meanfile) +} +void V0LayerParameter::set_meanfile(const char* value) { + set_has_meanfile(); + meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.meanfile) +} +void V0LayerParameter::set_meanfile(const char* value, size_t size) { + set_has_meanfile(); + meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.meanfile) +} +::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.meanfile) + return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +::std::string* V0LayerParameter::release_meanfile() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.meanfile) + clear_has_meanfile(); + return meanfile_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void V0LayerParameter::set_allocated_meanfile(::std::string* meanfile) { + if (meanfile != NULL) { + set_has_meanfile(); + } else { + clear_has_meanfile(); + } + meanfile_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), meanfile); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.meanfile) +} + +// optional uint32 batchsize = 19; +bool V0LayerParameter::has_batchsize() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +void V0LayerParameter::set_has_batchsize() { + _has_bits_[0] |= 0x00080000u; +} +void V0LayerParameter::clear_has_batchsize() { + _has_bits_[0] &= ~0x00080000u; +} +void V0LayerParameter::clear_batchsize() { + batchsize_ = 0u; + clear_has_batchsize(); +} +::google::protobuf::uint32 V0LayerParameter::batchsize() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.batchsize) + return batchsize_; +} +void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.batchsize) +} + +// optional uint32 cropsize = 20 [default = 0]; +bool V0LayerParameter::has_cropsize() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +void V0LayerParameter::set_has_cropsize() { + _has_bits_[0] |= 0x00100000u; +} +void V0LayerParameter::clear_has_cropsize() { + _has_bits_[0] &= ~0x00100000u; +} +void V0LayerParameter::clear_cropsize() { + cropsize_ = 0u; + clear_has_cropsize(); +} +::google::protobuf::uint32 V0LayerParameter::cropsize() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.cropsize) + return cropsize_; +} +void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.cropsize) +} + +// optional bool mirror = 21 [default = false]; +bool V0LayerParameter::has_mirror() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +void V0LayerParameter::set_has_mirror() { + _has_bits_[0] |= 0x00200000u; +} +void V0LayerParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00200000u; +} +void V0LayerParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +bool V0LayerParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.mirror) + return mirror_; +} +void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.mirror) +} + +// repeated .caffe.BlobProto blobs = 50; +int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::caffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +::caffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +::caffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.V0LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:caffe.V0LayerParameter.blobs) + return blobs_; +} + +// repeated float blobs_lr = 51; +int V0LayerParameter::blobs_lr_size() const { + return blobs_lr_.size(); +} +void V0LayerParameter::clear_blobs_lr() { + blobs_lr_.Clear(); +} +float V0LayerParameter::blobs_lr(int index) const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.blobs_lr) + return blobs_lr_.Get(index); +} +void V0LayerParameter::set_blobs_lr(int index, float value) { + blobs_lr_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.blobs_lr) +} +void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V0LayerParameter.blobs_lr) +} +const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:caffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} +::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:caffe.V0LayerParameter.blobs_lr) + return &blobs_lr_; +} + +// repeated float weight_decay = 52; +int V0LayerParameter::weight_decay_size() const { + return weight_decay_.size(); +} +void V0LayerParameter::clear_weight_decay() { + weight_decay_.Clear(); +} +float V0LayerParameter::weight_decay(int index) const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.weight_decay) + return weight_decay_.Get(index); +} +void V0LayerParameter::set_weight_decay(int index, float value) { + weight_decay_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.weight_decay) +} +void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V0LayerParameter.weight_decay) +} +const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:caffe.V0LayerParameter.weight_decay) + return weight_decay_; +} +::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:caffe.V0LayerParameter.weight_decay) + return &weight_decay_; +} + +// optional uint32 rand_skip = 53 [default = 0]; +bool V0LayerParameter::has_rand_skip() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +void V0LayerParameter::set_has_rand_skip() { + _has_bits_[0] |= 0x02000000u; +} +void V0LayerParameter::clear_has_rand_skip() { + _has_bits_[0] &= ~0x02000000u; +} +void V0LayerParameter::clear_rand_skip() { + rand_skip_ = 0u; + clear_has_rand_skip(); +} +::google::protobuf::uint32 V0LayerParameter::rand_skip() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.rand_skip) + return rand_skip_; +} +void V0LayerParameter::set_rand_skip(::google::protobuf::uint32 value) { + set_has_rand_skip(); + rand_skip_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.rand_skip) +} + +// optional float det_fg_threshold = 54 [default = 0.5]; +bool V0LayerParameter::has_det_fg_threshold() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +void V0LayerParameter::set_has_det_fg_threshold() { + _has_bits_[0] |= 0x04000000u; +} +void V0LayerParameter::clear_has_det_fg_threshold() { + _has_bits_[0] &= ~0x04000000u; +} +void V0LayerParameter::clear_det_fg_threshold() { + det_fg_threshold_ = 0.5f; + clear_has_det_fg_threshold(); +} +float V0LayerParameter::det_fg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_fg_threshold) + return det_fg_threshold_; +} +void V0LayerParameter::set_det_fg_threshold(float value) { + set_has_det_fg_threshold(); + det_fg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_fg_threshold) +} + +// optional float det_bg_threshold = 55 [default = 0.5]; +bool V0LayerParameter::has_det_bg_threshold() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +void V0LayerParameter::set_has_det_bg_threshold() { + _has_bits_[0] |= 0x08000000u; +} +void V0LayerParameter::clear_has_det_bg_threshold() { + _has_bits_[0] &= ~0x08000000u; +} +void V0LayerParameter::clear_det_bg_threshold() { + det_bg_threshold_ = 0.5f; + clear_has_det_bg_threshold(); +} +float V0LayerParameter::det_bg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_bg_threshold) + return det_bg_threshold_; +} +void V0LayerParameter::set_det_bg_threshold(float value) { + set_has_det_bg_threshold(); + det_bg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_bg_threshold) +} + +// optional float det_fg_fraction = 56 [default = 0.25]; +bool V0LayerParameter::has_det_fg_fraction() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +void V0LayerParameter::set_has_det_fg_fraction() { + _has_bits_[0] |= 0x10000000u; +} +void V0LayerParameter::clear_has_det_fg_fraction() { + _has_bits_[0] &= ~0x10000000u; +} +void V0LayerParameter::clear_det_fg_fraction() { + det_fg_fraction_ = 0.25f; + clear_has_det_fg_fraction(); +} +float V0LayerParameter::det_fg_fraction() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_fg_fraction) + return det_fg_fraction_; +} +void V0LayerParameter::set_det_fg_fraction(float value) { + set_has_det_fg_fraction(); + det_fg_fraction_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_fg_fraction) +} + +// optional uint32 det_context_pad = 58 [default = 0]; +bool V0LayerParameter::has_det_context_pad() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +void V0LayerParameter::set_has_det_context_pad() { + _has_bits_[0] |= 0x20000000u; +} +void V0LayerParameter::clear_has_det_context_pad() { + _has_bits_[0] &= ~0x20000000u; +} +void V0LayerParameter::clear_det_context_pad() { + det_context_pad_ = 0u; + clear_has_det_context_pad(); +} +::google::protobuf::uint32 V0LayerParameter::det_context_pad() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_context_pad) + return det_context_pad_; +} +void V0LayerParameter::set_det_context_pad(::google::protobuf::uint32 value) { + set_has_det_context_pad(); + det_context_pad_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_context_pad) +} + +// optional string det_crop_mode = 59 [default = "warp"]; +bool V0LayerParameter::has_det_crop_mode() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +void V0LayerParameter::set_has_det_crop_mode() { + _has_bits_[0] |= 0x40000000u; +} +void V0LayerParameter::clear_has_det_crop_mode() { + _has_bits_[0] &= ~0x40000000u; +} +void V0LayerParameter::clear_det_crop_mode() { + det_crop_mode_.ClearToDefaultNoArena(_default_det_crop_mode_); + clear_has_det_crop_mode(); +} +const ::std::string& V0LayerParameter::det_crop_mode() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_crop_mode) + return det_crop_mode_.GetNoArena(_default_det_crop_mode_); +} +void V0LayerParameter::set_det_crop_mode(const ::std::string& value) { + set_has_det_crop_mode(); + det_crop_mode_.SetNoArena(_default_det_crop_mode_, value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_crop_mode) +} +void V0LayerParameter::set_det_crop_mode(const char* value) { + set_has_det_crop_mode(); + det_crop_mode_.SetNoArena(_default_det_crop_mode_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.det_crop_mode) +} +void V0LayerParameter::set_det_crop_mode(const char* value, size_t size) { + set_has_det_crop_mode(); + det_crop_mode_.SetNoArena(_default_det_crop_mode_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.det_crop_mode) +} +::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.det_crop_mode) + return det_crop_mode_.MutableNoArena(_default_det_crop_mode_); +} +::std::string* V0LayerParameter::release_det_crop_mode() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.det_crop_mode) + clear_has_det_crop_mode(); + return det_crop_mode_.ReleaseNoArena(_default_det_crop_mode_); +} +void V0LayerParameter::set_allocated_det_crop_mode(::std::string* det_crop_mode) { + if (det_crop_mode != NULL) { + set_has_det_crop_mode(); + } else { + clear_has_det_crop_mode(); + } + det_crop_mode_.SetAllocatedNoArena(_default_det_crop_mode_, det_crop_mode); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.det_crop_mode) +} + +// optional int32 new_num = 60 [default = 0]; +bool V0LayerParameter::has_new_num() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +void V0LayerParameter::set_has_new_num() { + _has_bits_[0] |= 0x80000000u; +} +void V0LayerParameter::clear_has_new_num() { + _has_bits_[0] &= ~0x80000000u; +} +void V0LayerParameter::clear_new_num() { + new_num_ = 0; + clear_has_new_num(); +} +::google::protobuf::int32 V0LayerParameter::new_num() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_num) + return new_num_; +} +void V0LayerParameter::set_new_num(::google::protobuf::int32 value) { + set_has_new_num(); + new_num_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_num) +} + +// optional int32 new_channels = 61 [default = 0]; +bool V0LayerParameter::has_new_channels() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +void V0LayerParameter::set_has_new_channels() { + _has_bits_[1] |= 0x00000001u; +} +void V0LayerParameter::clear_has_new_channels() { + _has_bits_[1] &= ~0x00000001u; +} +void V0LayerParameter::clear_new_channels() { + new_channels_ = 0; + clear_has_new_channels(); +} +::google::protobuf::int32 V0LayerParameter::new_channels() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_channels) + return new_channels_; +} +void V0LayerParameter::set_new_channels(::google::protobuf::int32 value) { + set_has_new_channels(); + new_channels_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_channels) +} + +// optional int32 new_height = 62 [default = 0]; +bool V0LayerParameter::has_new_height() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +void V0LayerParameter::set_has_new_height() { + _has_bits_[1] |= 0x00000002u; +} +void V0LayerParameter::clear_has_new_height() { + _has_bits_[1] &= ~0x00000002u; +} +void V0LayerParameter::clear_new_height() { + new_height_ = 0; + clear_has_new_height(); +} +::google::protobuf::int32 V0LayerParameter::new_height() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_height) + return new_height_; +} +void V0LayerParameter::set_new_height(::google::protobuf::int32 value) { + set_has_new_height(); + new_height_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_height) +} + +// optional int32 new_width = 63 [default = 0]; +bool V0LayerParameter::has_new_width() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +void V0LayerParameter::set_has_new_width() { + _has_bits_[1] |= 0x00000004u; +} +void V0LayerParameter::clear_has_new_width() { + _has_bits_[1] &= ~0x00000004u; +} +void V0LayerParameter::clear_new_width() { + new_width_ = 0; + clear_has_new_width(); +} +::google::protobuf::int32 V0LayerParameter::new_width() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_width) + return new_width_; +} +void V0LayerParameter::set_new_width(::google::protobuf::int32 value) { + set_has_new_width(); + new_width_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_width) +} + +// optional bool shuffle_images = 64 [default = false]; +bool V0LayerParameter::has_shuffle_images() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +void V0LayerParameter::set_has_shuffle_images() { + _has_bits_[1] |= 0x00000008u; +} +void V0LayerParameter::clear_has_shuffle_images() { + _has_bits_[1] &= ~0x00000008u; +} +void V0LayerParameter::clear_shuffle_images() { + shuffle_images_ = false; + clear_has_shuffle_images(); +} +bool V0LayerParameter::shuffle_images() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.shuffle_images) + return shuffle_images_; +} +void V0LayerParameter::set_shuffle_images(bool value) { + set_has_shuffle_images(); + shuffle_images_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.shuffle_images) +} + +// optional uint32 concat_dim = 65 [default = 1]; +bool V0LayerParameter::has_concat_dim() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +void V0LayerParameter::set_has_concat_dim() { + _has_bits_[1] |= 0x00000010u; +} +void V0LayerParameter::clear_has_concat_dim() { + _has_bits_[1] &= ~0x00000010u; +} +void V0LayerParameter::clear_concat_dim() { + concat_dim_ = 1u; + clear_has_concat_dim(); +} +::google::protobuf::uint32 V0LayerParameter::concat_dim() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.concat_dim) + return concat_dim_; +} +void V0LayerParameter::set_concat_dim(::google::protobuf::uint32 value) { + set_has_concat_dim(); + concat_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.concat_dim) +} + +// optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; +bool V0LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +void V0LayerParameter::set_has_hdf5_output_param() { + _has_bits_[1] |= 0x00000020u; +} +void V0LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[1] &= ~0x00000020u; +} +void V0LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::caffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ + : *::caffe::HDF5OutputParameter::internal_default_instance(); +} +::caffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::caffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::caffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::caffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param) { + delete hdf5_output_param_; + hdf5_output_param_ = hdf5_output_param; + if (hdf5_output_param) { + set_has_hdf5_output_param(); + } else { + clear_has_hdf5_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.hdf5_output_param) +} + +inline const V0LayerParameter* V0LayerParameter::internal_default_instance() { + return &V0LayerParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int PReLUParameter::kFillerFieldNumber; +const int PReLUParameter::kChannelSharedFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PReLUParameter::PReLUParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.PReLUParameter) +} + +void PReLUParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::caffe::FillerParameter*>( + ::caffe::FillerParameter::internal_default_instance()); +} + +PReLUParameter::PReLUParameter(const PReLUParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.PReLUParameter) +} + +void PReLUParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + channel_shared_ = false; +} + +PReLUParameter::~PReLUParameter() { + // @@protoc_insertion_point(destructor:caffe.PReLUParameter) + SharedDtor(); +} + +void PReLUParameter::SharedDtor() { + if (this != &PReLUParameter_default_instance_.get()) { + delete filler_; + } +} + +void PReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PReLUParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PReLUParameter_descriptor_; +} + +const PReLUParameter& PReLUParameter::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed PReLUParameter_default_instance_; + +PReLUParameter* PReLUParameter::New(::google::protobuf::Arena* arena) const { + PReLUParameter* n = new PReLUParameter; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void PReLUParameter::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.PReLUParameter) + if (_has_bits_[0 / 32] & 3u) { + if (has_filler()) { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + } + channel_shared_ = false; + } + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool PReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.PReLUParameter) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.FillerParameter filler = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_channel_shared; + break; + } + + // optional bool channel_shared = 2 [default = false]; + case 2: { + if (tag == 16) { + parse_channel_shared: + set_has_channel_shared(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.PReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.PReLUParameter) + return false; +#undef DO_ +} + +void PReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.PReLUParameter) + // optional .caffe.FillerParameter filler = 1; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *this->filler_, output); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->channel_shared(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.PReLUParameter) +} + +::google::protobuf::uint8* PReLUParameter::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.PReLUParameter) + // optional .caffe.FillerParameter filler = 1; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *this->filler_, false, target); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->channel_shared(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.PReLUParameter) + return target; +} + +size_t PReLUParameter::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.PReLUParameter) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .caffe.FillerParameter filler = 1; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->filler_); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.PReLUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const PReLUParameter* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.PReLUParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.PReLUParameter) + UnsafeMergeFrom(*source); + } +} + +void PReLUParameter::MergeFrom(const PReLUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.PReLUParameter) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void PReLUParameter::UnsafeMergeFrom(const PReLUParameter& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_filler()) { + mutable_filler()->::caffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void PReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.PReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PReLUParameter::CopyFrom(const PReLUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.PReLUParameter) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool PReLUParameter::IsInitialized() const { + + return true; +} + +void PReLUParameter::Swap(PReLUParameter* other) { + if (other == this) return; + InternalSwap(other); +} +void PReLUParameter::InternalSwap(PReLUParameter* other) { + std::swap(filler_, other->filler_); + std::swap(channel_shared_, other->channel_shared_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata PReLUParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PReLUParameter_descriptor_; + metadata.reflection = PReLUParameter_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PReLUParameter + +// optional .caffe.FillerParameter filler = 1; +bool PReLUParameter::has_filler() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void PReLUParameter::set_has_filler() { + _has_bits_[0] |= 0x00000001u; +} +void PReLUParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000001u; +} +void PReLUParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::caffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:caffe.PReLUParameter.filler) + return filler_ != NULL ? *filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +::caffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.PReLUParameter.filler) + return filler_; +} +::caffe::FillerParameter* PReLUParameter::release_filler() { + // @@protoc_insertion_point(field_release:caffe.PReLUParameter.filler) + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void PReLUParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.PReLUParameter.filler) +} + +// optional bool channel_shared = 2 [default = false]; +bool PReLUParameter::has_channel_shared() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void PReLUParameter::set_has_channel_shared() { + _has_bits_[0] |= 0x00000002u; +} +void PReLUParameter::clear_has_channel_shared() { + _has_bits_[0] &= ~0x00000002u; +} +void PReLUParameter::clear_channel_shared() { + channel_shared_ = false; + clear_has_channel_shared(); +} +bool PReLUParameter::channel_shared() const { + // @@protoc_insertion_point(field_get:caffe.PReLUParameter.channel_shared) + return channel_shared_; +} +void PReLUParameter::set_channel_shared(bool value) { + set_has_channel_shared(); + channel_shared_ = value; + // @@protoc_insertion_point(field_set:caffe.PReLUParameter.channel_shared) +} + +inline const PReLUParameter* PReLUParameter::internal_default_instance() { + return &PReLUParameter_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NormalizedBBox::kXminFieldNumber; +const int NormalizedBBox::kYminFieldNumber; +const int NormalizedBBox::kXmaxFieldNumber; +const int NormalizedBBox::kYmaxFieldNumber; +const int NormalizedBBox::kLabelFieldNumber; +const int NormalizedBBox::kDifficultFieldNumber; +const int NormalizedBBox::kScoreFieldNumber; +const int NormalizedBBox::kSizeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NormalizedBBox::NormalizedBBox() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_caffe_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:caffe.NormalizedBBox) +} + +void NormalizedBBox::InitAsDefaultInstance() { +} + +NormalizedBBox::NormalizedBBox(const NormalizedBBox& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:caffe.NormalizedBBox) +} + +void NormalizedBBox::SharedCtor() { + _cached_size_ = 0; + ::memset(&xmin_, 0, reinterpret_cast(&size_) - + reinterpret_cast(&xmin_) + sizeof(size_)); +} + +NormalizedBBox::~NormalizedBBox() { + // @@protoc_insertion_point(destructor:caffe.NormalizedBBox) + SharedDtor(); +} + +void NormalizedBBox::SharedDtor() { +} + +void NormalizedBBox::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NormalizedBBox::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NormalizedBBox_descriptor_; +} + +const NormalizedBBox& NormalizedBBox::default_instance() { + protobuf_InitDefaults_caffe_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NormalizedBBox_default_instance_; + +NormalizedBBox* NormalizedBBox::New(::google::protobuf::Arena* arena) const { + NormalizedBBox* n = new NormalizedBBox; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void NormalizedBBox::Clear() { +// @@protoc_insertion_point(message_clear_start:caffe.NormalizedBBox) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(NormalizedBBox, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(xmin_, size_); + +#undef ZR_HELPER_ +#undef ZR_ + + _has_bits_.Clear(); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool NormalizedBBox::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:caffe.NormalizedBBox) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional float xmin = 1; + case 1: { + if (tag == 13) { + set_has_xmin(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &xmin_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_ymin; + break; + } + + // optional float ymin = 2; + case 2: { + if (tag == 21) { + parse_ymin: + set_has_ymin(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &ymin_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(29)) goto parse_xmax; + break; + } + + // optional float xmax = 3; + case 3: { + if (tag == 29) { + parse_xmax: + set_has_xmax(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &xmax_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(37)) goto parse_ymax; + break; + } + + // optional float ymax = 4; + case 4: { + if (tag == 37) { + parse_ymax: + set_has_ymax(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &ymax_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_label; + break; + } + + // optional int32 label = 5; + case 5: { + if (tag == 40) { + parse_label: + set_has_label(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &label_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_difficult; + break; + } + + // optional bool difficult = 6; + case 6: { + if (tag == 48) { + parse_difficult: + set_has_difficult(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &difficult_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(61)) goto parse_score; + break; + } + + // optional float score = 7; + case 7: { + if (tag == 61) { + parse_score: + set_has_score(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &score_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(69)) goto parse_size; + break; + } + + // optional float size = 8; + case 8: { + if (tag == 69) { + parse_size: + set_has_size(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &size_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:caffe.NormalizedBBox) + return true; +failure: + // @@protoc_insertion_point(parse_failure:caffe.NormalizedBBox) + return false; +#undef DO_ +} + +void NormalizedBBox::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:caffe.NormalizedBBox) + // optional float xmin = 1; + if (has_xmin()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->xmin(), output); + } + + // optional float ymin = 2; + if (has_ymin()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->ymin(), output); + } + + // optional float xmax = 3; + if (has_xmax()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->xmax(), output); + } + + // optional float ymax = 4; + if (has_ymax()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->ymax(), output); + } + + // optional int32 label = 5; + if (has_label()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->label(), output); + } + + // optional bool difficult = 6; + if (has_difficult()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->difficult(), output); + } + + // optional float score = 7; + if (has_score()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->score(), output); + } + + // optional float size = 8; + if (has_size()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->size(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:caffe.NormalizedBBox) +} + +::google::protobuf::uint8* NormalizedBBox::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:caffe.NormalizedBBox) + // optional float xmin = 1; + if (has_xmin()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->xmin(), target); + } + + // optional float ymin = 2; + if (has_ymin()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->ymin(), target); + } + + // optional float xmax = 3; + if (has_xmax()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->xmax(), target); + } + + // optional float ymax = 4; + if (has_ymax()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->ymax(), target); + } + + // optional int32 label = 5; + if (has_label()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->label(), target); + } + + // optional bool difficult = 6; + if (has_difficult()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->difficult(), target); + } + + // optional float score = 7; + if (has_score()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->score(), target); + } + + // optional float size = 8; + if (has_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->size(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:caffe.NormalizedBBox) + return target; +} + +size_t NormalizedBBox::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:caffe.NormalizedBBox) + size_t total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional float xmin = 1; + if (has_xmin()) { + total_size += 1 + 4; + } + + // optional float ymin = 2; + if (has_ymin()) { + total_size += 1 + 4; + } + + // optional float xmax = 3; + if (has_xmax()) { + total_size += 1 + 4; + } + + // optional float ymax = 4; + if (has_ymax()) { + total_size += 1 + 4; + } + + // optional int32 label = 5; + if (has_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->label()); + } + + // optional bool difficult = 6; + if (has_difficult()) { + total_size += 1 + 1; + } + + // optional float score = 7; + if (has_score()) { + total_size += 1 + 4; + } + + // optional float size = 8; + if (has_size()) { + total_size += 1 + 4; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NormalizedBBox::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:caffe.NormalizedBBox) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NormalizedBBox* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe.NormalizedBBox) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe.NormalizedBBox) + UnsafeMergeFrom(*source); + } +} + +void NormalizedBBox::MergeFrom(const NormalizedBBox& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:caffe.NormalizedBBox) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NormalizedBBox::UnsafeMergeFrom(const NormalizedBBox& from) { + GOOGLE_DCHECK(&from != this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_xmin()) { + set_xmin(from.xmin()); + } + if (from.has_ymin()) { + set_ymin(from.ymin()); + } + if (from.has_xmax()) { + set_xmax(from.xmax()); + } + if (from.has_ymax()) { + set_ymax(from.ymax()); + } + if (from.has_label()) { + set_label(from.label()); + } + if (from.has_difficult()) { + set_difficult(from.difficult()); + } + if (from.has_score()) { + set_score(from.score()); + } + if (from.has_size()) { + set_size(from.size()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + ::google::protobuf::UnknownFieldSet::MergeToInternalMetdata( + from.unknown_fields(), &_internal_metadata_); + } +} + +void NormalizedBBox::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:caffe.NormalizedBBox) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NormalizedBBox::CopyFrom(const NormalizedBBox& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:caffe.NormalizedBBox) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NormalizedBBox::IsInitialized() const { + + return true; +} + +void NormalizedBBox::Swap(NormalizedBBox* other) { + if (other == this) return; + InternalSwap(other); +} +void NormalizedBBox::InternalSwap(NormalizedBBox* other) { + std::swap(xmin_, other->xmin_); + std::swap(ymin_, other->ymin_); + std::swap(xmax_, other->xmax_); + std::swap(ymax_, other->ymax_); + std::swap(label_, other->label_); + std::swap(difficult_, other->difficult_); + std::swap(score_, other->score_); + std::swap(size_, other->size_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NormalizedBBox::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NormalizedBBox_descriptor_; + metadata.reflection = NormalizedBBox_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NormalizedBBox + +// optional float xmin = 1; +bool NormalizedBBox::has_xmin() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void NormalizedBBox::set_has_xmin() { + _has_bits_[0] |= 0x00000001u; +} +void NormalizedBBox::clear_has_xmin() { + _has_bits_[0] &= ~0x00000001u; +} +void NormalizedBBox::clear_xmin() { + xmin_ = 0; + clear_has_xmin(); +} +float NormalizedBBox::xmin() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.xmin) + return xmin_; +} +void NormalizedBBox::set_xmin(float value) { + set_has_xmin(); + xmin_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.xmin) +} + +// optional float ymin = 2; +bool NormalizedBBox::has_ymin() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void NormalizedBBox::set_has_ymin() { + _has_bits_[0] |= 0x00000002u; +} +void NormalizedBBox::clear_has_ymin() { + _has_bits_[0] &= ~0x00000002u; +} +void NormalizedBBox::clear_ymin() { + ymin_ = 0; + clear_has_ymin(); +} +float NormalizedBBox::ymin() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.ymin) + return ymin_; +} +void NormalizedBBox::set_ymin(float value) { + set_has_ymin(); + ymin_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.ymin) +} + +// optional float xmax = 3; +bool NormalizedBBox::has_xmax() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void NormalizedBBox::set_has_xmax() { + _has_bits_[0] |= 0x00000004u; +} +void NormalizedBBox::clear_has_xmax() { + _has_bits_[0] &= ~0x00000004u; +} +void NormalizedBBox::clear_xmax() { + xmax_ = 0; + clear_has_xmax(); +} +float NormalizedBBox::xmax() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.xmax) + return xmax_; +} +void NormalizedBBox::set_xmax(float value) { + set_has_xmax(); + xmax_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.xmax) +} + +// optional float ymax = 4; +bool NormalizedBBox::has_ymax() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void NormalizedBBox::set_has_ymax() { + _has_bits_[0] |= 0x00000008u; +} +void NormalizedBBox::clear_has_ymax() { + _has_bits_[0] &= ~0x00000008u; +} +void NormalizedBBox::clear_ymax() { + ymax_ = 0; + clear_has_ymax(); +} +float NormalizedBBox::ymax() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.ymax) + return ymax_; +} +void NormalizedBBox::set_ymax(float value) { + set_has_ymax(); + ymax_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.ymax) +} + +// optional int32 label = 5; +bool NormalizedBBox::has_label() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void NormalizedBBox::set_has_label() { + _has_bits_[0] |= 0x00000010u; +} +void NormalizedBBox::clear_has_label() { + _has_bits_[0] &= ~0x00000010u; +} +void NormalizedBBox::clear_label() { + label_ = 0; + clear_has_label(); +} +::google::protobuf::int32 NormalizedBBox::label() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.label) + return label_; +} +void NormalizedBBox::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.label) +} + +// optional bool difficult = 6; +bool NormalizedBBox::has_difficult() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void NormalizedBBox::set_has_difficult() { + _has_bits_[0] |= 0x00000020u; +} +void NormalizedBBox::clear_has_difficult() { + _has_bits_[0] &= ~0x00000020u; +} +void NormalizedBBox::clear_difficult() { + difficult_ = false; + clear_has_difficult(); +} +bool NormalizedBBox::difficult() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.difficult) + return difficult_; +} +void NormalizedBBox::set_difficult(bool value) { + set_has_difficult(); + difficult_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.difficult) +} + +// optional float score = 7; +bool NormalizedBBox::has_score() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void NormalizedBBox::set_has_score() { + _has_bits_[0] |= 0x00000040u; +} +void NormalizedBBox::clear_has_score() { + _has_bits_[0] &= ~0x00000040u; +} +void NormalizedBBox::clear_score() { + score_ = 0; + clear_has_score(); +} +float NormalizedBBox::score() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.score) + return score_; +} +void NormalizedBBox::set_score(float value) { + set_has_score(); + score_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.score) +} + +// optional float size = 8; +bool NormalizedBBox::has_size() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void NormalizedBBox::set_has_size() { + _has_bits_[0] |= 0x00000080u; +} +void NormalizedBBox::clear_has_size() { + _has_bits_[0] &= ~0x00000080u; +} +void NormalizedBBox::clear_size() { + size_ = 0; + clear_has_size(); +} +float NormalizedBBox::size() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.size) + return size_; +} +void NormalizedBBox::set_size(float value) { + set_has_size(); + size_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.size) +} + +inline const NormalizedBBox* NormalizedBBox::internal_default_instance() { + return &NormalizedBBox_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace caffe + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/caffe/caffe.pb.h b/modules/dnn/misc/caffe/caffe.pb.h new file mode 100644 index 0000000000..e2fe0832c1 --- /dev/null +++ b/modules/dnn/misc/caffe/caffe.pb.h @@ -0,0 +1,28612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: caffe.proto + +#ifndef PROTOBUF_caffe_2eproto__INCLUDED +#define PROTOBUF_caffe_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace caffe { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_caffe_2eproto(); +void protobuf_InitDefaults_caffe_2eproto(); +void protobuf_AssignDesc_caffe_2eproto(); +void protobuf_ShutdownFile_caffe_2eproto(); + +class AccuracyParameter; +class ArgMaxParameter; +class BatchNormParameter; +class BiasParameter; +class BlobProto; +class BlobProtoVector; +class BlobShape; +class ConcatParameter; +class ContrastiveLossParameter; +class ConvolutionParameter; +class CropParameter; +class DataParameter; +class Datum; +class DetectionOutputParameter; +class DropoutParameter; +class DummyDataParameter; +class ELUParameter; +class EltwiseParameter; +class EmbedParameter; +class ExpParameter; +class FillerParameter; +class FlattenParameter; +class HDF5DataParameter; +class HDF5OutputParameter; +class HingeLossParameter; +class ImageDataParameter; +class InfogainLossParameter; +class InnerProductParameter; +class InputParameter; +class LRNParameter; +class LayerParameter; +class LogParameter; +class LossParameter; +class MVNParameter; +class MemoryDataParameter; +class NetParameter; +class NetState; +class NetStateRule; +class NonMaximumSuppressionParameter; +class NormalizeBBoxParameter; +class NormalizedBBox; +class PReLUParameter; +class ParamSpec; +class ParameterParameter; +class PermuteParameter; +class PoolingParameter; +class PowerParameter; +class PriorBoxParameter; +class PythonParameter; +class ReLUParameter; +class RecurrentParameter; +class ReductionParameter; +class ReshapeParameter; +class SPPParameter; +class SaveOutputParameter; +class ScaleParameter; +class SigmoidParameter; +class SliceParameter; +class SoftmaxParameter; +class SolverParameter; +class SolverState; +class TanHParameter; +class ThresholdParameter; +class TileParameter; +class TransformationParameter; +class V0LayerParameter; +class V1LayerParameter; +class WindowDataParameter; + +enum PriorBoxParameter_CodeType { + PriorBoxParameter_CodeType_CORNER = 1, + PriorBoxParameter_CodeType_CENTER_SIZE = 2 +}; +bool PriorBoxParameter_CodeType_IsValid(int value); +const PriorBoxParameter_CodeType PriorBoxParameter_CodeType_CodeType_MIN = PriorBoxParameter_CodeType_CORNER; +const PriorBoxParameter_CodeType PriorBoxParameter_CodeType_CodeType_MAX = PriorBoxParameter_CodeType_CENTER_SIZE; +const int PriorBoxParameter_CodeType_CodeType_ARRAYSIZE = PriorBoxParameter_CodeType_CodeType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PriorBoxParameter_CodeType_descriptor(); +inline const ::std::string& PriorBoxParameter_CodeType_Name(PriorBoxParameter_CodeType value) { + return ::google::protobuf::internal::NameOfEnum( + PriorBoxParameter_CodeType_descriptor(), value); +} +inline bool PriorBoxParameter_CodeType_Parse( + const ::std::string& name, PriorBoxParameter_CodeType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PriorBoxParameter_CodeType_descriptor(), name, value); +} +enum FillerParameter_VarianceNorm { + FillerParameter_VarianceNorm_FAN_IN = 0, + FillerParameter_VarianceNorm_FAN_OUT = 1, + FillerParameter_VarianceNorm_AVERAGE = 2 +}; +bool FillerParameter_VarianceNorm_IsValid(int value); +const FillerParameter_VarianceNorm FillerParameter_VarianceNorm_VarianceNorm_MIN = FillerParameter_VarianceNorm_FAN_IN; +const FillerParameter_VarianceNorm FillerParameter_VarianceNorm_VarianceNorm_MAX = FillerParameter_VarianceNorm_AVERAGE; +const int FillerParameter_VarianceNorm_VarianceNorm_ARRAYSIZE = FillerParameter_VarianceNorm_VarianceNorm_MAX + 1; + +const ::google::protobuf::EnumDescriptor* FillerParameter_VarianceNorm_descriptor(); +inline const ::std::string& FillerParameter_VarianceNorm_Name(FillerParameter_VarianceNorm value) { + return ::google::protobuf::internal::NameOfEnum( + FillerParameter_VarianceNorm_descriptor(), value); +} +inline bool FillerParameter_VarianceNorm_Parse( + const ::std::string& name, FillerParameter_VarianceNorm* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FillerParameter_VarianceNorm_descriptor(), name, value); +} +enum SolverParameter_SnapshotFormat { + SolverParameter_SnapshotFormat_HDF5 = 0, + SolverParameter_SnapshotFormat_BINARYPROTO = 1 +}; +bool SolverParameter_SnapshotFormat_IsValid(int value); +const SolverParameter_SnapshotFormat SolverParameter_SnapshotFormat_SnapshotFormat_MIN = SolverParameter_SnapshotFormat_HDF5; +const SolverParameter_SnapshotFormat SolverParameter_SnapshotFormat_SnapshotFormat_MAX = SolverParameter_SnapshotFormat_BINARYPROTO; +const int SolverParameter_SnapshotFormat_SnapshotFormat_ARRAYSIZE = SolverParameter_SnapshotFormat_SnapshotFormat_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SolverParameter_SnapshotFormat_descriptor(); +inline const ::std::string& SolverParameter_SnapshotFormat_Name(SolverParameter_SnapshotFormat value) { + return ::google::protobuf::internal::NameOfEnum( + SolverParameter_SnapshotFormat_descriptor(), value); +} +inline bool SolverParameter_SnapshotFormat_Parse( + const ::std::string& name, SolverParameter_SnapshotFormat* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SolverParameter_SnapshotFormat_descriptor(), name, value); +} +enum SolverParameter_SolverMode { + SolverParameter_SolverMode_CPU = 0, + SolverParameter_SolverMode_GPU = 1 +}; +bool SolverParameter_SolverMode_IsValid(int value); +const SolverParameter_SolverMode SolverParameter_SolverMode_SolverMode_MIN = SolverParameter_SolverMode_CPU; +const SolverParameter_SolverMode SolverParameter_SolverMode_SolverMode_MAX = SolverParameter_SolverMode_GPU; +const int SolverParameter_SolverMode_SolverMode_ARRAYSIZE = SolverParameter_SolverMode_SolverMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SolverParameter_SolverMode_descriptor(); +inline const ::std::string& SolverParameter_SolverMode_Name(SolverParameter_SolverMode value) { + return ::google::protobuf::internal::NameOfEnum( + SolverParameter_SolverMode_descriptor(), value); +} +inline bool SolverParameter_SolverMode_Parse( + const ::std::string& name, SolverParameter_SolverMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SolverParameter_SolverMode_descriptor(), name, value); +} +enum SolverParameter_SolverType { + SolverParameter_SolverType_SGD = 0, + SolverParameter_SolverType_NESTEROV = 1, + SolverParameter_SolverType_ADAGRAD = 2, + SolverParameter_SolverType_RMSPROP = 3, + SolverParameter_SolverType_ADADELTA = 4, + SolverParameter_SolverType_ADAM = 5 +}; +bool SolverParameter_SolverType_IsValid(int value); +const SolverParameter_SolverType SolverParameter_SolverType_SolverType_MIN = SolverParameter_SolverType_SGD; +const SolverParameter_SolverType SolverParameter_SolverType_SolverType_MAX = SolverParameter_SolverType_ADAM; +const int SolverParameter_SolverType_SolverType_ARRAYSIZE = SolverParameter_SolverType_SolverType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SolverParameter_SolverType_descriptor(); +inline const ::std::string& SolverParameter_SolverType_Name(SolverParameter_SolverType value) { + return ::google::protobuf::internal::NameOfEnum( + SolverParameter_SolverType_descriptor(), value); +} +inline bool SolverParameter_SolverType_Parse( + const ::std::string& name, SolverParameter_SolverType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SolverParameter_SolverType_descriptor(), name, value); +} +enum ParamSpec_DimCheckMode { + ParamSpec_DimCheckMode_STRICT = 0, + ParamSpec_DimCheckMode_PERMISSIVE = 1 +}; +bool ParamSpec_DimCheckMode_IsValid(int value); +const ParamSpec_DimCheckMode ParamSpec_DimCheckMode_DimCheckMode_MIN = ParamSpec_DimCheckMode_STRICT; +const ParamSpec_DimCheckMode ParamSpec_DimCheckMode_DimCheckMode_MAX = ParamSpec_DimCheckMode_PERMISSIVE; +const int ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE = ParamSpec_DimCheckMode_DimCheckMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ParamSpec_DimCheckMode_descriptor(); +inline const ::std::string& ParamSpec_DimCheckMode_Name(ParamSpec_DimCheckMode value) { + return ::google::protobuf::internal::NameOfEnum( + ParamSpec_DimCheckMode_descriptor(), value); +} +inline bool ParamSpec_DimCheckMode_Parse( + const ::std::string& name, ParamSpec_DimCheckMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ParamSpec_DimCheckMode_descriptor(), name, value); +} +enum LossParameter_NormalizationMode { + LossParameter_NormalizationMode_FULL = 0, + LossParameter_NormalizationMode_VALID = 1, + LossParameter_NormalizationMode_BATCH_SIZE = 2, + LossParameter_NormalizationMode_NONE = 3 +}; +bool LossParameter_NormalizationMode_IsValid(int value); +const LossParameter_NormalizationMode LossParameter_NormalizationMode_NormalizationMode_MIN = LossParameter_NormalizationMode_FULL; +const LossParameter_NormalizationMode LossParameter_NormalizationMode_NormalizationMode_MAX = LossParameter_NormalizationMode_NONE; +const int LossParameter_NormalizationMode_NormalizationMode_ARRAYSIZE = LossParameter_NormalizationMode_NormalizationMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LossParameter_NormalizationMode_descriptor(); +inline const ::std::string& LossParameter_NormalizationMode_Name(LossParameter_NormalizationMode value) { + return ::google::protobuf::internal::NameOfEnum( + LossParameter_NormalizationMode_descriptor(), value); +} +inline bool LossParameter_NormalizationMode_Parse( + const ::std::string& name, LossParameter_NormalizationMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LossParameter_NormalizationMode_descriptor(), name, value); +} +enum ConvolutionParameter_Engine { + ConvolutionParameter_Engine_DEFAULT = 0, + ConvolutionParameter_Engine_CAFFE = 1, + ConvolutionParameter_Engine_CUDNN = 2 +}; +bool ConvolutionParameter_Engine_IsValid(int value); +const ConvolutionParameter_Engine ConvolutionParameter_Engine_Engine_MIN = ConvolutionParameter_Engine_DEFAULT; +const ConvolutionParameter_Engine ConvolutionParameter_Engine_Engine_MAX = ConvolutionParameter_Engine_CUDNN; +const int ConvolutionParameter_Engine_Engine_ARRAYSIZE = ConvolutionParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ConvolutionParameter_Engine_descriptor(); +inline const ::std::string& ConvolutionParameter_Engine_Name(ConvolutionParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + ConvolutionParameter_Engine_descriptor(), value); +} +inline bool ConvolutionParameter_Engine_Parse( + const ::std::string& name, ConvolutionParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ConvolutionParameter_Engine_descriptor(), name, value); +} +enum DataParameter_DB { + DataParameter_DB_LEVELDB = 0, + DataParameter_DB_LMDB = 1 +}; +bool DataParameter_DB_IsValid(int value); +const DataParameter_DB DataParameter_DB_DB_MIN = DataParameter_DB_LEVELDB; +const DataParameter_DB DataParameter_DB_DB_MAX = DataParameter_DB_LMDB; +const int DataParameter_DB_DB_ARRAYSIZE = DataParameter_DB_DB_MAX + 1; + +const ::google::protobuf::EnumDescriptor* DataParameter_DB_descriptor(); +inline const ::std::string& DataParameter_DB_Name(DataParameter_DB value) { + return ::google::protobuf::internal::NameOfEnum( + DataParameter_DB_descriptor(), value); +} +inline bool DataParameter_DB_Parse( + const ::std::string& name, DataParameter_DB* value) { + return ::google::protobuf::internal::ParseNamedEnum( + DataParameter_DB_descriptor(), name, value); +} +enum EltwiseParameter_EltwiseOp { + EltwiseParameter_EltwiseOp_PROD = 0, + EltwiseParameter_EltwiseOp_SUM = 1, + EltwiseParameter_EltwiseOp_MAX = 2 +}; +bool EltwiseParameter_EltwiseOp_IsValid(int value); +const EltwiseParameter_EltwiseOp EltwiseParameter_EltwiseOp_EltwiseOp_MIN = EltwiseParameter_EltwiseOp_PROD; +const EltwiseParameter_EltwiseOp EltwiseParameter_EltwiseOp_EltwiseOp_MAX = EltwiseParameter_EltwiseOp_MAX; +const int EltwiseParameter_EltwiseOp_EltwiseOp_ARRAYSIZE = EltwiseParameter_EltwiseOp_EltwiseOp_MAX + 1; + +const ::google::protobuf::EnumDescriptor* EltwiseParameter_EltwiseOp_descriptor(); +inline const ::std::string& EltwiseParameter_EltwiseOp_Name(EltwiseParameter_EltwiseOp value) { + return ::google::protobuf::internal::NameOfEnum( + EltwiseParameter_EltwiseOp_descriptor(), value); +} +inline bool EltwiseParameter_EltwiseOp_Parse( + const ::std::string& name, EltwiseParameter_EltwiseOp* value) { + return ::google::protobuf::internal::ParseNamedEnum( + EltwiseParameter_EltwiseOp_descriptor(), name, value); +} +enum HingeLossParameter_Norm { + HingeLossParameter_Norm_L1 = 1, + HingeLossParameter_Norm_L2 = 2 +}; +bool HingeLossParameter_Norm_IsValid(int value); +const HingeLossParameter_Norm HingeLossParameter_Norm_Norm_MIN = HingeLossParameter_Norm_L1; +const HingeLossParameter_Norm HingeLossParameter_Norm_Norm_MAX = HingeLossParameter_Norm_L2; +const int HingeLossParameter_Norm_Norm_ARRAYSIZE = HingeLossParameter_Norm_Norm_MAX + 1; + +const ::google::protobuf::EnumDescriptor* HingeLossParameter_Norm_descriptor(); +inline const ::std::string& HingeLossParameter_Norm_Name(HingeLossParameter_Norm value) { + return ::google::protobuf::internal::NameOfEnum( + HingeLossParameter_Norm_descriptor(), value); +} +inline bool HingeLossParameter_Norm_Parse( + const ::std::string& name, HingeLossParameter_Norm* value) { + return ::google::protobuf::internal::ParseNamedEnum( + HingeLossParameter_Norm_descriptor(), name, value); +} +enum LRNParameter_NormRegion { + LRNParameter_NormRegion_ACROSS_CHANNELS = 0, + LRNParameter_NormRegion_WITHIN_CHANNEL = 1 +}; +bool LRNParameter_NormRegion_IsValid(int value); +const LRNParameter_NormRegion LRNParameter_NormRegion_NormRegion_MIN = LRNParameter_NormRegion_ACROSS_CHANNELS; +const LRNParameter_NormRegion LRNParameter_NormRegion_NormRegion_MAX = LRNParameter_NormRegion_WITHIN_CHANNEL; +const int LRNParameter_NormRegion_NormRegion_ARRAYSIZE = LRNParameter_NormRegion_NormRegion_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LRNParameter_NormRegion_descriptor(); +inline const ::std::string& LRNParameter_NormRegion_Name(LRNParameter_NormRegion value) { + return ::google::protobuf::internal::NameOfEnum( + LRNParameter_NormRegion_descriptor(), value); +} +inline bool LRNParameter_NormRegion_Parse( + const ::std::string& name, LRNParameter_NormRegion* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LRNParameter_NormRegion_descriptor(), name, value); +} +enum LRNParameter_Engine { + LRNParameter_Engine_DEFAULT = 0, + LRNParameter_Engine_CAFFE = 1, + LRNParameter_Engine_CUDNN = 2 +}; +bool LRNParameter_Engine_IsValid(int value); +const LRNParameter_Engine LRNParameter_Engine_Engine_MIN = LRNParameter_Engine_DEFAULT; +const LRNParameter_Engine LRNParameter_Engine_Engine_MAX = LRNParameter_Engine_CUDNN; +const int LRNParameter_Engine_Engine_ARRAYSIZE = LRNParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LRNParameter_Engine_descriptor(); +inline const ::std::string& LRNParameter_Engine_Name(LRNParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + LRNParameter_Engine_descriptor(), value); +} +inline bool LRNParameter_Engine_Parse( + const ::std::string& name, LRNParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LRNParameter_Engine_descriptor(), name, value); +} +enum PoolingParameter_PoolMethod { + PoolingParameter_PoolMethod_MAX = 0, + PoolingParameter_PoolMethod_AVE = 1, + PoolingParameter_PoolMethod_STOCHASTIC = 2 +}; +bool PoolingParameter_PoolMethod_IsValid(int value); +const PoolingParameter_PoolMethod PoolingParameter_PoolMethod_PoolMethod_MIN = PoolingParameter_PoolMethod_MAX; +const PoolingParameter_PoolMethod PoolingParameter_PoolMethod_PoolMethod_MAX = PoolingParameter_PoolMethod_STOCHASTIC; +const int PoolingParameter_PoolMethod_PoolMethod_ARRAYSIZE = PoolingParameter_PoolMethod_PoolMethod_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PoolingParameter_PoolMethod_descriptor(); +inline const ::std::string& PoolingParameter_PoolMethod_Name(PoolingParameter_PoolMethod value) { + return ::google::protobuf::internal::NameOfEnum( + PoolingParameter_PoolMethod_descriptor(), value); +} +inline bool PoolingParameter_PoolMethod_Parse( + const ::std::string& name, PoolingParameter_PoolMethod* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PoolingParameter_PoolMethod_descriptor(), name, value); +} +enum PoolingParameter_Engine { + PoolingParameter_Engine_DEFAULT = 0, + PoolingParameter_Engine_CAFFE = 1, + PoolingParameter_Engine_CUDNN = 2 +}; +bool PoolingParameter_Engine_IsValid(int value); +const PoolingParameter_Engine PoolingParameter_Engine_Engine_MIN = PoolingParameter_Engine_DEFAULT; +const PoolingParameter_Engine PoolingParameter_Engine_Engine_MAX = PoolingParameter_Engine_CUDNN; +const int PoolingParameter_Engine_Engine_ARRAYSIZE = PoolingParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PoolingParameter_Engine_descriptor(); +inline const ::std::string& PoolingParameter_Engine_Name(PoolingParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + PoolingParameter_Engine_descriptor(), value); +} +inline bool PoolingParameter_Engine_Parse( + const ::std::string& name, PoolingParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PoolingParameter_Engine_descriptor(), name, value); +} +enum ReductionParameter_ReductionOp { + ReductionParameter_ReductionOp_SUM = 1, + ReductionParameter_ReductionOp_ASUM = 2, + ReductionParameter_ReductionOp_SUMSQ = 3, + ReductionParameter_ReductionOp_MEAN = 4 +}; +bool ReductionParameter_ReductionOp_IsValid(int value); +const ReductionParameter_ReductionOp ReductionParameter_ReductionOp_ReductionOp_MIN = ReductionParameter_ReductionOp_SUM; +const ReductionParameter_ReductionOp ReductionParameter_ReductionOp_ReductionOp_MAX = ReductionParameter_ReductionOp_MEAN; +const int ReductionParameter_ReductionOp_ReductionOp_ARRAYSIZE = ReductionParameter_ReductionOp_ReductionOp_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ReductionParameter_ReductionOp_descriptor(); +inline const ::std::string& ReductionParameter_ReductionOp_Name(ReductionParameter_ReductionOp value) { + return ::google::protobuf::internal::NameOfEnum( + ReductionParameter_ReductionOp_descriptor(), value); +} +inline bool ReductionParameter_ReductionOp_Parse( + const ::std::string& name, ReductionParameter_ReductionOp* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ReductionParameter_ReductionOp_descriptor(), name, value); +} +enum ReLUParameter_Engine { + ReLUParameter_Engine_DEFAULT = 0, + ReLUParameter_Engine_CAFFE = 1, + ReLUParameter_Engine_CUDNN = 2 +}; +bool ReLUParameter_Engine_IsValid(int value); +const ReLUParameter_Engine ReLUParameter_Engine_Engine_MIN = ReLUParameter_Engine_DEFAULT; +const ReLUParameter_Engine ReLUParameter_Engine_Engine_MAX = ReLUParameter_Engine_CUDNN; +const int ReLUParameter_Engine_Engine_ARRAYSIZE = ReLUParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ReLUParameter_Engine_descriptor(); +inline const ::std::string& ReLUParameter_Engine_Name(ReLUParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + ReLUParameter_Engine_descriptor(), value); +} +inline bool ReLUParameter_Engine_Parse( + const ::std::string& name, ReLUParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ReLUParameter_Engine_descriptor(), name, value); +} +enum SigmoidParameter_Engine { + SigmoidParameter_Engine_DEFAULT = 0, + SigmoidParameter_Engine_CAFFE = 1, + SigmoidParameter_Engine_CUDNN = 2 +}; +bool SigmoidParameter_Engine_IsValid(int value); +const SigmoidParameter_Engine SigmoidParameter_Engine_Engine_MIN = SigmoidParameter_Engine_DEFAULT; +const SigmoidParameter_Engine SigmoidParameter_Engine_Engine_MAX = SigmoidParameter_Engine_CUDNN; +const int SigmoidParameter_Engine_Engine_ARRAYSIZE = SigmoidParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SigmoidParameter_Engine_descriptor(); +inline const ::std::string& SigmoidParameter_Engine_Name(SigmoidParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + SigmoidParameter_Engine_descriptor(), value); +} +inline bool SigmoidParameter_Engine_Parse( + const ::std::string& name, SigmoidParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SigmoidParameter_Engine_descriptor(), name, value); +} +enum SoftmaxParameter_Engine { + SoftmaxParameter_Engine_DEFAULT = 0, + SoftmaxParameter_Engine_CAFFE = 1, + SoftmaxParameter_Engine_CUDNN = 2 +}; +bool SoftmaxParameter_Engine_IsValid(int value); +const SoftmaxParameter_Engine SoftmaxParameter_Engine_Engine_MIN = SoftmaxParameter_Engine_DEFAULT; +const SoftmaxParameter_Engine SoftmaxParameter_Engine_Engine_MAX = SoftmaxParameter_Engine_CUDNN; +const int SoftmaxParameter_Engine_Engine_ARRAYSIZE = SoftmaxParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SoftmaxParameter_Engine_descriptor(); +inline const ::std::string& SoftmaxParameter_Engine_Name(SoftmaxParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + SoftmaxParameter_Engine_descriptor(), value); +} +inline bool SoftmaxParameter_Engine_Parse( + const ::std::string& name, SoftmaxParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SoftmaxParameter_Engine_descriptor(), name, value); +} +enum TanHParameter_Engine { + TanHParameter_Engine_DEFAULT = 0, + TanHParameter_Engine_CAFFE = 1, + TanHParameter_Engine_CUDNN = 2 +}; +bool TanHParameter_Engine_IsValid(int value); +const TanHParameter_Engine TanHParameter_Engine_Engine_MIN = TanHParameter_Engine_DEFAULT; +const TanHParameter_Engine TanHParameter_Engine_Engine_MAX = TanHParameter_Engine_CUDNN; +const int TanHParameter_Engine_Engine_ARRAYSIZE = TanHParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* TanHParameter_Engine_descriptor(); +inline const ::std::string& TanHParameter_Engine_Name(TanHParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + TanHParameter_Engine_descriptor(), value); +} +inline bool TanHParameter_Engine_Parse( + const ::std::string& name, TanHParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + TanHParameter_Engine_descriptor(), name, value); +} +enum SPPParameter_PoolMethod { + SPPParameter_PoolMethod_MAX = 0, + SPPParameter_PoolMethod_AVE = 1, + SPPParameter_PoolMethod_STOCHASTIC = 2 +}; +bool SPPParameter_PoolMethod_IsValid(int value); +const SPPParameter_PoolMethod SPPParameter_PoolMethod_PoolMethod_MIN = SPPParameter_PoolMethod_MAX; +const SPPParameter_PoolMethod SPPParameter_PoolMethod_PoolMethod_MAX = SPPParameter_PoolMethod_STOCHASTIC; +const int SPPParameter_PoolMethod_PoolMethod_ARRAYSIZE = SPPParameter_PoolMethod_PoolMethod_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SPPParameter_PoolMethod_descriptor(); +inline const ::std::string& SPPParameter_PoolMethod_Name(SPPParameter_PoolMethod value) { + return ::google::protobuf::internal::NameOfEnum( + SPPParameter_PoolMethod_descriptor(), value); +} +inline bool SPPParameter_PoolMethod_Parse( + const ::std::string& name, SPPParameter_PoolMethod* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SPPParameter_PoolMethod_descriptor(), name, value); +} +enum SPPParameter_Engine { + SPPParameter_Engine_DEFAULT = 0, + SPPParameter_Engine_CAFFE = 1, + SPPParameter_Engine_CUDNN = 2 +}; +bool SPPParameter_Engine_IsValid(int value); +const SPPParameter_Engine SPPParameter_Engine_Engine_MIN = SPPParameter_Engine_DEFAULT; +const SPPParameter_Engine SPPParameter_Engine_Engine_MAX = SPPParameter_Engine_CUDNN; +const int SPPParameter_Engine_Engine_ARRAYSIZE = SPPParameter_Engine_Engine_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SPPParameter_Engine_descriptor(); +inline const ::std::string& SPPParameter_Engine_Name(SPPParameter_Engine value) { + return ::google::protobuf::internal::NameOfEnum( + SPPParameter_Engine_descriptor(), value); +} +inline bool SPPParameter_Engine_Parse( + const ::std::string& name, SPPParameter_Engine* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SPPParameter_Engine_descriptor(), name, value); +} +enum V1LayerParameter_LayerType { + V1LayerParameter_LayerType_NONE = 0, + V1LayerParameter_LayerType_ABSVAL = 35, + V1LayerParameter_LayerType_ACCURACY = 1, + V1LayerParameter_LayerType_ARGMAX = 30, + V1LayerParameter_LayerType_BNLL = 2, + V1LayerParameter_LayerType_CONCAT = 3, + V1LayerParameter_LayerType_CONTRASTIVE_LOSS = 37, + V1LayerParameter_LayerType_CONVOLUTION = 4, + V1LayerParameter_LayerType_DATA = 5, + V1LayerParameter_LayerType_DECONVOLUTION = 39, + V1LayerParameter_LayerType_DROPOUT = 6, + V1LayerParameter_LayerType_DUMMY_DATA = 32, + V1LayerParameter_LayerType_EUCLIDEAN_LOSS = 7, + V1LayerParameter_LayerType_ELTWISE = 25, + V1LayerParameter_LayerType_EXP = 38, + V1LayerParameter_LayerType_FLATTEN = 8, + V1LayerParameter_LayerType_HDF5_DATA = 9, + V1LayerParameter_LayerType_HDF5_OUTPUT = 10, + V1LayerParameter_LayerType_HINGE_LOSS = 28, + V1LayerParameter_LayerType_IM2COL = 11, + V1LayerParameter_LayerType_IMAGE_DATA = 12, + V1LayerParameter_LayerType_INFOGAIN_LOSS = 13, + V1LayerParameter_LayerType_INNER_PRODUCT = 14, + V1LayerParameter_LayerType_LRN = 15, + V1LayerParameter_LayerType_MEMORY_DATA = 29, + V1LayerParameter_LayerType_MULTINOMIAL_LOGISTIC_LOSS = 16, + V1LayerParameter_LayerType_MVN = 34, + V1LayerParameter_LayerType_POOLING = 17, + V1LayerParameter_LayerType_POWER = 26, + V1LayerParameter_LayerType_RELU = 18, + V1LayerParameter_LayerType_SIGMOID = 19, + V1LayerParameter_LayerType_SIGMOID_CROSS_ENTROPY_LOSS = 27, + V1LayerParameter_LayerType_SILENCE = 36, + V1LayerParameter_LayerType_SOFTMAX = 20, + V1LayerParameter_LayerType_SOFTMAX_LOSS = 21, + V1LayerParameter_LayerType_SPLIT = 22, + V1LayerParameter_LayerType_SLICE = 33, + V1LayerParameter_LayerType_TANH = 23, + V1LayerParameter_LayerType_WINDOW_DATA = 24, + V1LayerParameter_LayerType_THRESHOLD = 31 +}; +bool V1LayerParameter_LayerType_IsValid(int value); +const V1LayerParameter_LayerType V1LayerParameter_LayerType_LayerType_MIN = V1LayerParameter_LayerType_NONE; +const V1LayerParameter_LayerType V1LayerParameter_LayerType_LayerType_MAX = V1LayerParameter_LayerType_DECONVOLUTION; +const int V1LayerParameter_LayerType_LayerType_ARRAYSIZE = V1LayerParameter_LayerType_LayerType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* V1LayerParameter_LayerType_descriptor(); +inline const ::std::string& V1LayerParameter_LayerType_Name(V1LayerParameter_LayerType value) { + return ::google::protobuf::internal::NameOfEnum( + V1LayerParameter_LayerType_descriptor(), value); +} +inline bool V1LayerParameter_LayerType_Parse( + const ::std::string& name, V1LayerParameter_LayerType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + V1LayerParameter_LayerType_descriptor(), name, value); +} +enum V1LayerParameter_DimCheckMode { + V1LayerParameter_DimCheckMode_STRICT = 0, + V1LayerParameter_DimCheckMode_PERMISSIVE = 1 +}; +bool V1LayerParameter_DimCheckMode_IsValid(int value); +const V1LayerParameter_DimCheckMode V1LayerParameter_DimCheckMode_DimCheckMode_MIN = V1LayerParameter_DimCheckMode_STRICT; +const V1LayerParameter_DimCheckMode V1LayerParameter_DimCheckMode_DimCheckMode_MAX = V1LayerParameter_DimCheckMode_PERMISSIVE; +const int V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE = V1LayerParameter_DimCheckMode_DimCheckMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* V1LayerParameter_DimCheckMode_descriptor(); +inline const ::std::string& V1LayerParameter_DimCheckMode_Name(V1LayerParameter_DimCheckMode value) { + return ::google::protobuf::internal::NameOfEnum( + V1LayerParameter_DimCheckMode_descriptor(), value); +} +inline bool V1LayerParameter_DimCheckMode_Parse( + const ::std::string& name, V1LayerParameter_DimCheckMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + V1LayerParameter_DimCheckMode_descriptor(), name, value); +} +enum V0LayerParameter_PoolMethod { + V0LayerParameter_PoolMethod_MAX = 0, + V0LayerParameter_PoolMethod_AVE = 1, + V0LayerParameter_PoolMethod_STOCHASTIC = 2 +}; +bool V0LayerParameter_PoolMethod_IsValid(int value); +const V0LayerParameter_PoolMethod V0LayerParameter_PoolMethod_PoolMethod_MIN = V0LayerParameter_PoolMethod_MAX; +const V0LayerParameter_PoolMethod V0LayerParameter_PoolMethod_PoolMethod_MAX = V0LayerParameter_PoolMethod_STOCHASTIC; +const int V0LayerParameter_PoolMethod_PoolMethod_ARRAYSIZE = V0LayerParameter_PoolMethod_PoolMethod_MAX + 1; + +const ::google::protobuf::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor(); +inline const ::std::string& V0LayerParameter_PoolMethod_Name(V0LayerParameter_PoolMethod value) { + return ::google::protobuf::internal::NameOfEnum( + V0LayerParameter_PoolMethod_descriptor(), value); +} +inline bool V0LayerParameter_PoolMethod_Parse( + const ::std::string& name, V0LayerParameter_PoolMethod* value) { + return ::google::protobuf::internal::ParseNamedEnum( + V0LayerParameter_PoolMethod_descriptor(), name, value); +} +enum Phase { + TRAIN = 0, + TEST = 1 +}; +bool Phase_IsValid(int value); +const Phase Phase_MIN = TRAIN; +const Phase Phase_MAX = TEST; +const int Phase_ARRAYSIZE = Phase_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Phase_descriptor(); +inline const ::std::string& Phase_Name(Phase value) { + return ::google::protobuf::internal::NameOfEnum( + Phase_descriptor(), value); +} +inline bool Phase_Parse( + const ::std::string& name, Phase* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Phase_descriptor(), name, value); +} +// =================================================================== + +class BlobShape : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.BlobShape) */ { + public: + BlobShape(); + virtual ~BlobShape(); + + BlobShape(const BlobShape& from); + + inline BlobShape& operator=(const BlobShape& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BlobShape& default_instance(); + + static const BlobShape* internal_default_instance(); + + void Swap(BlobShape* other); + + // implements Message ---------------------------------------------- + + inline BlobShape* New() const { return New(NULL); } + + BlobShape* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BlobShape& from); + void MergeFrom(const BlobShape& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobShape* other); + void UnsafeMergeFrom(const BlobShape& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 dim = 1 [packed = true]; + int dim_size() const; + void clear_dim(); + static const int kDimFieldNumber = 1; + ::google::protobuf::int64 dim(int index) const; + void set_dim(int index, ::google::protobuf::int64 value); + void add_dim(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dim() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dim(); + + // @@protoc_insertion_point(class_scope:caffe.BlobShape) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dim_; + mutable int _dim_cached_byte_size_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed BlobShape_default_instance_; + +// ------------------------------------------------------------------- + +class BlobProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.BlobProto) */ { + public: + BlobProto(); + virtual ~BlobProto(); + + BlobProto(const BlobProto& from); + + inline BlobProto& operator=(const BlobProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BlobProto& default_instance(); + + static const BlobProto* internal_default_instance(); + + void Swap(BlobProto* other); + + // implements Message ---------------------------------------------- + + inline BlobProto* New() const { return New(NULL); } + + BlobProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BlobProto& from); + void MergeFrom(const BlobProto& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobProto* other); + void UnsafeMergeFrom(const BlobProto& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.BlobShape shape = 7; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + const ::caffe::BlobShape& shape() const; + ::caffe::BlobShape* mutable_shape(); + ::caffe::BlobShape* release_shape(); + void set_allocated_shape(::caffe::BlobShape* shape); + + // repeated float data = 5 [packed = true]; + int data_size() const; + void clear_data(); + static const int kDataFieldNumber = 5; + float data(int index) const; + void set_data(int index, float value); + void add_data(float value); + const ::google::protobuf::RepeatedField< float >& + data() const; + ::google::protobuf::RepeatedField< float >* + mutable_data(); + + // repeated float diff = 6 [packed = true]; + int diff_size() const; + void clear_diff(); + static const int kDiffFieldNumber = 6; + float diff(int index) const; + void set_diff(int index, float value); + void add_diff(float value); + const ::google::protobuf::RepeatedField< float >& + diff() const; + ::google::protobuf::RepeatedField< float >* + mutable_diff(); + + // repeated double double_data = 8 [packed = true]; + int double_data_size() const; + void clear_double_data(); + static const int kDoubleDataFieldNumber = 8; + double double_data(int index) const; + void set_double_data(int index, double value); + void add_double_data(double value); + const ::google::protobuf::RepeatedField< double >& + double_data() const; + ::google::protobuf::RepeatedField< double >* + mutable_double_data(); + + // repeated double double_diff = 9 [packed = true]; + int double_diff_size() const; + void clear_double_diff(); + static const int kDoubleDiffFieldNumber = 9; + double double_diff(int index) const; + void set_double_diff(int index, double value); + void add_double_diff(double value); + const ::google::protobuf::RepeatedField< double >& + double_diff() const; + ::google::protobuf::RepeatedField< double >* + mutable_double_diff(); + + // optional int32 num = 1 [default = 0]; + bool has_num() const; + void clear_num(); + static const int kNumFieldNumber = 1; + ::google::protobuf::int32 num() const; + void set_num(::google::protobuf::int32 value); + + // optional int32 channels = 2 [default = 0]; + bool has_channels() const; + void clear_channels(); + static const int kChannelsFieldNumber = 2; + ::google::protobuf::int32 channels() const; + void set_channels(::google::protobuf::int32 value); + + // optional int32 height = 3 [default = 0]; + bool has_height() const; + void clear_height(); + static const int kHeightFieldNumber = 3; + ::google::protobuf::int32 height() const; + void set_height(::google::protobuf::int32 value); + + // optional int32 width = 4 [default = 0]; + bool has_width() const; + void clear_width(); + static const int kWidthFieldNumber = 4; + ::google::protobuf::int32 width() const; + void set_width(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.BlobProto) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + inline void set_has_num(); + inline void clear_has_num(); + inline void set_has_channels(); + inline void clear_has_channels(); + inline void set_has_height(); + inline void clear_has_height(); + inline void set_has_width(); + inline void clear_has_width(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > data_; + mutable int _data_cached_byte_size_; + ::google::protobuf::RepeatedField< float > diff_; + mutable int _diff_cached_byte_size_; + ::google::protobuf::RepeatedField< double > double_data_; + mutable int _double_data_cached_byte_size_; + ::google::protobuf::RepeatedField< double > double_diff_; + mutable int _double_diff_cached_byte_size_; + ::caffe::BlobShape* shape_; + ::google::protobuf::int32 num_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed BlobProto_default_instance_; + +// ------------------------------------------------------------------- + +class BlobProtoVector : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.BlobProtoVector) */ { + public: + BlobProtoVector(); + virtual ~BlobProtoVector(); + + BlobProtoVector(const BlobProtoVector& from); + + inline BlobProtoVector& operator=(const BlobProtoVector& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BlobProtoVector& default_instance(); + + static const BlobProtoVector* internal_default_instance(); + + void Swap(BlobProtoVector* other); + + // implements Message ---------------------------------------------- + + inline BlobProtoVector* New() const { return New(NULL); } + + BlobProtoVector* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BlobProtoVector& from); + void MergeFrom(const BlobProtoVector& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobProtoVector* other); + void UnsafeMergeFrom(const BlobProtoVector& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .caffe.BlobProto blobs = 1; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 1; + const ::caffe::BlobProto& blobs(int index) const; + ::caffe::BlobProto* mutable_blobs(int index); + ::caffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& + blobs() const; + + // @@protoc_insertion_point(class_scope:caffe.BlobProtoVector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto > blobs_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed BlobProtoVector_default_instance_; + +// ------------------------------------------------------------------- + +class PermuteParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.PermuteParameter) */ { + public: + PermuteParameter(); + virtual ~PermuteParameter(); + + PermuteParameter(const PermuteParameter& from); + + inline PermuteParameter& operator=(const PermuteParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PermuteParameter& default_instance(); + + static const PermuteParameter* internal_default_instance(); + + void Swap(PermuteParameter* other); + + // implements Message ---------------------------------------------- + + inline PermuteParameter* New() const { return New(NULL); } + + PermuteParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PermuteParameter& from); + void MergeFrom(const PermuteParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PermuteParameter* other); + void UnsafeMergeFrom(const PermuteParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated uint32 order = 1; + int order_size() const; + void clear_order(); + static const int kOrderFieldNumber = 1; + ::google::protobuf::uint32 order(int index) const; + void set_order(int index, ::google::protobuf::uint32 value); + void add_order(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + order() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_order(); + + // @@protoc_insertion_point(class_scope:caffe.PermuteParameter) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > order_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed PermuteParameter_default_instance_; + +// ------------------------------------------------------------------- + +class NormalizeBBoxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.NormalizeBBoxParameter) */ { + public: + NormalizeBBoxParameter(); + virtual ~NormalizeBBoxParameter(); + + NormalizeBBoxParameter(const NormalizeBBoxParameter& from); + + inline NormalizeBBoxParameter& operator=(const NormalizeBBoxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NormalizeBBoxParameter& default_instance(); + + static const NormalizeBBoxParameter* internal_default_instance(); + + void Swap(NormalizeBBoxParameter* other); + + // implements Message ---------------------------------------------- + + inline NormalizeBBoxParameter* New() const { return New(NULL); } + + NormalizeBBoxParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NormalizeBBoxParameter& from); + void MergeFrom(const NormalizeBBoxParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NormalizeBBoxParameter* other); + void UnsafeMergeFrom(const NormalizeBBoxParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool across_spatial = 1 [default = true]; + bool has_across_spatial() const; + void clear_across_spatial(); + static const int kAcrossSpatialFieldNumber = 1; + bool across_spatial() const; + void set_across_spatial(bool value); + + // optional .caffe.FillerParameter scale_filler = 2; + bool has_scale_filler() const; + void clear_scale_filler(); + static const int kScaleFillerFieldNumber = 2; + const ::caffe::FillerParameter& scale_filler() const; + ::caffe::FillerParameter* mutable_scale_filler(); + ::caffe::FillerParameter* release_scale_filler(); + void set_allocated_scale_filler(::caffe::FillerParameter* scale_filler); + + // optional bool channel_shared = 3 [default = true]; + bool has_channel_shared() const; + void clear_channel_shared(); + static const int kChannelSharedFieldNumber = 3; + bool channel_shared() const; + void set_channel_shared(bool value); + + // optional float eps = 4 [default = 1e-10]; + bool has_eps() const; + void clear_eps(); + static const int kEpsFieldNumber = 4; + float eps() const; + void set_eps(float value); + + // @@protoc_insertion_point(class_scope:caffe.NormalizeBBoxParameter) + private: + inline void set_has_across_spatial(); + inline void clear_has_across_spatial(); + inline void set_has_scale_filler(); + inline void clear_has_scale_filler(); + inline void set_has_channel_shared(); + inline void clear_has_channel_shared(); + inline void set_has_eps(); + inline void clear_has_eps(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* scale_filler_; + bool across_spatial_; + bool channel_shared_; + float eps_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NormalizeBBoxParameter_default_instance_; + +// ------------------------------------------------------------------- + +class PriorBoxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.PriorBoxParameter) */ { + public: + PriorBoxParameter(); + virtual ~PriorBoxParameter(); + + PriorBoxParameter(const PriorBoxParameter& from); + + inline PriorBoxParameter& operator=(const PriorBoxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PriorBoxParameter& default_instance(); + + static const PriorBoxParameter* internal_default_instance(); + + void Swap(PriorBoxParameter* other); + + // implements Message ---------------------------------------------- + + inline PriorBoxParameter* New() const { return New(NULL); } + + PriorBoxParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PriorBoxParameter& from); + void MergeFrom(const PriorBoxParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PriorBoxParameter* other); + void UnsafeMergeFrom(const PriorBoxParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef PriorBoxParameter_CodeType CodeType; + static const CodeType CORNER = + PriorBoxParameter_CodeType_CORNER; + static const CodeType CENTER_SIZE = + PriorBoxParameter_CodeType_CENTER_SIZE; + static inline bool CodeType_IsValid(int value) { + return PriorBoxParameter_CodeType_IsValid(value); + } + static const CodeType CodeType_MIN = + PriorBoxParameter_CodeType_CodeType_MIN; + static const CodeType CodeType_MAX = + PriorBoxParameter_CodeType_CodeType_MAX; + static const int CodeType_ARRAYSIZE = + PriorBoxParameter_CodeType_CodeType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + CodeType_descriptor() { + return PriorBoxParameter_CodeType_descriptor(); + } + static inline const ::std::string& CodeType_Name(CodeType value) { + return PriorBoxParameter_CodeType_Name(value); + } + static inline bool CodeType_Parse(const ::std::string& name, + CodeType* value) { + return PriorBoxParameter_CodeType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional float min_size = 1; + bool has_min_size() const; + void clear_min_size(); + static const int kMinSizeFieldNumber = 1; + float min_size() const; + void set_min_size(float value); + + // optional float max_size = 2; + bool has_max_size() const; + void clear_max_size(); + static const int kMaxSizeFieldNumber = 2; + float max_size() const; + void set_max_size(float value); + + // repeated float aspect_ratio = 3; + int aspect_ratio_size() const; + void clear_aspect_ratio(); + static const int kAspectRatioFieldNumber = 3; + float aspect_ratio(int index) const; + void set_aspect_ratio(int index, float value); + void add_aspect_ratio(float value); + const ::google::protobuf::RepeatedField< float >& + aspect_ratio() const; + ::google::protobuf::RepeatedField< float >* + mutable_aspect_ratio(); + + // optional bool flip = 4 [default = true]; + bool has_flip() const; + void clear_flip(); + static const int kFlipFieldNumber = 4; + bool flip() const; + void set_flip(bool value); + + // optional bool clip = 5 [default = true]; + bool has_clip() const; + void clear_clip(); + static const int kClipFieldNumber = 5; + bool clip() const; + void set_clip(bool value); + + // repeated float variance = 6; + int variance_size() const; + void clear_variance(); + static const int kVarianceFieldNumber = 6; + float variance(int index) const; + void set_variance(int index, float value); + void add_variance(float value); + const ::google::protobuf::RepeatedField< float >& + variance() const; + ::google::protobuf::RepeatedField< float >* + mutable_variance(); + + // optional uint32 img_size = 7; + bool has_img_size() const; + void clear_img_size(); + static const int kImgSizeFieldNumber = 7; + ::google::protobuf::uint32 img_size() const; + void set_img_size(::google::protobuf::uint32 value); + + // optional uint32 img_h = 8; + bool has_img_h() const; + void clear_img_h(); + static const int kImgHFieldNumber = 8; + ::google::protobuf::uint32 img_h() const; + void set_img_h(::google::protobuf::uint32 value); + + // optional uint32 img_w = 9; + bool has_img_w() const; + void clear_img_w(); + static const int kImgWFieldNumber = 9; + ::google::protobuf::uint32 img_w() const; + void set_img_w(::google::protobuf::uint32 value); + + // optional float step = 10; + bool has_step() const; + void clear_step(); + static const int kStepFieldNumber = 10; + float step() const; + void set_step(float value); + + // optional float step_h = 11; + bool has_step_h() const; + void clear_step_h(); + static const int kStepHFieldNumber = 11; + float step_h() const; + void set_step_h(float value); + + // optional float step_w = 12; + bool has_step_w() const; + void clear_step_w(); + static const int kStepWFieldNumber = 12; + float step_w() const; + void set_step_w(float value); + + // optional float offset = 13 [default = 0.5]; + bool has_offset() const; + void clear_offset(); + static const int kOffsetFieldNumber = 13; + float offset() const; + void set_offset(float value); + + // @@protoc_insertion_point(class_scope:caffe.PriorBoxParameter) + private: + inline void set_has_min_size(); + inline void clear_has_min_size(); + inline void set_has_max_size(); + inline void clear_has_max_size(); + inline void set_has_flip(); + inline void clear_has_flip(); + inline void set_has_clip(); + inline void clear_has_clip(); + inline void set_has_img_size(); + inline void clear_has_img_size(); + inline void set_has_img_h(); + inline void clear_has_img_h(); + inline void set_has_img_w(); + inline void clear_has_img_w(); + inline void set_has_step(); + inline void clear_has_step(); + inline void set_has_step_h(); + inline void clear_has_step_h(); + inline void set_has_step_w(); + inline void clear_has_step_w(); + inline void set_has_offset(); + inline void clear_has_offset(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > aspect_ratio_; + ::google::protobuf::RepeatedField< float > variance_; + float min_size_; + float max_size_; + ::google::protobuf::uint32 img_size_; + ::google::protobuf::uint32 img_h_; + ::google::protobuf::uint32 img_w_; + float step_; + float step_h_; + float step_w_; + bool flip_; + bool clip_; + float offset_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed PriorBoxParameter_default_instance_; + +// ------------------------------------------------------------------- + +class DetectionOutputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.DetectionOutputParameter) */ { + public: + DetectionOutputParameter(); + virtual ~DetectionOutputParameter(); + + DetectionOutputParameter(const DetectionOutputParameter& from); + + inline DetectionOutputParameter& operator=(const DetectionOutputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DetectionOutputParameter& default_instance(); + + static const DetectionOutputParameter* internal_default_instance(); + + void Swap(DetectionOutputParameter* other); + + // implements Message ---------------------------------------------- + + inline DetectionOutputParameter* New() const { return New(NULL); } + + DetectionOutputParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DetectionOutputParameter& from); + void MergeFrom(const DetectionOutputParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DetectionOutputParameter* other); + void UnsafeMergeFrom(const DetectionOutputParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_classes = 1; + bool has_num_classes() const; + void clear_num_classes(); + static const int kNumClassesFieldNumber = 1; + ::google::protobuf::uint32 num_classes() const; + void set_num_classes(::google::protobuf::uint32 value); + + // optional bool share_location = 2 [default = true]; + bool has_share_location() const; + void clear_share_location(); + static const int kShareLocationFieldNumber = 2; + bool share_location() const; + void set_share_location(bool value); + + // optional int32 background_label_id = 3 [default = 0]; + bool has_background_label_id() const; + void clear_background_label_id(); + static const int kBackgroundLabelIdFieldNumber = 3; + ::google::protobuf::int32 background_label_id() const; + void set_background_label_id(::google::protobuf::int32 value); + + // optional .caffe.NonMaximumSuppressionParameter nms_param = 4; + bool has_nms_param() const; + void clear_nms_param(); + static const int kNmsParamFieldNumber = 4; + const ::caffe::NonMaximumSuppressionParameter& nms_param() const; + ::caffe::NonMaximumSuppressionParameter* mutable_nms_param(); + ::caffe::NonMaximumSuppressionParameter* release_nms_param(); + void set_allocated_nms_param(::caffe::NonMaximumSuppressionParameter* nms_param); + + // optional .caffe.SaveOutputParameter save_output_param = 5; + bool has_save_output_param() const; + void clear_save_output_param(); + static const int kSaveOutputParamFieldNumber = 5; + const ::caffe::SaveOutputParameter& save_output_param() const; + ::caffe::SaveOutputParameter* mutable_save_output_param(); + ::caffe::SaveOutputParameter* release_save_output_param(); + void set_allocated_save_output_param(::caffe::SaveOutputParameter* save_output_param); + + // optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; + bool has_code_type() const; + void clear_code_type(); + static const int kCodeTypeFieldNumber = 6; + ::caffe::PriorBoxParameter_CodeType code_type() const; + void set_code_type(::caffe::PriorBoxParameter_CodeType value); + + // optional bool variance_encoded_in_target = 8 [default = false]; + bool has_variance_encoded_in_target() const; + void clear_variance_encoded_in_target(); + static const int kVarianceEncodedInTargetFieldNumber = 8; + bool variance_encoded_in_target() const; + void set_variance_encoded_in_target(bool value); + + // optional int32 keep_top_k = 7 [default = -1]; + bool has_keep_top_k() const; + void clear_keep_top_k(); + static const int kKeepTopKFieldNumber = 7; + ::google::protobuf::int32 keep_top_k() const; + void set_keep_top_k(::google::protobuf::int32 value); + + // optional float confidence_threshold = 9; + bool has_confidence_threshold() const; + void clear_confidence_threshold(); + static const int kConfidenceThresholdFieldNumber = 9; + float confidence_threshold() const; + void set_confidence_threshold(float value); + + // @@protoc_insertion_point(class_scope:caffe.DetectionOutputParameter) + private: + inline void set_has_num_classes(); + inline void clear_has_num_classes(); + inline void set_has_share_location(); + inline void clear_has_share_location(); + inline void set_has_background_label_id(); + inline void clear_has_background_label_id(); + inline void set_has_nms_param(); + inline void clear_has_nms_param(); + inline void set_has_save_output_param(); + inline void clear_has_save_output_param(); + inline void set_has_code_type(); + inline void clear_has_code_type(); + inline void set_has_variance_encoded_in_target(); + inline void clear_has_variance_encoded_in_target(); + inline void set_has_keep_top_k(); + inline void clear_has_keep_top_k(); + inline void set_has_confidence_threshold(); + inline void clear_has_confidence_threshold(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::NonMaximumSuppressionParameter* nms_param_; + ::caffe::SaveOutputParameter* save_output_param_; + ::google::protobuf::uint32 num_classes_; + ::google::protobuf::int32 background_label_id_; + bool variance_encoded_in_target_; + float confidence_threshold_; + ::google::protobuf::int32 keep_top_k_; + bool share_location_; + int code_type_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed DetectionOutputParameter_default_instance_; + +// ------------------------------------------------------------------- + +class Datum : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.Datum) */ { + public: + Datum(); + virtual ~Datum(); + + Datum(const Datum& from); + + inline Datum& operator=(const Datum& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Datum& default_instance(); + + static const Datum* internal_default_instance(); + + void Swap(Datum* other); + + // implements Message ---------------------------------------------- + + inline Datum* New() const { return New(NULL); } + + Datum* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Datum& from); + void MergeFrom(const Datum& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(Datum* other); + void UnsafeMergeFrom(const Datum& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 channels = 1; + bool has_channels() const; + void clear_channels(); + static const int kChannelsFieldNumber = 1; + ::google::protobuf::int32 channels() const; + void set_channels(::google::protobuf::int32 value); + + // optional int32 height = 2; + bool has_height() const; + void clear_height(); + static const int kHeightFieldNumber = 2; + ::google::protobuf::int32 height() const; + void set_height(::google::protobuf::int32 value); + + // optional int32 width = 3; + bool has_width() const; + void clear_width(); + static const int kWidthFieldNumber = 3; + ::google::protobuf::int32 width() const; + void set_width(::google::protobuf::int32 value); + + // optional bytes data = 4; + bool has_data() const; + void clear_data(); + static const int kDataFieldNumber = 4; + const ::std::string& data() const; + void set_data(const ::std::string& value); + void set_data(const char* value); + void set_data(const void* value, size_t size); + ::std::string* mutable_data(); + ::std::string* release_data(); + void set_allocated_data(::std::string* data); + + // optional int32 label = 5; + bool has_label() const; + void clear_label(); + static const int kLabelFieldNumber = 5; + ::google::protobuf::int32 label() const; + void set_label(::google::protobuf::int32 value); + + // repeated float float_data = 6; + int float_data_size() const; + void clear_float_data(); + static const int kFloatDataFieldNumber = 6; + float float_data(int index) const; + void set_float_data(int index, float value); + void add_float_data(float value); + const ::google::protobuf::RepeatedField< float >& + float_data() const; + ::google::protobuf::RepeatedField< float >* + mutable_float_data(); + + // optional bool encoded = 7 [default = false]; + bool has_encoded() const; + void clear_encoded(); + static const int kEncodedFieldNumber = 7; + bool encoded() const; + void set_encoded(bool value); + + // @@protoc_insertion_point(class_scope:caffe.Datum) + private: + inline void set_has_channels(); + inline void clear_has_channels(); + inline void set_has_height(); + inline void clear_has_height(); + inline void set_has_width(); + inline void clear_has_width(); + inline void set_has_data(); + inline void clear_has_data(); + inline void set_has_label(); + inline void clear_has_label(); + inline void set_has_encoded(); + inline void clear_has_encoded(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > float_data_; + ::google::protobuf::internal::ArenaStringPtr data_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + ::google::protobuf::int32 label_; + bool encoded_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed Datum_default_instance_; + +// ------------------------------------------------------------------- + +class FillerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.FillerParameter) */ { + public: + FillerParameter(); + virtual ~FillerParameter(); + + FillerParameter(const FillerParameter& from); + + inline FillerParameter& operator=(const FillerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FillerParameter& default_instance(); + + static const FillerParameter* internal_default_instance(); + + void Swap(FillerParameter* other); + + // implements Message ---------------------------------------------- + + inline FillerParameter* New() const { return New(NULL); } + + FillerParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FillerParameter& from); + void MergeFrom(const FillerParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FillerParameter* other); + void UnsafeMergeFrom(const FillerParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef FillerParameter_VarianceNorm VarianceNorm; + static const VarianceNorm FAN_IN = + FillerParameter_VarianceNorm_FAN_IN; + static const VarianceNorm FAN_OUT = + FillerParameter_VarianceNorm_FAN_OUT; + static const VarianceNorm AVERAGE = + FillerParameter_VarianceNorm_AVERAGE; + static inline bool VarianceNorm_IsValid(int value) { + return FillerParameter_VarianceNorm_IsValid(value); + } + static const VarianceNorm VarianceNorm_MIN = + FillerParameter_VarianceNorm_VarianceNorm_MIN; + static const VarianceNorm VarianceNorm_MAX = + FillerParameter_VarianceNorm_VarianceNorm_MAX; + static const int VarianceNorm_ARRAYSIZE = + FillerParameter_VarianceNorm_VarianceNorm_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + VarianceNorm_descriptor() { + return FillerParameter_VarianceNorm_descriptor(); + } + static inline const ::std::string& VarianceNorm_Name(VarianceNorm value) { + return FillerParameter_VarianceNorm_Name(value); + } + static inline bool VarianceNorm_Parse(const ::std::string& name, + VarianceNorm* value) { + return FillerParameter_VarianceNorm_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string type = 1 [default = "constant"]; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 1; + const ::std::string& type() const; + void set_type(const ::std::string& value); + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + + // optional float value = 2 [default = 0]; + bool has_value() const; + void clear_value(); + static const int kValueFieldNumber = 2; + float value() const; + void set_value(float value); + + // optional float min = 3 [default = 0]; + bool has_min() const; + void clear_min(); + static const int kMinFieldNumber = 3; + float min() const; + void set_min(float value); + + // optional float max = 4 [default = 1]; + bool has_max() const; + void clear_max(); + static const int kMaxFieldNumber = 4; + float max() const; + void set_max(float value); + + // optional float mean = 5 [default = 0]; + bool has_mean() const; + void clear_mean(); + static const int kMeanFieldNumber = 5; + float mean() const; + void set_mean(float value); + + // optional float std = 6 [default = 1]; + bool has_std() const; + void clear_std(); + static const int kStdFieldNumber = 6; + float std() const; + void set_std(float value); + + // optional int32 sparse = 7 [default = -1]; + bool has_sparse() const; + void clear_sparse(); + static const int kSparseFieldNumber = 7; + ::google::protobuf::int32 sparse() const; + void set_sparse(::google::protobuf::int32 value); + + // optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + bool has_variance_norm() const; + void clear_variance_norm(); + static const int kVarianceNormFieldNumber = 8; + ::caffe::FillerParameter_VarianceNorm variance_norm() const; + void set_variance_norm(::caffe::FillerParameter_VarianceNorm value); + + // @@protoc_insertion_point(class_scope:caffe.FillerParameter) + private: + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_value(); + inline void clear_has_value(); + inline void set_has_min(); + inline void clear_has_min(); + inline void set_has_max(); + inline void clear_has_max(); + inline void set_has_mean(); + inline void clear_has_mean(); + inline void set_has_std(); + inline void clear_has_std(); + inline void set_has_sparse(); + inline void clear_has_sparse(); + inline void set_has_variance_norm(); + inline void clear_has_variance_norm(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + static ::std::string* _default_type_; + ::google::protobuf::internal::ArenaStringPtr type_; + float value_; + float min_; + float mean_; + int variance_norm_; + ::google::protobuf::int32 sparse_; + float max_; + float std_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed FillerParameter_default_instance_; + +// ------------------------------------------------------------------- + +class NetParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.NetParameter) */ { + public: + NetParameter(); + virtual ~NetParameter(); + + NetParameter(const NetParameter& from); + + inline NetParameter& operator=(const NetParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetParameter& default_instance(); + + static const NetParameter* internal_default_instance(); + + void Swap(NetParameter* other); + + // implements Message ---------------------------------------------- + + inline NetParameter* New() const { return New(NULL); } + + NetParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NetParameter& from); + void MergeFrom(const NetParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetParameter* other); + void UnsafeMergeFrom(const NetParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // repeated string input = 3; + int input_size() const; + void clear_input(); + static const int kInputFieldNumber = 3; + const ::std::string& input(int index) const; + ::std::string* mutable_input(int index); + void set_input(int index, const ::std::string& value); + void set_input(int index, const char* value); + void set_input(int index, const char* value, size_t size); + ::std::string* add_input(); + void add_input(const ::std::string& value); + void add_input(const char* value); + void add_input(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input(); + + // repeated .caffe.BlobShape input_shape = 8; + int input_shape_size() const; + void clear_input_shape(); + static const int kInputShapeFieldNumber = 8; + const ::caffe::BlobShape& input_shape(int index) const; + ::caffe::BlobShape* mutable_input_shape(int index); + ::caffe::BlobShape* add_input_shape(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* + mutable_input_shape(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& + input_shape() const; + + // repeated int32 input_dim = 4; + int input_dim_size() const; + void clear_input_dim(); + static const int kInputDimFieldNumber = 4; + ::google::protobuf::int32 input_dim(int index) const; + void set_input_dim(int index, ::google::protobuf::int32 value); + void add_input_dim(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + input_dim() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_input_dim(); + + // optional bool force_backward = 5 [default = false]; + bool has_force_backward() const; + void clear_force_backward(); + static const int kForceBackwardFieldNumber = 5; + bool force_backward() const; + void set_force_backward(bool value); + + // optional .caffe.NetState state = 6; + bool has_state() const; + void clear_state(); + static const int kStateFieldNumber = 6; + const ::caffe::NetState& state() const; + ::caffe::NetState* mutable_state(); + ::caffe::NetState* release_state(); + void set_allocated_state(::caffe::NetState* state); + + // optional bool debug_info = 7 [default = false]; + bool has_debug_info() const; + void clear_debug_info(); + static const int kDebugInfoFieldNumber = 7; + bool debug_info() const; + void set_debug_info(bool value); + + // repeated .caffe.LayerParameter layer = 100; + int layer_size() const; + void clear_layer(); + static const int kLayerFieldNumber = 100; + const ::caffe::LayerParameter& layer(int index) const; + ::caffe::LayerParameter* mutable_layer(int index); + ::caffe::LayerParameter* add_layer(); + ::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter >* + mutable_layer(); + const ::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter >& + layer() const; + + // repeated .caffe.V1LayerParameter layers = 2; + int layers_size() const; + void clear_layers(); + static const int kLayersFieldNumber = 2; + const ::caffe::V1LayerParameter& layers(int index) const; + ::caffe::V1LayerParameter* mutable_layers(int index); + ::caffe::V1LayerParameter* add_layers(); + ::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter >* + mutable_layers(); + const ::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter >& + layers() const; + + // @@protoc_insertion_point(class_scope:caffe.NetParameter) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_force_backward(); + inline void clear_has_force_backward(); + inline void set_has_state(); + inline void clear_has_state(); + inline void set_has_debug_info(); + inline void clear_has_debug_info(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape > input_shape_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_dim_; + ::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter > layer_; + ::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter > layers_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::caffe::NetState* state_; + bool force_backward_; + bool debug_info_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NetParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SolverParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SolverParameter) */ { + public: + SolverParameter(); + virtual ~SolverParameter(); + + SolverParameter(const SolverParameter& from); + + inline SolverParameter& operator=(const SolverParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SolverParameter& default_instance(); + + static const SolverParameter* internal_default_instance(); + + void Swap(SolverParameter* other); + + // implements Message ---------------------------------------------- + + inline SolverParameter* New() const { return New(NULL); } + + SolverParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SolverParameter& from); + void MergeFrom(const SolverParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SolverParameter* other); + void UnsafeMergeFrom(const SolverParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef SolverParameter_SnapshotFormat SnapshotFormat; + static const SnapshotFormat HDF5 = + SolverParameter_SnapshotFormat_HDF5; + static const SnapshotFormat BINARYPROTO = + SolverParameter_SnapshotFormat_BINARYPROTO; + static inline bool SnapshotFormat_IsValid(int value) { + return SolverParameter_SnapshotFormat_IsValid(value); + } + static const SnapshotFormat SnapshotFormat_MIN = + SolverParameter_SnapshotFormat_SnapshotFormat_MIN; + static const SnapshotFormat SnapshotFormat_MAX = + SolverParameter_SnapshotFormat_SnapshotFormat_MAX; + static const int SnapshotFormat_ARRAYSIZE = + SolverParameter_SnapshotFormat_SnapshotFormat_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + SnapshotFormat_descriptor() { + return SolverParameter_SnapshotFormat_descriptor(); + } + static inline const ::std::string& SnapshotFormat_Name(SnapshotFormat value) { + return SolverParameter_SnapshotFormat_Name(value); + } + static inline bool SnapshotFormat_Parse(const ::std::string& name, + SnapshotFormat* value) { + return SolverParameter_SnapshotFormat_Parse(name, value); + } + + typedef SolverParameter_SolverMode SolverMode; + static const SolverMode CPU = + SolverParameter_SolverMode_CPU; + static const SolverMode GPU = + SolverParameter_SolverMode_GPU; + static inline bool SolverMode_IsValid(int value) { + return SolverParameter_SolverMode_IsValid(value); + } + static const SolverMode SolverMode_MIN = + SolverParameter_SolverMode_SolverMode_MIN; + static const SolverMode SolverMode_MAX = + SolverParameter_SolverMode_SolverMode_MAX; + static const int SolverMode_ARRAYSIZE = + SolverParameter_SolverMode_SolverMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + SolverMode_descriptor() { + return SolverParameter_SolverMode_descriptor(); + } + static inline const ::std::string& SolverMode_Name(SolverMode value) { + return SolverParameter_SolverMode_Name(value); + } + static inline bool SolverMode_Parse(const ::std::string& name, + SolverMode* value) { + return SolverParameter_SolverMode_Parse(name, value); + } + + typedef SolverParameter_SolverType SolverType; + static const SolverType SGD = + SolverParameter_SolverType_SGD; + static const SolverType NESTEROV = + SolverParameter_SolverType_NESTEROV; + static const SolverType ADAGRAD = + SolverParameter_SolverType_ADAGRAD; + static const SolverType RMSPROP = + SolverParameter_SolverType_RMSPROP; + static const SolverType ADADELTA = + SolverParameter_SolverType_ADADELTA; + static const SolverType ADAM = + SolverParameter_SolverType_ADAM; + static inline bool SolverType_IsValid(int value) { + return SolverParameter_SolverType_IsValid(value); + } + static const SolverType SolverType_MIN = + SolverParameter_SolverType_SolverType_MIN; + static const SolverType SolverType_MAX = + SolverParameter_SolverType_SolverType_MAX; + static const int SolverType_ARRAYSIZE = + SolverParameter_SolverType_SolverType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + SolverType_descriptor() { + return SolverParameter_SolverType_descriptor(); + } + static inline const ::std::string& SolverType_Name(SolverType value) { + return SolverParameter_SolverType_Name(value); + } + static inline bool SolverType_Parse(const ::std::string& name, + SolverType* value) { + return SolverParameter_SolverType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string net = 24; + bool has_net() const; + void clear_net(); + static const int kNetFieldNumber = 24; + const ::std::string& net() const; + void set_net(const ::std::string& value); + void set_net(const char* value); + void set_net(const char* value, size_t size); + ::std::string* mutable_net(); + ::std::string* release_net(); + void set_allocated_net(::std::string* net); + + // optional .caffe.NetParameter net_param = 25; + bool has_net_param() const; + void clear_net_param(); + static const int kNetParamFieldNumber = 25; + const ::caffe::NetParameter& net_param() const; + ::caffe::NetParameter* mutable_net_param(); + ::caffe::NetParameter* release_net_param(); + void set_allocated_net_param(::caffe::NetParameter* net_param); + + // optional string train_net = 1; + bool has_train_net() const; + void clear_train_net(); + static const int kTrainNetFieldNumber = 1; + const ::std::string& train_net() const; + void set_train_net(const ::std::string& value); + void set_train_net(const char* value); + void set_train_net(const char* value, size_t size); + ::std::string* mutable_train_net(); + ::std::string* release_train_net(); + void set_allocated_train_net(::std::string* train_net); + + // repeated string test_net = 2; + int test_net_size() const; + void clear_test_net(); + static const int kTestNetFieldNumber = 2; + const ::std::string& test_net(int index) const; + ::std::string* mutable_test_net(int index); + void set_test_net(int index, const ::std::string& value); + void set_test_net(int index, const char* value); + void set_test_net(int index, const char* value, size_t size); + ::std::string* add_test_net(); + void add_test_net(const ::std::string& value); + void add_test_net(const char* value); + void add_test_net(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& test_net() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_test_net(); + + // optional .caffe.NetParameter train_net_param = 21; + bool has_train_net_param() const; + void clear_train_net_param(); + static const int kTrainNetParamFieldNumber = 21; + const ::caffe::NetParameter& train_net_param() const; + ::caffe::NetParameter* mutable_train_net_param(); + ::caffe::NetParameter* release_train_net_param(); + void set_allocated_train_net_param(::caffe::NetParameter* train_net_param); + + // repeated .caffe.NetParameter test_net_param = 22; + int test_net_param_size() const; + void clear_test_net_param(); + static const int kTestNetParamFieldNumber = 22; + const ::caffe::NetParameter& test_net_param(int index) const; + ::caffe::NetParameter* mutable_test_net_param(int index); + ::caffe::NetParameter* add_test_net_param(); + ::google::protobuf::RepeatedPtrField< ::caffe::NetParameter >* + mutable_test_net_param(); + const ::google::protobuf::RepeatedPtrField< ::caffe::NetParameter >& + test_net_param() const; + + // optional .caffe.NetState train_state = 26; + bool has_train_state() const; + void clear_train_state(); + static const int kTrainStateFieldNumber = 26; + const ::caffe::NetState& train_state() const; + ::caffe::NetState* mutable_train_state(); + ::caffe::NetState* release_train_state(); + void set_allocated_train_state(::caffe::NetState* train_state); + + // repeated .caffe.NetState test_state = 27; + int test_state_size() const; + void clear_test_state(); + static const int kTestStateFieldNumber = 27; + const ::caffe::NetState& test_state(int index) const; + ::caffe::NetState* mutable_test_state(int index); + ::caffe::NetState* add_test_state(); + ::google::protobuf::RepeatedPtrField< ::caffe::NetState >* + mutable_test_state(); + const ::google::protobuf::RepeatedPtrField< ::caffe::NetState >& + test_state() const; + + // repeated int32 test_iter = 3; + int test_iter_size() const; + void clear_test_iter(); + static const int kTestIterFieldNumber = 3; + ::google::protobuf::int32 test_iter(int index) const; + void set_test_iter(int index, ::google::protobuf::int32 value); + void add_test_iter(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + test_iter() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_test_iter(); + + // optional int32 test_interval = 4 [default = 0]; + bool has_test_interval() const; + void clear_test_interval(); + static const int kTestIntervalFieldNumber = 4; + ::google::protobuf::int32 test_interval() const; + void set_test_interval(::google::protobuf::int32 value); + + // optional bool test_compute_loss = 19 [default = false]; + bool has_test_compute_loss() const; + void clear_test_compute_loss(); + static const int kTestComputeLossFieldNumber = 19; + bool test_compute_loss() const; + void set_test_compute_loss(bool value); + + // optional bool test_initialization = 32 [default = true]; + bool has_test_initialization() const; + void clear_test_initialization(); + static const int kTestInitializationFieldNumber = 32; + bool test_initialization() const; + void set_test_initialization(bool value); + + // optional float base_lr = 5; + bool has_base_lr() const; + void clear_base_lr(); + static const int kBaseLrFieldNumber = 5; + float base_lr() const; + void set_base_lr(float value); + + // optional int32 display = 6; + bool has_display() const; + void clear_display(); + static const int kDisplayFieldNumber = 6; + ::google::protobuf::int32 display() const; + void set_display(::google::protobuf::int32 value); + + // optional int32 average_loss = 33 [default = 1]; + bool has_average_loss() const; + void clear_average_loss(); + static const int kAverageLossFieldNumber = 33; + ::google::protobuf::int32 average_loss() const; + void set_average_loss(::google::protobuf::int32 value); + + // optional int32 max_iter = 7; + bool has_max_iter() const; + void clear_max_iter(); + static const int kMaxIterFieldNumber = 7; + ::google::protobuf::int32 max_iter() const; + void set_max_iter(::google::protobuf::int32 value); + + // optional int32 iter_size = 36 [default = 1]; + bool has_iter_size() const; + void clear_iter_size(); + static const int kIterSizeFieldNumber = 36; + ::google::protobuf::int32 iter_size() const; + void set_iter_size(::google::protobuf::int32 value); + + // optional string lr_policy = 8; + bool has_lr_policy() const; + void clear_lr_policy(); + static const int kLrPolicyFieldNumber = 8; + const ::std::string& lr_policy() const; + void set_lr_policy(const ::std::string& value); + void set_lr_policy(const char* value); + void set_lr_policy(const char* value, size_t size); + ::std::string* mutable_lr_policy(); + ::std::string* release_lr_policy(); + void set_allocated_lr_policy(::std::string* lr_policy); + + // optional float gamma = 9; + bool has_gamma() const; + void clear_gamma(); + static const int kGammaFieldNumber = 9; + float gamma() const; + void set_gamma(float value); + + // optional float power = 10; + bool has_power() const; + void clear_power(); + static const int kPowerFieldNumber = 10; + float power() const; + void set_power(float value); + + // optional float momentum = 11; + bool has_momentum() const; + void clear_momentum(); + static const int kMomentumFieldNumber = 11; + float momentum() const; + void set_momentum(float value); + + // optional float weight_decay = 12; + bool has_weight_decay() const; + void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 12; + float weight_decay() const; + void set_weight_decay(float value); + + // optional string regularization_type = 29 [default = "L2"]; + bool has_regularization_type() const; + void clear_regularization_type(); + static const int kRegularizationTypeFieldNumber = 29; + const ::std::string& regularization_type() const; + void set_regularization_type(const ::std::string& value); + void set_regularization_type(const char* value); + void set_regularization_type(const char* value, size_t size); + ::std::string* mutable_regularization_type(); + ::std::string* release_regularization_type(); + void set_allocated_regularization_type(::std::string* regularization_type); + + // optional int32 stepsize = 13; + bool has_stepsize() const; + void clear_stepsize(); + static const int kStepsizeFieldNumber = 13; + ::google::protobuf::int32 stepsize() const; + void set_stepsize(::google::protobuf::int32 value); + + // repeated int32 stepvalue = 34; + int stepvalue_size() const; + void clear_stepvalue(); + static const int kStepvalueFieldNumber = 34; + ::google::protobuf::int32 stepvalue(int index) const; + void set_stepvalue(int index, ::google::protobuf::int32 value); + void add_stepvalue(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + stepvalue() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_stepvalue(); + + // optional float clip_gradients = 35 [default = -1]; + bool has_clip_gradients() const; + void clear_clip_gradients(); + static const int kClipGradientsFieldNumber = 35; + float clip_gradients() const; + void set_clip_gradients(float value); + + // optional int32 snapshot = 14 [default = 0]; + bool has_snapshot() const; + void clear_snapshot(); + static const int kSnapshotFieldNumber = 14; + ::google::protobuf::int32 snapshot() const; + void set_snapshot(::google::protobuf::int32 value); + + // optional string snapshot_prefix = 15; + bool has_snapshot_prefix() const; + void clear_snapshot_prefix(); + static const int kSnapshotPrefixFieldNumber = 15; + const ::std::string& snapshot_prefix() const; + void set_snapshot_prefix(const ::std::string& value); + void set_snapshot_prefix(const char* value); + void set_snapshot_prefix(const char* value, size_t size); + ::std::string* mutable_snapshot_prefix(); + ::std::string* release_snapshot_prefix(); + void set_allocated_snapshot_prefix(::std::string* snapshot_prefix); + + // optional bool snapshot_diff = 16 [default = false]; + bool has_snapshot_diff() const; + void clear_snapshot_diff(); + static const int kSnapshotDiffFieldNumber = 16; + bool snapshot_diff() const; + void set_snapshot_diff(bool value); + + // optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + bool has_snapshot_format() const; + void clear_snapshot_format(); + static const int kSnapshotFormatFieldNumber = 37; + ::caffe::SolverParameter_SnapshotFormat snapshot_format() const; + void set_snapshot_format(::caffe::SolverParameter_SnapshotFormat value); + + // optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + bool has_solver_mode() const; + void clear_solver_mode(); + static const int kSolverModeFieldNumber = 17; + ::caffe::SolverParameter_SolverMode solver_mode() const; + void set_solver_mode(::caffe::SolverParameter_SolverMode value); + + // optional int32 device_id = 18 [default = 0]; + bool has_device_id() const; + void clear_device_id(); + static const int kDeviceIdFieldNumber = 18; + ::google::protobuf::int32 device_id() const; + void set_device_id(::google::protobuf::int32 value); + + // optional int64 random_seed = 20 [default = -1]; + bool has_random_seed() const; + void clear_random_seed(); + static const int kRandomSeedFieldNumber = 20; + ::google::protobuf::int64 random_seed() const; + void set_random_seed(::google::protobuf::int64 value); + + // optional string type = 40 [default = "SGD"]; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 40; + const ::std::string& type() const; + void set_type(const ::std::string& value); + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + + // optional float delta = 31 [default = 1e-08]; + bool has_delta() const; + void clear_delta(); + static const int kDeltaFieldNumber = 31; + float delta() const; + void set_delta(float value); + + // optional float momentum2 = 39 [default = 0.999]; + bool has_momentum2() const; + void clear_momentum2(); + static const int kMomentum2FieldNumber = 39; + float momentum2() const; + void set_momentum2(float value); + + // optional float rms_decay = 38 [default = 0.99]; + bool has_rms_decay() const; + void clear_rms_decay(); + static const int kRmsDecayFieldNumber = 38; + float rms_decay() const; + void set_rms_decay(float value); + + // optional bool debug_info = 23 [default = false]; + bool has_debug_info() const; + void clear_debug_info(); + static const int kDebugInfoFieldNumber = 23; + bool debug_info() const; + void set_debug_info(bool value); + + // optional bool snapshot_after_train = 28 [default = true]; + bool has_snapshot_after_train() const; + void clear_snapshot_after_train(); + static const int kSnapshotAfterTrainFieldNumber = 28; + bool snapshot_after_train() const; + void set_snapshot_after_train(bool value); + + // optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + bool has_solver_type() const; + void clear_solver_type(); + static const int kSolverTypeFieldNumber = 30; + ::caffe::SolverParameter_SolverType solver_type() const; + void set_solver_type(::caffe::SolverParameter_SolverType value); + + // @@protoc_insertion_point(class_scope:caffe.SolverParameter) + private: + inline void set_has_net(); + inline void clear_has_net(); + inline void set_has_net_param(); + inline void clear_has_net_param(); + inline void set_has_train_net(); + inline void clear_has_train_net(); + inline void set_has_train_net_param(); + inline void clear_has_train_net_param(); + inline void set_has_train_state(); + inline void clear_has_train_state(); + inline void set_has_test_interval(); + inline void clear_has_test_interval(); + inline void set_has_test_compute_loss(); + inline void clear_has_test_compute_loss(); + inline void set_has_test_initialization(); + inline void clear_has_test_initialization(); + inline void set_has_base_lr(); + inline void clear_has_base_lr(); + inline void set_has_display(); + inline void clear_has_display(); + inline void set_has_average_loss(); + inline void clear_has_average_loss(); + inline void set_has_max_iter(); + inline void clear_has_max_iter(); + inline void set_has_iter_size(); + inline void clear_has_iter_size(); + inline void set_has_lr_policy(); + inline void clear_has_lr_policy(); + inline void set_has_gamma(); + inline void clear_has_gamma(); + inline void set_has_power(); + inline void clear_has_power(); + inline void set_has_momentum(); + inline void clear_has_momentum(); + inline void set_has_weight_decay(); + inline void clear_has_weight_decay(); + inline void set_has_regularization_type(); + inline void clear_has_regularization_type(); + inline void set_has_stepsize(); + inline void clear_has_stepsize(); + inline void set_has_clip_gradients(); + inline void clear_has_clip_gradients(); + inline void set_has_snapshot(); + inline void clear_has_snapshot(); + inline void set_has_snapshot_prefix(); + inline void clear_has_snapshot_prefix(); + inline void set_has_snapshot_diff(); + inline void clear_has_snapshot_diff(); + inline void set_has_snapshot_format(); + inline void clear_has_snapshot_format(); + inline void set_has_solver_mode(); + inline void clear_has_solver_mode(); + inline void set_has_device_id(); + inline void clear_has_device_id(); + inline void set_has_random_seed(); + inline void clear_has_random_seed(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_delta(); + inline void clear_has_delta(); + inline void set_has_momentum2(); + inline void clear_has_momentum2(); + inline void set_has_rms_decay(); + inline void clear_has_rms_decay(); + inline void set_has_debug_info(); + inline void clear_has_debug_info(); + inline void set_has_snapshot_after_train(); + inline void clear_has_snapshot_after_train(); + inline void set_has_solver_type(); + inline void clear_has_solver_type(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<2> _has_bits_; + ::google::protobuf::RepeatedPtrField< ::std::string> test_net_; + ::google::protobuf::RepeatedPtrField< ::caffe::NetParameter > test_net_param_; + ::google::protobuf::RepeatedPtrField< ::caffe::NetState > test_state_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > test_iter_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > stepvalue_; + ::google::protobuf::internal::ArenaStringPtr net_; + ::google::protobuf::internal::ArenaStringPtr train_net_; + ::google::protobuf::internal::ArenaStringPtr lr_policy_; + static ::std::string* _default_regularization_type_; + ::google::protobuf::internal::ArenaStringPtr regularization_type_; + ::google::protobuf::internal::ArenaStringPtr snapshot_prefix_; + static ::std::string* _default_type_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::caffe::NetParameter* net_param_; + ::caffe::NetParameter* train_net_param_; + ::caffe::NetState* train_state_; + ::google::protobuf::int32 test_interval_; + float base_lr_; + ::google::protobuf::int32 display_; + ::google::protobuf::int32 max_iter_; + float gamma_; + float power_; + float momentum_; + float weight_decay_; + ::google::protobuf::int32 stepsize_; + bool test_compute_loss_; + bool snapshot_diff_; + bool debug_info_; + ::google::protobuf::int32 snapshot_; + ::google::protobuf::int32 device_id_; + int solver_type_; + float rms_decay_; + ::google::protobuf::int32 average_loss_; + ::google::protobuf::int32 iter_size_; + bool test_initialization_; + bool snapshot_after_train_; + float clip_gradients_; + int snapshot_format_; + int solver_mode_; + ::google::protobuf::int64 random_seed_; + float delta_; + float momentum2_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SolverParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SolverState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SolverState) */ { + public: + SolverState(); + virtual ~SolverState(); + + SolverState(const SolverState& from); + + inline SolverState& operator=(const SolverState& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SolverState& default_instance(); + + static const SolverState* internal_default_instance(); + + void Swap(SolverState* other); + + // implements Message ---------------------------------------------- + + inline SolverState* New() const { return New(NULL); } + + SolverState* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SolverState& from); + void MergeFrom(const SolverState& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SolverState* other); + void UnsafeMergeFrom(const SolverState& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 iter = 1; + bool has_iter() const; + void clear_iter(); + static const int kIterFieldNumber = 1; + ::google::protobuf::int32 iter() const; + void set_iter(::google::protobuf::int32 value); + + // optional string learned_net = 2; + bool has_learned_net() const; + void clear_learned_net(); + static const int kLearnedNetFieldNumber = 2; + const ::std::string& learned_net() const; + void set_learned_net(const ::std::string& value); + void set_learned_net(const char* value); + void set_learned_net(const char* value, size_t size); + ::std::string* mutable_learned_net(); + ::std::string* release_learned_net(); + void set_allocated_learned_net(::std::string* learned_net); + + // repeated .caffe.BlobProto history = 3; + int history_size() const; + void clear_history(); + static const int kHistoryFieldNumber = 3; + const ::caffe::BlobProto& history(int index) const; + ::caffe::BlobProto* mutable_history(int index); + ::caffe::BlobProto* add_history(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* + mutable_history(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& + history() const; + + // optional int32 current_step = 4 [default = 0]; + bool has_current_step() const; + void clear_current_step(); + static const int kCurrentStepFieldNumber = 4; + ::google::protobuf::int32 current_step() const; + void set_current_step(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.SolverState) + private: + inline void set_has_iter(); + inline void clear_has_iter(); + inline void set_has_learned_net(); + inline void clear_has_learned_net(); + inline void set_has_current_step(); + inline void clear_has_current_step(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto > history_; + ::google::protobuf::internal::ArenaStringPtr learned_net_; + ::google::protobuf::int32 iter_; + ::google::protobuf::int32 current_step_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SolverState_default_instance_; + +// ------------------------------------------------------------------- + +class NetState : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.NetState) */ { + public: + NetState(); + virtual ~NetState(); + + NetState(const NetState& from); + + inline NetState& operator=(const NetState& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetState& default_instance(); + + static const NetState* internal_default_instance(); + + void Swap(NetState* other); + + // implements Message ---------------------------------------------- + + inline NetState* New() const { return New(NULL); } + + NetState* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NetState& from); + void MergeFrom(const NetState& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetState* other); + void UnsafeMergeFrom(const NetState& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.Phase phase = 1 [default = TEST]; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 1; + ::caffe::Phase phase() const; + void set_phase(::caffe::Phase value); + + // optional int32 level = 2 [default = 0]; + bool has_level() const; + void clear_level(); + static const int kLevelFieldNumber = 2; + ::google::protobuf::int32 level() const; + void set_level(::google::protobuf::int32 value); + + // repeated string stage = 3; + int stage_size() const; + void clear_stage(); + static const int kStageFieldNumber = 3; + const ::std::string& stage(int index) const; + ::std::string* mutable_stage(int index); + void set_stage(int index, const ::std::string& value); + void set_stage(int index, const char* value); + void set_stage(int index, const char* value, size_t size); + ::std::string* add_stage(); + void add_stage(const ::std::string& value); + void add_stage(const char* value); + void add_stage(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage(); + + // @@protoc_insertion_point(class_scope:caffe.NetState) + private: + inline void set_has_phase(); + inline void clear_has_phase(); + inline void set_has_level(); + inline void clear_has_level(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + ::google::protobuf::int32 level_; + int phase_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NetState_default_instance_; + +// ------------------------------------------------------------------- + +class NetStateRule : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.NetStateRule) */ { + public: + NetStateRule(); + virtual ~NetStateRule(); + + NetStateRule(const NetStateRule& from); + + inline NetStateRule& operator=(const NetStateRule& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetStateRule& default_instance(); + + static const NetStateRule* internal_default_instance(); + + void Swap(NetStateRule* other); + + // implements Message ---------------------------------------------- + + inline NetStateRule* New() const { return New(NULL); } + + NetStateRule* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NetStateRule& from); + void MergeFrom(const NetStateRule& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetStateRule* other); + void UnsafeMergeFrom(const NetStateRule& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.Phase phase = 1; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 1; + ::caffe::Phase phase() const; + void set_phase(::caffe::Phase value); + + // optional int32 min_level = 2; + bool has_min_level() const; + void clear_min_level(); + static const int kMinLevelFieldNumber = 2; + ::google::protobuf::int32 min_level() const; + void set_min_level(::google::protobuf::int32 value); + + // optional int32 max_level = 3; + bool has_max_level() const; + void clear_max_level(); + static const int kMaxLevelFieldNumber = 3; + ::google::protobuf::int32 max_level() const; + void set_max_level(::google::protobuf::int32 value); + + // repeated string stage = 4; + int stage_size() const; + void clear_stage(); + static const int kStageFieldNumber = 4; + const ::std::string& stage(int index) const; + ::std::string* mutable_stage(int index); + void set_stage(int index, const ::std::string& value); + void set_stage(int index, const char* value); + void set_stage(int index, const char* value, size_t size); + ::std::string* add_stage(); + void add_stage(const ::std::string& value); + void add_stage(const char* value); + void add_stage(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage(); + + // repeated string not_stage = 5; + int not_stage_size() const; + void clear_not_stage(); + static const int kNotStageFieldNumber = 5; + const ::std::string& not_stage(int index) const; + ::std::string* mutable_not_stage(int index); + void set_not_stage(int index, const ::std::string& value); + void set_not_stage(int index, const char* value); + void set_not_stage(int index, const char* value, size_t size); + ::std::string* add_not_stage(); + void add_not_stage(const ::std::string& value); + void add_not_stage(const char* value); + void add_not_stage(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& not_stage() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_not_stage(); + + // @@protoc_insertion_point(class_scope:caffe.NetStateRule) + private: + inline void set_has_phase(); + inline void clear_has_phase(); + inline void set_has_min_level(); + inline void clear_has_min_level(); + inline void set_has_max_level(); + inline void clear_has_max_level(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + ::google::protobuf::RepeatedPtrField< ::std::string> not_stage_; + int phase_; + ::google::protobuf::int32 min_level_; + ::google::protobuf::int32 max_level_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NetStateRule_default_instance_; + +// ------------------------------------------------------------------- + +class ParamSpec : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ParamSpec) */ { + public: + ParamSpec(); + virtual ~ParamSpec(); + + ParamSpec(const ParamSpec& from); + + inline ParamSpec& operator=(const ParamSpec& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ParamSpec& default_instance(); + + static const ParamSpec* internal_default_instance(); + + void Swap(ParamSpec* other); + + // implements Message ---------------------------------------------- + + inline ParamSpec* New() const { return New(NULL); } + + ParamSpec* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ParamSpec& from); + void MergeFrom(const ParamSpec& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ParamSpec* other); + void UnsafeMergeFrom(const ParamSpec& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef ParamSpec_DimCheckMode DimCheckMode; + static const DimCheckMode STRICT = + ParamSpec_DimCheckMode_STRICT; + static const DimCheckMode PERMISSIVE = + ParamSpec_DimCheckMode_PERMISSIVE; + static inline bool DimCheckMode_IsValid(int value) { + return ParamSpec_DimCheckMode_IsValid(value); + } + static const DimCheckMode DimCheckMode_MIN = + ParamSpec_DimCheckMode_DimCheckMode_MIN; + static const DimCheckMode DimCheckMode_MAX = + ParamSpec_DimCheckMode_DimCheckMode_MAX; + static const int DimCheckMode_ARRAYSIZE = + ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + DimCheckMode_descriptor() { + return ParamSpec_DimCheckMode_descriptor(); + } + static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) { + return ParamSpec_DimCheckMode_Name(value); + } + static inline bool DimCheckMode_Parse(const ::std::string& name, + DimCheckMode* value) { + return ParamSpec_DimCheckMode_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional .caffe.ParamSpec.DimCheckMode share_mode = 2; + bool has_share_mode() const; + void clear_share_mode(); + static const int kShareModeFieldNumber = 2; + ::caffe::ParamSpec_DimCheckMode share_mode() const; + void set_share_mode(::caffe::ParamSpec_DimCheckMode value); + + // optional float lr_mult = 3 [default = 1]; + bool has_lr_mult() const; + void clear_lr_mult(); + static const int kLrMultFieldNumber = 3; + float lr_mult() const; + void set_lr_mult(float value); + + // optional float decay_mult = 4 [default = 1]; + bool has_decay_mult() const; + void clear_decay_mult(); + static const int kDecayMultFieldNumber = 4; + float decay_mult() const; + void set_decay_mult(float value); + + // @@protoc_insertion_point(class_scope:caffe.ParamSpec) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_share_mode(); + inline void clear_has_share_mode(); + inline void set_has_lr_mult(); + inline void clear_has_lr_mult(); + inline void set_has_decay_mult(); + inline void clear_has_decay_mult(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + int share_mode_; + float lr_mult_; + float decay_mult_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ParamSpec_default_instance_; + +// ------------------------------------------------------------------- + +class LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.LayerParameter) */ { + public: + LayerParameter(); + virtual ~LayerParameter(); + + LayerParameter(const LayerParameter& from); + + inline LayerParameter& operator=(const LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LayerParameter& default_instance(); + + static const LayerParameter* internal_default_instance(); + + void Swap(LayerParameter* other); + + // implements Message ---------------------------------------------- + + inline LayerParameter* New() const { return New(NULL); } + + LayerParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LayerParameter& from); + void MergeFrom(const LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LayerParameter* other); + void UnsafeMergeFrom(const LayerParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional string type = 2; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 2; + const ::std::string& type() const; + void set_type(const ::std::string& value); + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + + // repeated string bottom = 3; + int bottom_size() const; + void clear_bottom(); + static const int kBottomFieldNumber = 3; + const ::std::string& bottom(int index) const; + ::std::string* mutable_bottom(int index); + void set_bottom(int index, const ::std::string& value); + void set_bottom(int index, const char* value); + void set_bottom(int index, const char* value, size_t size); + ::std::string* add_bottom(); + void add_bottom(const ::std::string& value); + void add_bottom(const char* value); + void add_bottom(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom(); + + // repeated string top = 4; + int top_size() const; + void clear_top(); + static const int kTopFieldNumber = 4; + const ::std::string& top(int index) const; + ::std::string* mutable_top(int index); + void set_top(int index, const ::std::string& value); + void set_top(int index, const char* value); + void set_top(int index, const char* value, size_t size); + ::std::string* add_top(); + void add_top(const ::std::string& value); + void add_top(const char* value); + void add_top(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top(); + + // optional .caffe.Phase phase = 10; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 10; + ::caffe::Phase phase() const; + void set_phase(::caffe::Phase value); + + // repeated float loss_weight = 5; + int loss_weight_size() const; + void clear_loss_weight(); + static const int kLossWeightFieldNumber = 5; + float loss_weight(int index) const; + void set_loss_weight(int index, float value); + void add_loss_weight(float value); + const ::google::protobuf::RepeatedField< float >& + loss_weight() const; + ::google::protobuf::RepeatedField< float >* + mutable_loss_weight(); + + // repeated .caffe.ParamSpec param = 6; + int param_size() const; + void clear_param(); + static const int kParamFieldNumber = 6; + const ::caffe::ParamSpec& param(int index) const; + ::caffe::ParamSpec* mutable_param(int index); + ::caffe::ParamSpec* add_param(); + ::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec >* + mutable_param(); + const ::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec >& + param() const; + + // repeated .caffe.BlobProto blobs = 7; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 7; + const ::caffe::BlobProto& blobs(int index) const; + ::caffe::BlobProto* mutable_blobs(int index); + ::caffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& + blobs() const; + + // repeated bool propagate_down = 11; + int propagate_down_size() const; + void clear_propagate_down(); + static const int kPropagateDownFieldNumber = 11; + bool propagate_down(int index) const; + void set_propagate_down(int index, bool value); + void add_propagate_down(bool value); + const ::google::protobuf::RepeatedField< bool >& + propagate_down() const; + ::google::protobuf::RepeatedField< bool >* + mutable_propagate_down(); + + // repeated .caffe.NetStateRule include = 8; + int include_size() const; + void clear_include(); + static const int kIncludeFieldNumber = 8; + const ::caffe::NetStateRule& include(int index) const; + ::caffe::NetStateRule* mutable_include(int index); + ::caffe::NetStateRule* add_include(); + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* + mutable_include(); + const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& + include() const; + + // repeated .caffe.NetStateRule exclude = 9; + int exclude_size() const; + void clear_exclude(); + static const int kExcludeFieldNumber = 9; + const ::caffe::NetStateRule& exclude(int index) const; + ::caffe::NetStateRule* mutable_exclude(int index); + ::caffe::NetStateRule* add_exclude(); + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* + mutable_exclude(); + const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& + exclude() const; + + // optional .caffe.TransformationParameter transform_param = 100; + bool has_transform_param() const; + void clear_transform_param(); + static const int kTransformParamFieldNumber = 100; + const ::caffe::TransformationParameter& transform_param() const; + ::caffe::TransformationParameter* mutable_transform_param(); + ::caffe::TransformationParameter* release_transform_param(); + void set_allocated_transform_param(::caffe::TransformationParameter* transform_param); + + // optional .caffe.LossParameter loss_param = 101; + bool has_loss_param() const; + void clear_loss_param(); + static const int kLossParamFieldNumber = 101; + const ::caffe::LossParameter& loss_param() const; + ::caffe::LossParameter* mutable_loss_param(); + ::caffe::LossParameter* release_loss_param(); + void set_allocated_loss_param(::caffe::LossParameter* loss_param); + + // optional .caffe.AccuracyParameter accuracy_param = 102; + bool has_accuracy_param() const; + void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 102; + const ::caffe::AccuracyParameter& accuracy_param() const; + ::caffe::AccuracyParameter* mutable_accuracy_param(); + ::caffe::AccuracyParameter* release_accuracy_param(); + void set_allocated_accuracy_param(::caffe::AccuracyParameter* accuracy_param); + + // optional .caffe.ArgMaxParameter argmax_param = 103; + bool has_argmax_param() const; + void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 103; + const ::caffe::ArgMaxParameter& argmax_param() const; + ::caffe::ArgMaxParameter* mutable_argmax_param(); + ::caffe::ArgMaxParameter* release_argmax_param(); + void set_allocated_argmax_param(::caffe::ArgMaxParameter* argmax_param); + + // optional .caffe.BatchNormParameter batch_norm_param = 139; + bool has_batch_norm_param() const; + void clear_batch_norm_param(); + static const int kBatchNormParamFieldNumber = 139; + const ::caffe::BatchNormParameter& batch_norm_param() const; + ::caffe::BatchNormParameter* mutable_batch_norm_param(); + ::caffe::BatchNormParameter* release_batch_norm_param(); + void set_allocated_batch_norm_param(::caffe::BatchNormParameter* batch_norm_param); + + // optional .caffe.BiasParameter bias_param = 141; + bool has_bias_param() const; + void clear_bias_param(); + static const int kBiasParamFieldNumber = 141; + const ::caffe::BiasParameter& bias_param() const; + ::caffe::BiasParameter* mutable_bias_param(); + ::caffe::BiasParameter* release_bias_param(); + void set_allocated_bias_param(::caffe::BiasParameter* bias_param); + + // optional .caffe.ConcatParameter concat_param = 104; + bool has_concat_param() const; + void clear_concat_param(); + static const int kConcatParamFieldNumber = 104; + const ::caffe::ConcatParameter& concat_param() const; + ::caffe::ConcatParameter* mutable_concat_param(); + ::caffe::ConcatParameter* release_concat_param(); + void set_allocated_concat_param(::caffe::ConcatParameter* concat_param); + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; + bool has_contrastive_loss_param() const; + void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 105; + const ::caffe::ContrastiveLossParameter& contrastive_loss_param() const; + ::caffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + ::caffe::ContrastiveLossParameter* release_contrastive_loss_param(); + void set_allocated_contrastive_loss_param(::caffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .caffe.ConvolutionParameter convolution_param = 106; + bool has_convolution_param() const; + void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 106; + const ::caffe::ConvolutionParameter& convolution_param() const; + ::caffe::ConvolutionParameter* mutable_convolution_param(); + ::caffe::ConvolutionParameter* release_convolution_param(); + void set_allocated_convolution_param(::caffe::ConvolutionParameter* convolution_param); + + // optional .caffe.CropParameter crop_param = 144; + bool has_crop_param() const; + void clear_crop_param(); + static const int kCropParamFieldNumber = 144; + const ::caffe::CropParameter& crop_param() const; + ::caffe::CropParameter* mutable_crop_param(); + ::caffe::CropParameter* release_crop_param(); + void set_allocated_crop_param(::caffe::CropParameter* crop_param); + + // optional .caffe.DataParameter data_param = 107; + bool has_data_param() const; + void clear_data_param(); + static const int kDataParamFieldNumber = 107; + const ::caffe::DataParameter& data_param() const; + ::caffe::DataParameter* mutable_data_param(); + ::caffe::DataParameter* release_data_param(); + void set_allocated_data_param(::caffe::DataParameter* data_param); + + // optional .caffe.DetectionOutputParameter detection_output_param = 147; + bool has_detection_output_param() const; + void clear_detection_output_param(); + static const int kDetectionOutputParamFieldNumber = 147; + const ::caffe::DetectionOutputParameter& detection_output_param() const; + ::caffe::DetectionOutputParameter* mutable_detection_output_param(); + ::caffe::DetectionOutputParameter* release_detection_output_param(); + void set_allocated_detection_output_param(::caffe::DetectionOutputParameter* detection_output_param); + + // optional .caffe.DropoutParameter dropout_param = 108; + bool has_dropout_param() const; + void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 108; + const ::caffe::DropoutParameter& dropout_param() const; + ::caffe::DropoutParameter* mutable_dropout_param(); + ::caffe::DropoutParameter* release_dropout_param(); + void set_allocated_dropout_param(::caffe::DropoutParameter* dropout_param); + + // optional .caffe.DummyDataParameter dummy_data_param = 109; + bool has_dummy_data_param() const; + void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 109; + const ::caffe::DummyDataParameter& dummy_data_param() const; + ::caffe::DummyDataParameter* mutable_dummy_data_param(); + ::caffe::DummyDataParameter* release_dummy_data_param(); + void set_allocated_dummy_data_param(::caffe::DummyDataParameter* dummy_data_param); + + // optional .caffe.EltwiseParameter eltwise_param = 110; + bool has_eltwise_param() const; + void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 110; + const ::caffe::EltwiseParameter& eltwise_param() const; + ::caffe::EltwiseParameter* mutable_eltwise_param(); + ::caffe::EltwiseParameter* release_eltwise_param(); + void set_allocated_eltwise_param(::caffe::EltwiseParameter* eltwise_param); + + // optional .caffe.ELUParameter elu_param = 140; + bool has_elu_param() const; + void clear_elu_param(); + static const int kEluParamFieldNumber = 140; + const ::caffe::ELUParameter& elu_param() const; + ::caffe::ELUParameter* mutable_elu_param(); + ::caffe::ELUParameter* release_elu_param(); + void set_allocated_elu_param(::caffe::ELUParameter* elu_param); + + // optional .caffe.EmbedParameter embed_param = 137; + bool has_embed_param() const; + void clear_embed_param(); + static const int kEmbedParamFieldNumber = 137; + const ::caffe::EmbedParameter& embed_param() const; + ::caffe::EmbedParameter* mutable_embed_param(); + ::caffe::EmbedParameter* release_embed_param(); + void set_allocated_embed_param(::caffe::EmbedParameter* embed_param); + + // optional .caffe.ExpParameter exp_param = 111; + bool has_exp_param() const; + void clear_exp_param(); + static const int kExpParamFieldNumber = 111; + const ::caffe::ExpParameter& exp_param() const; + ::caffe::ExpParameter* mutable_exp_param(); + ::caffe::ExpParameter* release_exp_param(); + void set_allocated_exp_param(::caffe::ExpParameter* exp_param); + + // optional .caffe.FlattenParameter flatten_param = 135; + bool has_flatten_param() const; + void clear_flatten_param(); + static const int kFlattenParamFieldNumber = 135; + const ::caffe::FlattenParameter& flatten_param() const; + ::caffe::FlattenParameter* mutable_flatten_param(); + ::caffe::FlattenParameter* release_flatten_param(); + void set_allocated_flatten_param(::caffe::FlattenParameter* flatten_param); + + // optional .caffe.HDF5DataParameter hdf5_data_param = 112; + bool has_hdf5_data_param() const; + void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 112; + const ::caffe::HDF5DataParameter& hdf5_data_param() const; + ::caffe::HDF5DataParameter* mutable_hdf5_data_param(); + ::caffe::HDF5DataParameter* release_hdf5_data_param(); + void set_allocated_hdf5_data_param(::caffe::HDF5DataParameter* hdf5_data_param); + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 113; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 113; + const ::caffe::HDF5OutputParameter& hdf5_output_param() const; + ::caffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::caffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param); + + // optional .caffe.HingeLossParameter hinge_loss_param = 114; + bool has_hinge_loss_param() const; + void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 114; + const ::caffe::HingeLossParameter& hinge_loss_param() const; + ::caffe::HingeLossParameter* mutable_hinge_loss_param(); + ::caffe::HingeLossParameter* release_hinge_loss_param(); + void set_allocated_hinge_loss_param(::caffe::HingeLossParameter* hinge_loss_param); + + // optional .caffe.ImageDataParameter image_data_param = 115; + bool has_image_data_param() const; + void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 115; + const ::caffe::ImageDataParameter& image_data_param() const; + ::caffe::ImageDataParameter* mutable_image_data_param(); + ::caffe::ImageDataParameter* release_image_data_param(); + void set_allocated_image_data_param(::caffe::ImageDataParameter* image_data_param); + + // optional .caffe.InfogainLossParameter infogain_loss_param = 116; + bool has_infogain_loss_param() const; + void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 116; + const ::caffe::InfogainLossParameter& infogain_loss_param() const; + ::caffe::InfogainLossParameter* mutable_infogain_loss_param(); + ::caffe::InfogainLossParameter* release_infogain_loss_param(); + void set_allocated_infogain_loss_param(::caffe::InfogainLossParameter* infogain_loss_param); + + // optional .caffe.InnerProductParameter inner_product_param = 117; + bool has_inner_product_param() const; + void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 117; + const ::caffe::InnerProductParameter& inner_product_param() const; + ::caffe::InnerProductParameter* mutable_inner_product_param(); + ::caffe::InnerProductParameter* release_inner_product_param(); + void set_allocated_inner_product_param(::caffe::InnerProductParameter* inner_product_param); + + // optional .caffe.InputParameter input_param = 143; + bool has_input_param() const; + void clear_input_param(); + static const int kInputParamFieldNumber = 143; + const ::caffe::InputParameter& input_param() const; + ::caffe::InputParameter* mutable_input_param(); + ::caffe::InputParameter* release_input_param(); + void set_allocated_input_param(::caffe::InputParameter* input_param); + + // optional .caffe.LogParameter log_param = 134; + bool has_log_param() const; + void clear_log_param(); + static const int kLogParamFieldNumber = 134; + const ::caffe::LogParameter& log_param() const; + ::caffe::LogParameter* mutable_log_param(); + ::caffe::LogParameter* release_log_param(); + void set_allocated_log_param(::caffe::LogParameter* log_param); + + // optional .caffe.LRNParameter lrn_param = 118; + bool has_lrn_param() const; + void clear_lrn_param(); + static const int kLrnParamFieldNumber = 118; + const ::caffe::LRNParameter& lrn_param() const; + ::caffe::LRNParameter* mutable_lrn_param(); + ::caffe::LRNParameter* release_lrn_param(); + void set_allocated_lrn_param(::caffe::LRNParameter* lrn_param); + + // optional .caffe.MemoryDataParameter memory_data_param = 119; + bool has_memory_data_param() const; + void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 119; + const ::caffe::MemoryDataParameter& memory_data_param() const; + ::caffe::MemoryDataParameter* mutable_memory_data_param(); + ::caffe::MemoryDataParameter* release_memory_data_param(); + void set_allocated_memory_data_param(::caffe::MemoryDataParameter* memory_data_param); + + // optional .caffe.MVNParameter mvn_param = 120; + bool has_mvn_param() const; + void clear_mvn_param(); + static const int kMvnParamFieldNumber = 120; + const ::caffe::MVNParameter& mvn_param() const; + ::caffe::MVNParameter* mutable_mvn_param(); + ::caffe::MVNParameter* release_mvn_param(); + void set_allocated_mvn_param(::caffe::MVNParameter* mvn_param); + + // optional .caffe.NormalizeBBoxParameter norm_param = 149; + bool has_norm_param() const; + void clear_norm_param(); + static const int kNormParamFieldNumber = 149; + const ::caffe::NormalizeBBoxParameter& norm_param() const; + ::caffe::NormalizeBBoxParameter* mutable_norm_param(); + ::caffe::NormalizeBBoxParameter* release_norm_param(); + void set_allocated_norm_param(::caffe::NormalizeBBoxParameter* norm_param); + + // optional .caffe.PermuteParameter permute_param = 148; + bool has_permute_param() const; + void clear_permute_param(); + static const int kPermuteParamFieldNumber = 148; + const ::caffe::PermuteParameter& permute_param() const; + ::caffe::PermuteParameter* mutable_permute_param(); + ::caffe::PermuteParameter* release_permute_param(); + void set_allocated_permute_param(::caffe::PermuteParameter* permute_param); + + // optional .caffe.ParameterParameter parameter_param = 145; + bool has_parameter_param() const; + void clear_parameter_param(); + static const int kParameterParamFieldNumber = 145; + const ::caffe::ParameterParameter& parameter_param() const; + ::caffe::ParameterParameter* mutable_parameter_param(); + ::caffe::ParameterParameter* release_parameter_param(); + void set_allocated_parameter_param(::caffe::ParameterParameter* parameter_param); + + // optional .caffe.PoolingParameter pooling_param = 121; + bool has_pooling_param() const; + void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 121; + const ::caffe::PoolingParameter& pooling_param() const; + ::caffe::PoolingParameter* mutable_pooling_param(); + ::caffe::PoolingParameter* release_pooling_param(); + void set_allocated_pooling_param(::caffe::PoolingParameter* pooling_param); + + // optional .caffe.PowerParameter power_param = 122; + bool has_power_param() const; + void clear_power_param(); + static const int kPowerParamFieldNumber = 122; + const ::caffe::PowerParameter& power_param() const; + ::caffe::PowerParameter* mutable_power_param(); + ::caffe::PowerParameter* release_power_param(); + void set_allocated_power_param(::caffe::PowerParameter* power_param); + + // optional .caffe.PReLUParameter prelu_param = 131; + bool has_prelu_param() const; + void clear_prelu_param(); + static const int kPreluParamFieldNumber = 131; + const ::caffe::PReLUParameter& prelu_param() const; + ::caffe::PReLUParameter* mutable_prelu_param(); + ::caffe::PReLUParameter* release_prelu_param(); + void set_allocated_prelu_param(::caffe::PReLUParameter* prelu_param); + + // optional .caffe.PriorBoxParameter prior_box_param = 150; + bool has_prior_box_param() const; + void clear_prior_box_param(); + static const int kPriorBoxParamFieldNumber = 150; + const ::caffe::PriorBoxParameter& prior_box_param() const; + ::caffe::PriorBoxParameter* mutable_prior_box_param(); + ::caffe::PriorBoxParameter* release_prior_box_param(); + void set_allocated_prior_box_param(::caffe::PriorBoxParameter* prior_box_param); + + // optional .caffe.PythonParameter python_param = 130; + bool has_python_param() const; + void clear_python_param(); + static const int kPythonParamFieldNumber = 130; + const ::caffe::PythonParameter& python_param() const; + ::caffe::PythonParameter* mutable_python_param(); + ::caffe::PythonParameter* release_python_param(); + void set_allocated_python_param(::caffe::PythonParameter* python_param); + + // optional .caffe.RecurrentParameter recurrent_param = 146; + bool has_recurrent_param() const; + void clear_recurrent_param(); + static const int kRecurrentParamFieldNumber = 146; + const ::caffe::RecurrentParameter& recurrent_param() const; + ::caffe::RecurrentParameter* mutable_recurrent_param(); + ::caffe::RecurrentParameter* release_recurrent_param(); + void set_allocated_recurrent_param(::caffe::RecurrentParameter* recurrent_param); + + // optional .caffe.ReductionParameter reduction_param = 136; + bool has_reduction_param() const; + void clear_reduction_param(); + static const int kReductionParamFieldNumber = 136; + const ::caffe::ReductionParameter& reduction_param() const; + ::caffe::ReductionParameter* mutable_reduction_param(); + ::caffe::ReductionParameter* release_reduction_param(); + void set_allocated_reduction_param(::caffe::ReductionParameter* reduction_param); + + // optional .caffe.ReLUParameter relu_param = 123; + bool has_relu_param() const; + void clear_relu_param(); + static const int kReluParamFieldNumber = 123; + const ::caffe::ReLUParameter& relu_param() const; + ::caffe::ReLUParameter* mutable_relu_param(); + ::caffe::ReLUParameter* release_relu_param(); + void set_allocated_relu_param(::caffe::ReLUParameter* relu_param); + + // optional .caffe.ReshapeParameter reshape_param = 133; + bool has_reshape_param() const; + void clear_reshape_param(); + static const int kReshapeParamFieldNumber = 133; + const ::caffe::ReshapeParameter& reshape_param() const; + ::caffe::ReshapeParameter* mutable_reshape_param(); + ::caffe::ReshapeParameter* release_reshape_param(); + void set_allocated_reshape_param(::caffe::ReshapeParameter* reshape_param); + + // optional .caffe.ScaleParameter scale_param = 142; + bool has_scale_param() const; + void clear_scale_param(); + static const int kScaleParamFieldNumber = 142; + const ::caffe::ScaleParameter& scale_param() const; + ::caffe::ScaleParameter* mutable_scale_param(); + ::caffe::ScaleParameter* release_scale_param(); + void set_allocated_scale_param(::caffe::ScaleParameter* scale_param); + + // optional .caffe.SigmoidParameter sigmoid_param = 124; + bool has_sigmoid_param() const; + void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 124; + const ::caffe::SigmoidParameter& sigmoid_param() const; + ::caffe::SigmoidParameter* mutable_sigmoid_param(); + ::caffe::SigmoidParameter* release_sigmoid_param(); + void set_allocated_sigmoid_param(::caffe::SigmoidParameter* sigmoid_param); + + // optional .caffe.SoftmaxParameter softmax_param = 125; + bool has_softmax_param() const; + void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 125; + const ::caffe::SoftmaxParameter& softmax_param() const; + ::caffe::SoftmaxParameter* mutable_softmax_param(); + ::caffe::SoftmaxParameter* release_softmax_param(); + void set_allocated_softmax_param(::caffe::SoftmaxParameter* softmax_param); + + // optional .caffe.SPPParameter spp_param = 132; + bool has_spp_param() const; + void clear_spp_param(); + static const int kSppParamFieldNumber = 132; + const ::caffe::SPPParameter& spp_param() const; + ::caffe::SPPParameter* mutable_spp_param(); + ::caffe::SPPParameter* release_spp_param(); + void set_allocated_spp_param(::caffe::SPPParameter* spp_param); + + // optional .caffe.SliceParameter slice_param = 126; + bool has_slice_param() const; + void clear_slice_param(); + static const int kSliceParamFieldNumber = 126; + const ::caffe::SliceParameter& slice_param() const; + ::caffe::SliceParameter* mutable_slice_param(); + ::caffe::SliceParameter* release_slice_param(); + void set_allocated_slice_param(::caffe::SliceParameter* slice_param); + + // optional .caffe.TanHParameter tanh_param = 127; + bool has_tanh_param() const; + void clear_tanh_param(); + static const int kTanhParamFieldNumber = 127; + const ::caffe::TanHParameter& tanh_param() const; + ::caffe::TanHParameter* mutable_tanh_param(); + ::caffe::TanHParameter* release_tanh_param(); + void set_allocated_tanh_param(::caffe::TanHParameter* tanh_param); + + // optional .caffe.ThresholdParameter threshold_param = 128; + bool has_threshold_param() const; + void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 128; + const ::caffe::ThresholdParameter& threshold_param() const; + ::caffe::ThresholdParameter* mutable_threshold_param(); + ::caffe::ThresholdParameter* release_threshold_param(); + void set_allocated_threshold_param(::caffe::ThresholdParameter* threshold_param); + + // optional .caffe.TileParameter tile_param = 138; + bool has_tile_param() const; + void clear_tile_param(); + static const int kTileParamFieldNumber = 138; + const ::caffe::TileParameter& tile_param() const; + ::caffe::TileParameter* mutable_tile_param(); + ::caffe::TileParameter* release_tile_param(); + void set_allocated_tile_param(::caffe::TileParameter* tile_param); + + // optional .caffe.WindowDataParameter window_data_param = 129; + bool has_window_data_param() const; + void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 129; + const ::caffe::WindowDataParameter& window_data_param() const; + ::caffe::WindowDataParameter* mutable_window_data_param(); + ::caffe::WindowDataParameter* release_window_data_param(); + void set_allocated_window_data_param(::caffe::WindowDataParameter* window_data_param); + + // @@protoc_insertion_point(class_scope:caffe.LayerParameter) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_phase(); + inline void clear_has_phase(); + inline void set_has_transform_param(); + inline void clear_has_transform_param(); + inline void set_has_loss_param(); + inline void clear_has_loss_param(); + inline void set_has_accuracy_param(); + inline void clear_has_accuracy_param(); + inline void set_has_argmax_param(); + inline void clear_has_argmax_param(); + inline void set_has_batch_norm_param(); + inline void clear_has_batch_norm_param(); + inline void set_has_bias_param(); + inline void clear_has_bias_param(); + inline void set_has_concat_param(); + inline void clear_has_concat_param(); + inline void set_has_contrastive_loss_param(); + inline void clear_has_contrastive_loss_param(); + inline void set_has_convolution_param(); + inline void clear_has_convolution_param(); + inline void set_has_crop_param(); + inline void clear_has_crop_param(); + inline void set_has_data_param(); + inline void clear_has_data_param(); + inline void set_has_detection_output_param(); + inline void clear_has_detection_output_param(); + inline void set_has_dropout_param(); + inline void clear_has_dropout_param(); + inline void set_has_dummy_data_param(); + inline void clear_has_dummy_data_param(); + inline void set_has_eltwise_param(); + inline void clear_has_eltwise_param(); + inline void set_has_elu_param(); + inline void clear_has_elu_param(); + inline void set_has_embed_param(); + inline void clear_has_embed_param(); + inline void set_has_exp_param(); + inline void clear_has_exp_param(); + inline void set_has_flatten_param(); + inline void clear_has_flatten_param(); + inline void set_has_hdf5_data_param(); + inline void clear_has_hdf5_data_param(); + inline void set_has_hdf5_output_param(); + inline void clear_has_hdf5_output_param(); + inline void set_has_hinge_loss_param(); + inline void clear_has_hinge_loss_param(); + inline void set_has_image_data_param(); + inline void clear_has_image_data_param(); + inline void set_has_infogain_loss_param(); + inline void clear_has_infogain_loss_param(); + inline void set_has_inner_product_param(); + inline void clear_has_inner_product_param(); + inline void set_has_input_param(); + inline void clear_has_input_param(); + inline void set_has_log_param(); + inline void clear_has_log_param(); + inline void set_has_lrn_param(); + inline void clear_has_lrn_param(); + inline void set_has_memory_data_param(); + inline void clear_has_memory_data_param(); + inline void set_has_mvn_param(); + inline void clear_has_mvn_param(); + inline void set_has_norm_param(); + inline void clear_has_norm_param(); + inline void set_has_permute_param(); + inline void clear_has_permute_param(); + inline void set_has_parameter_param(); + inline void clear_has_parameter_param(); + inline void set_has_pooling_param(); + inline void clear_has_pooling_param(); + inline void set_has_power_param(); + inline void clear_has_power_param(); + inline void set_has_prelu_param(); + inline void clear_has_prelu_param(); + inline void set_has_prior_box_param(); + inline void clear_has_prior_box_param(); + inline void set_has_python_param(); + inline void clear_has_python_param(); + inline void set_has_recurrent_param(); + inline void clear_has_recurrent_param(); + inline void set_has_reduction_param(); + inline void clear_has_reduction_param(); + inline void set_has_relu_param(); + inline void clear_has_relu_param(); + inline void set_has_reshape_param(); + inline void clear_has_reshape_param(); + inline void set_has_scale_param(); + inline void clear_has_scale_param(); + inline void set_has_sigmoid_param(); + inline void clear_has_sigmoid_param(); + inline void set_has_softmax_param(); + inline void clear_has_softmax_param(); + inline void set_has_spp_param(); + inline void clear_has_spp_param(); + inline void set_has_slice_param(); + inline void clear_has_slice_param(); + inline void set_has_tanh_param(); + inline void clear_has_tanh_param(); + inline void set_has_threshold_param(); + inline void clear_has_threshold_param(); + inline void set_has_tile_param(); + inline void clear_has_tile_param(); + inline void set_has_window_data_param(); + inline void clear_has_window_data_param(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<2> _has_bits_; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::RepeatedField< float > loss_weight_; + ::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec > param_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto > blobs_; + ::google::protobuf::RepeatedField< bool > propagate_down_; + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule > exclude_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::caffe::TransformationParameter* transform_param_; + ::caffe::LossParameter* loss_param_; + ::caffe::AccuracyParameter* accuracy_param_; + ::caffe::ArgMaxParameter* argmax_param_; + ::caffe::BatchNormParameter* batch_norm_param_; + ::caffe::BiasParameter* bias_param_; + ::caffe::ConcatParameter* concat_param_; + ::caffe::ContrastiveLossParameter* contrastive_loss_param_; + ::caffe::ConvolutionParameter* convolution_param_; + ::caffe::CropParameter* crop_param_; + ::caffe::DataParameter* data_param_; + ::caffe::DetectionOutputParameter* detection_output_param_; + ::caffe::DropoutParameter* dropout_param_; + ::caffe::DummyDataParameter* dummy_data_param_; + ::caffe::EltwiseParameter* eltwise_param_; + ::caffe::ELUParameter* elu_param_; + ::caffe::EmbedParameter* embed_param_; + ::caffe::ExpParameter* exp_param_; + ::caffe::FlattenParameter* flatten_param_; + ::caffe::HDF5DataParameter* hdf5_data_param_; + ::caffe::HDF5OutputParameter* hdf5_output_param_; + ::caffe::HingeLossParameter* hinge_loss_param_; + ::caffe::ImageDataParameter* image_data_param_; + ::caffe::InfogainLossParameter* infogain_loss_param_; + ::caffe::InnerProductParameter* inner_product_param_; + ::caffe::InputParameter* input_param_; + ::caffe::LogParameter* log_param_; + ::caffe::LRNParameter* lrn_param_; + ::caffe::MemoryDataParameter* memory_data_param_; + ::caffe::MVNParameter* mvn_param_; + ::caffe::NormalizeBBoxParameter* norm_param_; + ::caffe::PermuteParameter* permute_param_; + ::caffe::ParameterParameter* parameter_param_; + ::caffe::PoolingParameter* pooling_param_; + ::caffe::PowerParameter* power_param_; + ::caffe::PReLUParameter* prelu_param_; + ::caffe::PriorBoxParameter* prior_box_param_; + ::caffe::PythonParameter* python_param_; + ::caffe::RecurrentParameter* recurrent_param_; + ::caffe::ReductionParameter* reduction_param_; + ::caffe::ReLUParameter* relu_param_; + ::caffe::ReshapeParameter* reshape_param_; + ::caffe::ScaleParameter* scale_param_; + ::caffe::SigmoidParameter* sigmoid_param_; + ::caffe::SoftmaxParameter* softmax_param_; + ::caffe::SPPParameter* spp_param_; + ::caffe::SliceParameter* slice_param_; + ::caffe::TanHParameter* tanh_param_; + ::caffe::ThresholdParameter* threshold_param_; + ::caffe::TileParameter* tile_param_; + ::caffe::WindowDataParameter* window_data_param_; + int phase_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed LayerParameter_default_instance_; + +// ------------------------------------------------------------------- + +class TransformationParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.TransformationParameter) */ { + public: + TransformationParameter(); + virtual ~TransformationParameter(); + + TransformationParameter(const TransformationParameter& from); + + inline TransformationParameter& operator=(const TransformationParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TransformationParameter& default_instance(); + + static const TransformationParameter* internal_default_instance(); + + void Swap(TransformationParameter* other); + + // implements Message ---------------------------------------------- + + inline TransformationParameter* New() const { return New(NULL); } + + TransformationParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TransformationParameter& from); + void MergeFrom(const TransformationParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TransformationParameter* other); + void UnsafeMergeFrom(const TransformationParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float scale = 1 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 1; + float scale() const; + void set_scale(float value); + + // optional bool mirror = 2 [default = false]; + bool has_mirror() const; + void clear_mirror(); + static const int kMirrorFieldNumber = 2; + bool mirror() const; + void set_mirror(bool value); + + // optional uint32 crop_size = 3 [default = 0]; + bool has_crop_size() const; + void clear_crop_size(); + static const int kCropSizeFieldNumber = 3; + ::google::protobuf::uint32 crop_size() const; + void set_crop_size(::google::protobuf::uint32 value); + + // optional string mean_file = 4; + bool has_mean_file() const; + void clear_mean_file(); + static const int kMeanFileFieldNumber = 4; + const ::std::string& mean_file() const; + void set_mean_file(const ::std::string& value); + void set_mean_file(const char* value); + void set_mean_file(const char* value, size_t size); + ::std::string* mutable_mean_file(); + ::std::string* release_mean_file(); + void set_allocated_mean_file(::std::string* mean_file); + + // repeated float mean_value = 5; + int mean_value_size() const; + void clear_mean_value(); + static const int kMeanValueFieldNumber = 5; + float mean_value(int index) const; + void set_mean_value(int index, float value); + void add_mean_value(float value); + const ::google::protobuf::RepeatedField< float >& + mean_value() const; + ::google::protobuf::RepeatedField< float >* + mutable_mean_value(); + + // optional bool force_color = 6 [default = false]; + bool has_force_color() const; + void clear_force_color(); + static const int kForceColorFieldNumber = 6; + bool force_color() const; + void set_force_color(bool value); + + // optional bool force_gray = 7 [default = false]; + bool has_force_gray() const; + void clear_force_gray(); + static const int kForceGrayFieldNumber = 7; + bool force_gray() const; + void set_force_gray(bool value); + + // @@protoc_insertion_point(class_scope:caffe.TransformationParameter) + private: + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_mirror(); + inline void clear_has_mirror(); + inline void set_has_crop_size(); + inline void clear_has_crop_size(); + inline void set_has_mean_file(); + inline void clear_has_mean_file(); + inline void set_has_force_color(); + inline void clear_has_force_color(); + inline void set_has_force_gray(); + inline void clear_has_force_gray(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > mean_value_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool force_color_; + bool force_gray_; + float scale_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed TransformationParameter_default_instance_; + +// ------------------------------------------------------------------- + +class LossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.LossParameter) */ { + public: + LossParameter(); + virtual ~LossParameter(); + + LossParameter(const LossParameter& from); + + inline LossParameter& operator=(const LossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LossParameter& default_instance(); + + static const LossParameter* internal_default_instance(); + + void Swap(LossParameter* other); + + // implements Message ---------------------------------------------- + + inline LossParameter* New() const { return New(NULL); } + + LossParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LossParameter& from); + void MergeFrom(const LossParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LossParameter* other); + void UnsafeMergeFrom(const LossParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef LossParameter_NormalizationMode NormalizationMode; + static const NormalizationMode FULL = + LossParameter_NormalizationMode_FULL; + static const NormalizationMode VALID = + LossParameter_NormalizationMode_VALID; + static const NormalizationMode BATCH_SIZE = + LossParameter_NormalizationMode_BATCH_SIZE; + static const NormalizationMode NONE = + LossParameter_NormalizationMode_NONE; + static inline bool NormalizationMode_IsValid(int value) { + return LossParameter_NormalizationMode_IsValid(value); + } + static const NormalizationMode NormalizationMode_MIN = + LossParameter_NormalizationMode_NormalizationMode_MIN; + static const NormalizationMode NormalizationMode_MAX = + LossParameter_NormalizationMode_NormalizationMode_MAX; + static const int NormalizationMode_ARRAYSIZE = + LossParameter_NormalizationMode_NormalizationMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + NormalizationMode_descriptor() { + return LossParameter_NormalizationMode_descriptor(); + } + static inline const ::std::string& NormalizationMode_Name(NormalizationMode value) { + return LossParameter_NormalizationMode_Name(value); + } + static inline bool NormalizationMode_Parse(const ::std::string& name, + NormalizationMode* value) { + return LossParameter_NormalizationMode_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional int32 ignore_label = 1; + bool has_ignore_label() const; + void clear_ignore_label(); + static const int kIgnoreLabelFieldNumber = 1; + ::google::protobuf::int32 ignore_label() const; + void set_ignore_label(::google::protobuf::int32 value); + + // optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + bool has_normalization() const; + void clear_normalization(); + static const int kNormalizationFieldNumber = 3; + ::caffe::LossParameter_NormalizationMode normalization() const; + void set_normalization(::caffe::LossParameter_NormalizationMode value); + + // optional bool normalize = 2; + bool has_normalize() const; + void clear_normalize(); + static const int kNormalizeFieldNumber = 2; + bool normalize() const; + void set_normalize(bool value); + + // @@protoc_insertion_point(class_scope:caffe.LossParameter) + private: + inline void set_has_ignore_label(); + inline void clear_has_ignore_label(); + inline void set_has_normalization(); + inline void clear_has_normalization(); + inline void set_has_normalize(); + inline void clear_has_normalize(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 ignore_label_; + bool normalize_; + int normalization_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed LossParameter_default_instance_; + +// ------------------------------------------------------------------- + +class AccuracyParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.AccuracyParameter) */ { + public: + AccuracyParameter(); + virtual ~AccuracyParameter(); + + AccuracyParameter(const AccuracyParameter& from); + + inline AccuracyParameter& operator=(const AccuracyParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const AccuracyParameter& default_instance(); + + static const AccuracyParameter* internal_default_instance(); + + void Swap(AccuracyParameter* other); + + // implements Message ---------------------------------------------- + + inline AccuracyParameter* New() const { return New(NULL); } + + AccuracyParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const AccuracyParameter& from); + void MergeFrom(const AccuracyParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(AccuracyParameter* other); + void UnsafeMergeFrom(const AccuracyParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 top_k = 1 [default = 1]; + bool has_top_k() const; + void clear_top_k(); + static const int kTopKFieldNumber = 1; + ::google::protobuf::uint32 top_k() const; + void set_top_k(::google::protobuf::uint32 value); + + // optional int32 axis = 2 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 2; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional int32 ignore_label = 3; + bool has_ignore_label() const; + void clear_ignore_label(); + static const int kIgnoreLabelFieldNumber = 3; + ::google::protobuf::int32 ignore_label() const; + void set_ignore_label(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.AccuracyParameter) + private: + inline void set_has_top_k(); + inline void clear_has_top_k(); + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_ignore_label(); + inline void clear_has_ignore_label(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 ignore_label_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed AccuracyParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ArgMaxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ArgMaxParameter) */ { + public: + ArgMaxParameter(); + virtual ~ArgMaxParameter(); + + ArgMaxParameter(const ArgMaxParameter& from); + + inline ArgMaxParameter& operator=(const ArgMaxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ArgMaxParameter& default_instance(); + + static const ArgMaxParameter* internal_default_instance(); + + void Swap(ArgMaxParameter* other); + + // implements Message ---------------------------------------------- + + inline ArgMaxParameter* New() const { return New(NULL); } + + ArgMaxParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ArgMaxParameter& from); + void MergeFrom(const ArgMaxParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ArgMaxParameter* other); + void UnsafeMergeFrom(const ArgMaxParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool out_max_val = 1 [default = false]; + bool has_out_max_val() const; + void clear_out_max_val(); + static const int kOutMaxValFieldNumber = 1; + bool out_max_val() const; + void set_out_max_val(bool value); + + // optional uint32 top_k = 2 [default = 1]; + bool has_top_k() const; + void clear_top_k(); + static const int kTopKFieldNumber = 2; + ::google::protobuf::uint32 top_k() const; + void set_top_k(::google::protobuf::uint32 value); + + // optional int32 axis = 3; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 3; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.ArgMaxParameter) + private: + inline void set_has_out_max_val(); + inline void clear_has_out_max_val(); + inline void set_has_top_k(); + inline void clear_has_top_k(); + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + bool out_max_val_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 top_k_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ArgMaxParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ConcatParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ConcatParameter) */ { + public: + ConcatParameter(); + virtual ~ConcatParameter(); + + ConcatParameter(const ConcatParameter& from); + + inline ConcatParameter& operator=(const ConcatParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ConcatParameter& default_instance(); + + static const ConcatParameter* internal_default_instance(); + + void Swap(ConcatParameter* other); + + // implements Message ---------------------------------------------- + + inline ConcatParameter* New() const { return New(NULL); } + + ConcatParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ConcatParameter& from); + void MergeFrom(const ConcatParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConcatParameter* other); + void UnsafeMergeFrom(const ConcatParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 2 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 2; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional uint32 concat_dim = 1 [default = 1]; + bool has_concat_dim() const; + void clear_concat_dim(); + static const int kConcatDimFieldNumber = 1; + ::google::protobuf::uint32 concat_dim() const; + void set_concat_dim(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:caffe.ConcatParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_concat_dim(); + inline void clear_has_concat_dim(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 concat_dim_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ConcatParameter_default_instance_; + +// ------------------------------------------------------------------- + +class BatchNormParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.BatchNormParameter) */ { + public: + BatchNormParameter(); + virtual ~BatchNormParameter(); + + BatchNormParameter(const BatchNormParameter& from); + + inline BatchNormParameter& operator=(const BatchNormParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BatchNormParameter& default_instance(); + + static const BatchNormParameter* internal_default_instance(); + + void Swap(BatchNormParameter* other); + + // implements Message ---------------------------------------------- + + inline BatchNormParameter* New() const { return New(NULL); } + + BatchNormParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BatchNormParameter& from); + void MergeFrom(const BatchNormParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BatchNormParameter* other); + void UnsafeMergeFrom(const BatchNormParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool use_global_stats = 1; + bool has_use_global_stats() const; + void clear_use_global_stats(); + static const int kUseGlobalStatsFieldNumber = 1; + bool use_global_stats() const; + void set_use_global_stats(bool value); + + // optional float moving_average_fraction = 2 [default = 0.999]; + bool has_moving_average_fraction() const; + void clear_moving_average_fraction(); + static const int kMovingAverageFractionFieldNumber = 2; + float moving_average_fraction() const; + void set_moving_average_fraction(float value); + + // optional float eps = 3 [default = 1e-05]; + bool has_eps() const; + void clear_eps(); + static const int kEpsFieldNumber = 3; + float eps() const; + void set_eps(float value); + + // @@protoc_insertion_point(class_scope:caffe.BatchNormParameter) + private: + inline void set_has_use_global_stats(); + inline void clear_has_use_global_stats(); + inline void set_has_moving_average_fraction(); + inline void clear_has_moving_average_fraction(); + inline void set_has_eps(); + inline void clear_has_eps(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + bool use_global_stats_; + float moving_average_fraction_; + float eps_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed BatchNormParameter_default_instance_; + +// ------------------------------------------------------------------- + +class BiasParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.BiasParameter) */ { + public: + BiasParameter(); + virtual ~BiasParameter(); + + BiasParameter(const BiasParameter& from); + + inline BiasParameter& operator=(const BiasParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BiasParameter& default_instance(); + + static const BiasParameter* internal_default_instance(); + + void Swap(BiasParameter* other); + + // implements Message ---------------------------------------------- + + inline BiasParameter* New() const { return New(NULL); } + + BiasParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BiasParameter& from); + void MergeFrom(const BiasParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BiasParameter* other); + void UnsafeMergeFrom(const BiasParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 1; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 2 [default = 1]; + bool has_num_axes() const; + void clear_num_axes(); + static const int kNumAxesFieldNumber = 2; + ::google::protobuf::int32 num_axes() const; + void set_num_axes(::google::protobuf::int32 value); + + // optional .caffe.FillerParameter filler = 3; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 3; + const ::caffe::FillerParameter& filler() const; + ::caffe::FillerParameter* mutable_filler(); + ::caffe::FillerParameter* release_filler(); + void set_allocated_filler(::caffe::FillerParameter* filler); + + // @@protoc_insertion_point(class_scope:caffe.BiasParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_num_axes(); + inline void clear_has_num_axes(); + inline void set_has_filler(); + inline void clear_has_filler(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* filler_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed BiasParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ContrastiveLossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ContrastiveLossParameter) */ { + public: + ContrastiveLossParameter(); + virtual ~ContrastiveLossParameter(); + + ContrastiveLossParameter(const ContrastiveLossParameter& from); + + inline ContrastiveLossParameter& operator=(const ContrastiveLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ContrastiveLossParameter& default_instance(); + + static const ContrastiveLossParameter* internal_default_instance(); + + void Swap(ContrastiveLossParameter* other); + + // implements Message ---------------------------------------------- + + inline ContrastiveLossParameter* New() const { return New(NULL); } + + ContrastiveLossParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ContrastiveLossParameter& from); + void MergeFrom(const ContrastiveLossParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ContrastiveLossParameter* other); + void UnsafeMergeFrom(const ContrastiveLossParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float margin = 1 [default = 1]; + bool has_margin() const; + void clear_margin(); + static const int kMarginFieldNumber = 1; + float margin() const; + void set_margin(float value); + + // optional bool legacy_version = 2 [default = false]; + bool has_legacy_version() const; + void clear_legacy_version(); + static const int kLegacyVersionFieldNumber = 2; + bool legacy_version() const; + void set_legacy_version(bool value); + + // @@protoc_insertion_point(class_scope:caffe.ContrastiveLossParameter) + private: + inline void set_has_margin(); + inline void clear_has_margin(); + inline void set_has_legacy_version(); + inline void clear_has_legacy_version(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + bool legacy_version_; + float margin_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ContrastiveLossParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ConvolutionParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ConvolutionParameter) */ { + public: + ConvolutionParameter(); + virtual ~ConvolutionParameter(); + + ConvolutionParameter(const ConvolutionParameter& from); + + inline ConvolutionParameter& operator=(const ConvolutionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ConvolutionParameter& default_instance(); + + static const ConvolutionParameter* internal_default_instance(); + + void Swap(ConvolutionParameter* other); + + // implements Message ---------------------------------------------- + + inline ConvolutionParameter* New() const { return New(NULL); } + + ConvolutionParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ConvolutionParameter& from); + void MergeFrom(const ConvolutionParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConvolutionParameter* other); + void UnsafeMergeFrom(const ConvolutionParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef ConvolutionParameter_Engine Engine; + static const Engine DEFAULT = + ConvolutionParameter_Engine_DEFAULT; + static const Engine CAFFE = + ConvolutionParameter_Engine_CAFFE; + static const Engine CUDNN = + ConvolutionParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return ConvolutionParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + ConvolutionParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + ConvolutionParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + ConvolutionParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return ConvolutionParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return ConvolutionParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return ConvolutionParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + bool has_num_output() const; + void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + ::google::protobuf::uint32 num_output() const; + void set_num_output(::google::protobuf::uint32 value); + + // optional bool bias_term = 2 [default = true]; + bool has_bias_term() const; + void clear_bias_term(); + static const int kBiasTermFieldNumber = 2; + bool bias_term() const; + void set_bias_term(bool value); + + // repeated uint32 pad = 3; + int pad_size() const; + void clear_pad(); + static const int kPadFieldNumber = 3; + ::google::protobuf::uint32 pad(int index) const; + void set_pad(int index, ::google::protobuf::uint32 value); + void add_pad(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + pad() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_pad(); + + // repeated uint32 kernel_size = 4; + int kernel_size_size() const; + void clear_kernel_size(); + static const int kKernelSizeFieldNumber = 4; + ::google::protobuf::uint32 kernel_size(int index) const; + void set_kernel_size(int index, ::google::protobuf::uint32 value); + void add_kernel_size(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + kernel_size() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_kernel_size(); + + // repeated uint32 stride = 6; + int stride_size() const; + void clear_stride(); + static const int kStrideFieldNumber = 6; + ::google::protobuf::uint32 stride(int index) const; + void set_stride(int index, ::google::protobuf::uint32 value); + void add_stride(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + stride() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_stride(); + + // repeated uint32 dilation = 18; + int dilation_size() const; + void clear_dilation(); + static const int kDilationFieldNumber = 18; + ::google::protobuf::uint32 dilation(int index) const; + void set_dilation(int index, ::google::protobuf::uint32 value); + void add_dilation(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + dilation() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_dilation(); + + // optional uint32 pad_h = 9 [default = 0]; + bool has_pad_h() const; + void clear_pad_h(); + static const int kPadHFieldNumber = 9; + ::google::protobuf::uint32 pad_h() const; + void set_pad_h(::google::protobuf::uint32 value); + + // optional uint32 pad_w = 10 [default = 0]; + bool has_pad_w() const; + void clear_pad_w(); + static const int kPadWFieldNumber = 10; + ::google::protobuf::uint32 pad_w() const; + void set_pad_w(::google::protobuf::uint32 value); + + // optional uint32 kernel_h = 11; + bool has_kernel_h() const; + void clear_kernel_h(); + static const int kKernelHFieldNumber = 11; + ::google::protobuf::uint32 kernel_h() const; + void set_kernel_h(::google::protobuf::uint32 value); + + // optional uint32 kernel_w = 12; + bool has_kernel_w() const; + void clear_kernel_w(); + static const int kKernelWFieldNumber = 12; + ::google::protobuf::uint32 kernel_w() const; + void set_kernel_w(::google::protobuf::uint32 value); + + // optional uint32 stride_h = 13; + bool has_stride_h() const; + void clear_stride_h(); + static const int kStrideHFieldNumber = 13; + ::google::protobuf::uint32 stride_h() const; + void set_stride_h(::google::protobuf::uint32 value); + + // optional uint32 stride_w = 14; + bool has_stride_w() const; + void clear_stride_w(); + static const int kStrideWFieldNumber = 14; + ::google::protobuf::uint32 stride_w() const; + void set_stride_w(::google::protobuf::uint32 value); + + // optional uint32 group = 5 [default = 1]; + bool has_group() const; + void clear_group(); + static const int kGroupFieldNumber = 5; + ::google::protobuf::uint32 group() const; + void set_group(::google::protobuf::uint32 value); + + // optional .caffe.FillerParameter weight_filler = 7; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 7; + const ::caffe::FillerParameter& weight_filler() const; + ::caffe::FillerParameter* mutable_weight_filler(); + ::caffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::caffe::FillerParameter* weight_filler); + + // optional .caffe.FillerParameter bias_filler = 8; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 8; + const ::caffe::FillerParameter& bias_filler() const; + ::caffe::FillerParameter* mutable_bias_filler(); + ::caffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::caffe::FillerParameter* bias_filler); + + // optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 15; + ::caffe::ConvolutionParameter_Engine engine() const; + void set_engine(::caffe::ConvolutionParameter_Engine value); + + // optional int32 axis = 16 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 16; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional bool force_nd_im2col = 17 [default = false]; + bool has_force_nd_im2col() const; + void clear_force_nd_im2col(); + static const int kForceNdIm2ColFieldNumber = 17; + bool force_nd_im2col() const; + void set_force_nd_im2col(bool value); + + // @@protoc_insertion_point(class_scope:caffe.ConvolutionParameter) + private: + inline void set_has_num_output(); + inline void clear_has_num_output(); + inline void set_has_bias_term(); + inline void clear_has_bias_term(); + inline void set_has_pad_h(); + inline void clear_has_pad_h(); + inline void set_has_pad_w(); + inline void clear_has_pad_w(); + inline void set_has_kernel_h(); + inline void clear_has_kernel_h(); + inline void set_has_kernel_w(); + inline void clear_has_kernel_w(); + inline void set_has_stride_h(); + inline void clear_has_stride_h(); + inline void set_has_stride_w(); + inline void clear_has_stride_w(); + inline void set_has_group(); + inline void clear_has_group(); + inline void set_has_weight_filler(); + inline void clear_has_weight_filler(); + inline void set_has_bias_filler(); + inline void clear_has_bias_filler(); + inline void set_has_engine(); + inline void clear_has_engine(); + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_force_nd_im2col(); + inline void clear_has_force_nd_im2col(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > pad_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > kernel_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > stride_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > dilation_; + ::caffe::FillerParameter* weight_filler_; + ::caffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_h_; + ::google::protobuf::uint32 pad_w_; + ::google::protobuf::uint32 kernel_h_; + ::google::protobuf::uint32 kernel_w_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + int engine_; + bool force_nd_im2col_; + ::google::protobuf::int32 axis_; + bool bias_term_; + ::google::protobuf::uint32 group_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ConvolutionParameter_default_instance_; + +// ------------------------------------------------------------------- + +class CropParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.CropParameter) */ { + public: + CropParameter(); + virtual ~CropParameter(); + + CropParameter(const CropParameter& from); + + inline CropParameter& operator=(const CropParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CropParameter& default_instance(); + + static const CropParameter* internal_default_instance(); + + void Swap(CropParameter* other); + + // implements Message ---------------------------------------------- + + inline CropParameter* New() const { return New(NULL); } + + CropParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const CropParameter& from); + void MergeFrom(const CropParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(CropParameter* other); + void UnsafeMergeFrom(const CropParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 2]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 1; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // repeated uint32 offset = 2; + int offset_size() const; + void clear_offset(); + static const int kOffsetFieldNumber = 2; + ::google::protobuf::uint32 offset(int index) const; + void set_offset(int index, ::google::protobuf::uint32 value); + void add_offset(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + offset() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_offset(); + + // @@protoc_insertion_point(class_scope:caffe.CropParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > offset_; + ::google::protobuf::int32 axis_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed CropParameter_default_instance_; + +// ------------------------------------------------------------------- + +class DataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.DataParameter) */ { + public: + DataParameter(); + virtual ~DataParameter(); + + DataParameter(const DataParameter& from); + + inline DataParameter& operator=(const DataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DataParameter& default_instance(); + + static const DataParameter* internal_default_instance(); + + void Swap(DataParameter* other); + + // implements Message ---------------------------------------------- + + inline DataParameter* New() const { return New(NULL); } + + DataParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DataParameter& from); + void MergeFrom(const DataParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DataParameter* other); + void UnsafeMergeFrom(const DataParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef DataParameter_DB DB; + static const DB LEVELDB = + DataParameter_DB_LEVELDB; + static const DB LMDB = + DataParameter_DB_LMDB; + static inline bool DB_IsValid(int value) { + return DataParameter_DB_IsValid(value); + } + static const DB DB_MIN = + DataParameter_DB_DB_MIN; + static const DB DB_MAX = + DataParameter_DB_DB_MAX; + static const int DB_ARRAYSIZE = + DataParameter_DB_DB_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + DB_descriptor() { + return DataParameter_DB_descriptor(); + } + static inline const ::std::string& DB_Name(DB value) { + return DataParameter_DB_Name(value); + } + static inline bool DB_Parse(const ::std::string& name, + DB* value) { + return DataParameter_DB_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string source = 1; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 1; + const ::std::string& source() const; + void set_source(const ::std::string& value); + void set_source(const char* value); + void set_source(const char* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 4; + bool has_batch_size() const; + void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + ::google::protobuf::uint32 batch_size() const; + void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 rand_skip = 7 [default = 0]; + bool has_rand_skip() const; + void clear_rand_skip(); + static const int kRandSkipFieldNumber = 7; + ::google::protobuf::uint32 rand_skip() const; + void set_rand_skip(::google::protobuf::uint32 value); + + // optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; + bool has_backend() const; + void clear_backend(); + static const int kBackendFieldNumber = 8; + ::caffe::DataParameter_DB backend() const; + void set_backend(::caffe::DataParameter_DB value); + + // optional float scale = 2 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 2; + float scale() const; + void set_scale(float value); + + // optional string mean_file = 3; + bool has_mean_file() const; + void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + const ::std::string& mean_file() const; + void set_mean_file(const ::std::string& value); + void set_mean_file(const char* value); + void set_mean_file(const char* value, size_t size); + ::std::string* mutable_mean_file(); + ::std::string* release_mean_file(); + void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 crop_size = 5 [default = 0]; + bool has_crop_size() const; + void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + ::google::protobuf::uint32 crop_size() const; + void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + bool has_mirror() const; + void clear_mirror(); + static const int kMirrorFieldNumber = 6; + bool mirror() const; + void set_mirror(bool value); + + // optional bool force_encoded_color = 9 [default = false]; + bool has_force_encoded_color() const; + void clear_force_encoded_color(); + static const int kForceEncodedColorFieldNumber = 9; + bool force_encoded_color() const; + void set_force_encoded_color(bool value); + + // optional uint32 prefetch = 10 [default = 4]; + bool has_prefetch() const; + void clear_prefetch(); + static const int kPrefetchFieldNumber = 10; + ::google::protobuf::uint32 prefetch() const; + void set_prefetch(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:caffe.DataParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + inline void set_has_batch_size(); + inline void clear_has_batch_size(); + inline void set_has_rand_skip(); + inline void clear_has_rand_skip(); + inline void set_has_backend(); + inline void clear_has_backend(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_mean_file(); + inline void clear_has_mean_file(); + inline void set_has_crop_size(); + inline void clear_has_crop_size(); + inline void set_has_mirror(); + inline void clear_has_mirror(); + inline void set_has_force_encoded_color(); + inline void clear_has_force_encoded_color(); + inline void set_has_prefetch(); + inline void clear_has_prefetch(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + int backend_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool force_encoded_color_; + float scale_; + ::google::protobuf::uint32 prefetch_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed DataParameter_default_instance_; + +// ------------------------------------------------------------------- + +class NonMaximumSuppressionParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.NonMaximumSuppressionParameter) */ { + public: + NonMaximumSuppressionParameter(); + virtual ~NonMaximumSuppressionParameter(); + + NonMaximumSuppressionParameter(const NonMaximumSuppressionParameter& from); + + inline NonMaximumSuppressionParameter& operator=(const NonMaximumSuppressionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NonMaximumSuppressionParameter& default_instance(); + + static const NonMaximumSuppressionParameter* internal_default_instance(); + + void Swap(NonMaximumSuppressionParameter* other); + + // implements Message ---------------------------------------------- + + inline NonMaximumSuppressionParameter* New() const { return New(NULL); } + + NonMaximumSuppressionParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NonMaximumSuppressionParameter& from); + void MergeFrom(const NonMaximumSuppressionParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NonMaximumSuppressionParameter* other); + void UnsafeMergeFrom(const NonMaximumSuppressionParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float nms_threshold = 1 [default = 0.3]; + bool has_nms_threshold() const; + void clear_nms_threshold(); + static const int kNmsThresholdFieldNumber = 1; + float nms_threshold() const; + void set_nms_threshold(float value); + + // optional int32 top_k = 2; + bool has_top_k() const; + void clear_top_k(); + static const int kTopKFieldNumber = 2; + ::google::protobuf::int32 top_k() const; + void set_top_k(::google::protobuf::int32 value); + + // optional float eta = 3 [default = 1]; + bool has_eta() const; + void clear_eta(); + static const int kEtaFieldNumber = 3; + float eta() const; + void set_eta(float value); + + // @@protoc_insertion_point(class_scope:caffe.NonMaximumSuppressionParameter) + private: + inline void set_has_nms_threshold(); + inline void clear_has_nms_threshold(); + inline void set_has_top_k(); + inline void clear_has_top_k(); + inline void set_has_eta(); + inline void clear_has_eta(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 top_k_; + float nms_threshold_; + float eta_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NonMaximumSuppressionParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SaveOutputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SaveOutputParameter) */ { + public: + SaveOutputParameter(); + virtual ~SaveOutputParameter(); + + SaveOutputParameter(const SaveOutputParameter& from); + + inline SaveOutputParameter& operator=(const SaveOutputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SaveOutputParameter& default_instance(); + + static const SaveOutputParameter* internal_default_instance(); + + void Swap(SaveOutputParameter* other); + + // implements Message ---------------------------------------------- + + inline SaveOutputParameter* New() const { return New(NULL); } + + SaveOutputParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SaveOutputParameter& from); + void MergeFrom(const SaveOutputParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SaveOutputParameter* other); + void UnsafeMergeFrom(const SaveOutputParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string output_directory = 1; + bool has_output_directory() const; + void clear_output_directory(); + static const int kOutputDirectoryFieldNumber = 1; + const ::std::string& output_directory() const; + void set_output_directory(const ::std::string& value); + void set_output_directory(const char* value); + void set_output_directory(const char* value, size_t size); + ::std::string* mutable_output_directory(); + ::std::string* release_output_directory(); + void set_allocated_output_directory(::std::string* output_directory); + + // optional string output_name_prefix = 2; + bool has_output_name_prefix() const; + void clear_output_name_prefix(); + static const int kOutputNamePrefixFieldNumber = 2; + const ::std::string& output_name_prefix() const; + void set_output_name_prefix(const ::std::string& value); + void set_output_name_prefix(const char* value); + void set_output_name_prefix(const char* value, size_t size); + ::std::string* mutable_output_name_prefix(); + ::std::string* release_output_name_prefix(); + void set_allocated_output_name_prefix(::std::string* output_name_prefix); + + // optional string output_format = 3; + bool has_output_format() const; + void clear_output_format(); + static const int kOutputFormatFieldNumber = 3; + const ::std::string& output_format() const; + void set_output_format(const ::std::string& value); + void set_output_format(const char* value); + void set_output_format(const char* value, size_t size); + ::std::string* mutable_output_format(); + ::std::string* release_output_format(); + void set_allocated_output_format(::std::string* output_format); + + // optional string label_map_file = 4; + bool has_label_map_file() const; + void clear_label_map_file(); + static const int kLabelMapFileFieldNumber = 4; + const ::std::string& label_map_file() const; + void set_label_map_file(const ::std::string& value); + void set_label_map_file(const char* value); + void set_label_map_file(const char* value, size_t size); + ::std::string* mutable_label_map_file(); + ::std::string* release_label_map_file(); + void set_allocated_label_map_file(::std::string* label_map_file); + + // optional string name_size_file = 5; + bool has_name_size_file() const; + void clear_name_size_file(); + static const int kNameSizeFileFieldNumber = 5; + const ::std::string& name_size_file() const; + void set_name_size_file(const ::std::string& value); + void set_name_size_file(const char* value); + void set_name_size_file(const char* value, size_t size); + ::std::string* mutable_name_size_file(); + ::std::string* release_name_size_file(); + void set_allocated_name_size_file(::std::string* name_size_file); + + // optional uint32 num_test_image = 6; + bool has_num_test_image() const; + void clear_num_test_image(); + static const int kNumTestImageFieldNumber = 6; + ::google::protobuf::uint32 num_test_image() const; + void set_num_test_image(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:caffe.SaveOutputParameter) + private: + inline void set_has_output_directory(); + inline void clear_has_output_directory(); + inline void set_has_output_name_prefix(); + inline void clear_has_output_name_prefix(); + inline void set_has_output_format(); + inline void clear_has_output_format(); + inline void set_has_label_map_file(); + inline void clear_has_label_map_file(); + inline void set_has_name_size_file(); + inline void clear_has_name_size_file(); + inline void set_has_num_test_image(); + inline void clear_has_num_test_image(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr output_directory_; + ::google::protobuf::internal::ArenaStringPtr output_name_prefix_; + ::google::protobuf::internal::ArenaStringPtr output_format_; + ::google::protobuf::internal::ArenaStringPtr label_map_file_; + ::google::protobuf::internal::ArenaStringPtr name_size_file_; + ::google::protobuf::uint32 num_test_image_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SaveOutputParameter_default_instance_; + +// ------------------------------------------------------------------- + +class DropoutParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.DropoutParameter) */ { + public: + DropoutParameter(); + virtual ~DropoutParameter(); + + DropoutParameter(const DropoutParameter& from); + + inline DropoutParameter& operator=(const DropoutParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DropoutParameter& default_instance(); + + static const DropoutParameter* internal_default_instance(); + + void Swap(DropoutParameter* other); + + // implements Message ---------------------------------------------- + + inline DropoutParameter* New() const { return New(NULL); } + + DropoutParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DropoutParameter& from); + void MergeFrom(const DropoutParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DropoutParameter* other); + void UnsafeMergeFrom(const DropoutParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float dropout_ratio = 1 [default = 0.5]; + bool has_dropout_ratio() const; + void clear_dropout_ratio(); + static const int kDropoutRatioFieldNumber = 1; + float dropout_ratio() const; + void set_dropout_ratio(float value); + + // @@protoc_insertion_point(class_scope:caffe.DropoutParameter) + private: + inline void set_has_dropout_ratio(); + inline void clear_has_dropout_ratio(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float dropout_ratio_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed DropoutParameter_default_instance_; + +// ------------------------------------------------------------------- + +class DummyDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.DummyDataParameter) */ { + public: + DummyDataParameter(); + virtual ~DummyDataParameter(); + + DummyDataParameter(const DummyDataParameter& from); + + inline DummyDataParameter& operator=(const DummyDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DummyDataParameter& default_instance(); + + static const DummyDataParameter* internal_default_instance(); + + void Swap(DummyDataParameter* other); + + // implements Message ---------------------------------------------- + + inline DummyDataParameter* New() const { return New(NULL); } + + DummyDataParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DummyDataParameter& from); + void MergeFrom(const DummyDataParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DummyDataParameter* other); + void UnsafeMergeFrom(const DummyDataParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .caffe.FillerParameter data_filler = 1; + int data_filler_size() const; + void clear_data_filler(); + static const int kDataFillerFieldNumber = 1; + const ::caffe::FillerParameter& data_filler(int index) const; + ::caffe::FillerParameter* mutable_data_filler(int index); + ::caffe::FillerParameter* add_data_filler(); + ::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter >* + mutable_data_filler(); + const ::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter >& + data_filler() const; + + // repeated .caffe.BlobShape shape = 6; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 6; + const ::caffe::BlobShape& shape(int index) const; + ::caffe::BlobShape* mutable_shape(int index); + ::caffe::BlobShape* add_shape(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& + shape() const; + + // repeated uint32 num = 2; + int num_size() const; + void clear_num(); + static const int kNumFieldNumber = 2; + ::google::protobuf::uint32 num(int index) const; + void set_num(int index, ::google::protobuf::uint32 value); + void add_num(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + num() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_num(); + + // repeated uint32 channels = 3; + int channels_size() const; + void clear_channels(); + static const int kChannelsFieldNumber = 3; + ::google::protobuf::uint32 channels(int index) const; + void set_channels(int index, ::google::protobuf::uint32 value); + void add_channels(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + channels() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_channels(); + + // repeated uint32 height = 4; + int height_size() const; + void clear_height(); + static const int kHeightFieldNumber = 4; + ::google::protobuf::uint32 height(int index) const; + void set_height(int index, ::google::protobuf::uint32 value); + void add_height(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + height() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_height(); + + // repeated uint32 width = 5; + int width_size() const; + void clear_width(); + static const int kWidthFieldNumber = 5; + ::google::protobuf::uint32 width(int index) const; + void set_width(int index, ::google::protobuf::uint32 value); + void add_width(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + width() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_width(); + + // @@protoc_insertion_point(class_scope:caffe.DummyDataParameter) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter > data_filler_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape > shape_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > num_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > channels_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > height_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > width_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed DummyDataParameter_default_instance_; + +// ------------------------------------------------------------------- + +class EltwiseParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.EltwiseParameter) */ { + public: + EltwiseParameter(); + virtual ~EltwiseParameter(); + + EltwiseParameter(const EltwiseParameter& from); + + inline EltwiseParameter& operator=(const EltwiseParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EltwiseParameter& default_instance(); + + static const EltwiseParameter* internal_default_instance(); + + void Swap(EltwiseParameter* other); + + // implements Message ---------------------------------------------- + + inline EltwiseParameter* New() const { return New(NULL); } + + EltwiseParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EltwiseParameter& from); + void MergeFrom(const EltwiseParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EltwiseParameter* other); + void UnsafeMergeFrom(const EltwiseParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef EltwiseParameter_EltwiseOp EltwiseOp; + static const EltwiseOp PROD = + EltwiseParameter_EltwiseOp_PROD; + static const EltwiseOp SUM = + EltwiseParameter_EltwiseOp_SUM; + static const EltwiseOp MAX = + EltwiseParameter_EltwiseOp_MAX; + static inline bool EltwiseOp_IsValid(int value) { + return EltwiseParameter_EltwiseOp_IsValid(value); + } + static const EltwiseOp EltwiseOp_MIN = + EltwiseParameter_EltwiseOp_EltwiseOp_MIN; + static const EltwiseOp EltwiseOp_MAX = + EltwiseParameter_EltwiseOp_EltwiseOp_MAX; + static const int EltwiseOp_ARRAYSIZE = + EltwiseParameter_EltwiseOp_EltwiseOp_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + EltwiseOp_descriptor() { + return EltwiseParameter_EltwiseOp_descriptor(); + } + static inline const ::std::string& EltwiseOp_Name(EltwiseOp value) { + return EltwiseParameter_EltwiseOp_Name(value); + } + static inline bool EltwiseOp_Parse(const ::std::string& name, + EltwiseOp* value) { + return EltwiseParameter_EltwiseOp_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + bool has_operation() const; + void clear_operation(); + static const int kOperationFieldNumber = 1; + ::caffe::EltwiseParameter_EltwiseOp operation() const; + void set_operation(::caffe::EltwiseParameter_EltwiseOp value); + + // repeated float coeff = 2; + int coeff_size() const; + void clear_coeff(); + static const int kCoeffFieldNumber = 2; + float coeff(int index) const; + void set_coeff(int index, float value); + void add_coeff(float value); + const ::google::protobuf::RepeatedField< float >& + coeff() const; + ::google::protobuf::RepeatedField< float >* + mutable_coeff(); + + // optional bool stable_prod_grad = 3 [default = true]; + bool has_stable_prod_grad() const; + void clear_stable_prod_grad(); + static const int kStableProdGradFieldNumber = 3; + bool stable_prod_grad() const; + void set_stable_prod_grad(bool value); + + // @@protoc_insertion_point(class_scope:caffe.EltwiseParameter) + private: + inline void set_has_operation(); + inline void clear_has_operation(); + inline void set_has_stable_prod_grad(); + inline void clear_has_stable_prod_grad(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > coeff_; + int operation_; + bool stable_prod_grad_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed EltwiseParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ELUParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ELUParameter) */ { + public: + ELUParameter(); + virtual ~ELUParameter(); + + ELUParameter(const ELUParameter& from); + + inline ELUParameter& operator=(const ELUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ELUParameter& default_instance(); + + static const ELUParameter* internal_default_instance(); + + void Swap(ELUParameter* other); + + // implements Message ---------------------------------------------- + + inline ELUParameter* New() const { return New(NULL); } + + ELUParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ELUParameter& from); + void MergeFrom(const ELUParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ELUParameter* other); + void UnsafeMergeFrom(const ELUParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float alpha = 1 [default = 1]; + bool has_alpha() const; + void clear_alpha(); + static const int kAlphaFieldNumber = 1; + float alpha() const; + void set_alpha(float value); + + // @@protoc_insertion_point(class_scope:caffe.ELUParameter) + private: + inline void set_has_alpha(); + inline void clear_has_alpha(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float alpha_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ELUParameter_default_instance_; + +// ------------------------------------------------------------------- + +class EmbedParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.EmbedParameter) */ { + public: + EmbedParameter(); + virtual ~EmbedParameter(); + + EmbedParameter(const EmbedParameter& from); + + inline EmbedParameter& operator=(const EmbedParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EmbedParameter& default_instance(); + + static const EmbedParameter* internal_default_instance(); + + void Swap(EmbedParameter* other); + + // implements Message ---------------------------------------------- + + inline EmbedParameter* New() const { return New(NULL); } + + EmbedParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EmbedParameter& from); + void MergeFrom(const EmbedParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EmbedParameter* other); + void UnsafeMergeFrom(const EmbedParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + bool has_num_output() const; + void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + ::google::protobuf::uint32 num_output() const; + void set_num_output(::google::protobuf::uint32 value); + + // optional uint32 input_dim = 2; + bool has_input_dim() const; + void clear_input_dim(); + static const int kInputDimFieldNumber = 2; + ::google::protobuf::uint32 input_dim() const; + void set_input_dim(::google::protobuf::uint32 value); + + // optional bool bias_term = 3 [default = true]; + bool has_bias_term() const; + void clear_bias_term(); + static const int kBiasTermFieldNumber = 3; + bool bias_term() const; + void set_bias_term(bool value); + + // optional .caffe.FillerParameter weight_filler = 4; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 4; + const ::caffe::FillerParameter& weight_filler() const; + ::caffe::FillerParameter* mutable_weight_filler(); + ::caffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::caffe::FillerParameter* weight_filler); + + // optional .caffe.FillerParameter bias_filler = 5; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + const ::caffe::FillerParameter& bias_filler() const; + ::caffe::FillerParameter* mutable_bias_filler(); + ::caffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::caffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:caffe.EmbedParameter) + private: + inline void set_has_num_output(); + inline void clear_has_num_output(); + inline void set_has_input_dim(); + inline void clear_has_input_dim(); + inline void set_has_bias_term(); + inline void clear_has_bias_term(); + inline void set_has_weight_filler(); + inline void clear_has_weight_filler(); + inline void set_has_bias_filler(); + inline void clear_has_bias_filler(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* weight_filler_; + ::caffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 input_dim_; + bool bias_term_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed EmbedParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ExpParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ExpParameter) */ { + public: + ExpParameter(); + virtual ~ExpParameter(); + + ExpParameter(const ExpParameter& from); + + inline ExpParameter& operator=(const ExpParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ExpParameter& default_instance(); + + static const ExpParameter* internal_default_instance(); + + void Swap(ExpParameter* other); + + // implements Message ---------------------------------------------- + + inline ExpParameter* New() const { return New(NULL); } + + ExpParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ExpParameter& from); + void MergeFrom(const ExpParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ExpParameter* other); + void UnsafeMergeFrom(const ExpParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float base = 1 [default = -1]; + bool has_base() const; + void clear_base(); + static const int kBaseFieldNumber = 1; + float base() const; + void set_base(float value); + + // optional float scale = 2 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 2; + float scale() const; + void set_scale(float value); + + // optional float shift = 3 [default = 0]; + bool has_shift() const; + void clear_shift(); + static const int kShiftFieldNumber = 3; + float shift() const; + void set_shift(float value); + + // @@protoc_insertion_point(class_scope:caffe.ExpParameter) + private: + inline void set_has_base(); + inline void clear_has_base(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_shift(); + inline void clear_has_shift(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float shift_; + float base_; + float scale_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ExpParameter_default_instance_; + +// ------------------------------------------------------------------- + +class FlattenParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.FlattenParameter) */ { + public: + FlattenParameter(); + virtual ~FlattenParameter(); + + FlattenParameter(const FlattenParameter& from); + + inline FlattenParameter& operator=(const FlattenParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FlattenParameter& default_instance(); + + static const FlattenParameter* internal_default_instance(); + + void Swap(FlattenParameter* other); + + // implements Message ---------------------------------------------- + + inline FlattenParameter* New() const { return New(NULL); } + + FlattenParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FlattenParameter& from); + void MergeFrom(const FlattenParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FlattenParameter* other); + void UnsafeMergeFrom(const FlattenParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 1; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional int32 end_axis = 2 [default = -1]; + bool has_end_axis() const; + void clear_end_axis(); + static const int kEndAxisFieldNumber = 2; + ::google::protobuf::int32 end_axis() const; + void set_end_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.FlattenParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_end_axis(); + inline void clear_has_end_axis(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 end_axis_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed FlattenParameter_default_instance_; + +// ------------------------------------------------------------------- + +class HDF5DataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.HDF5DataParameter) */ { + public: + HDF5DataParameter(); + virtual ~HDF5DataParameter(); + + HDF5DataParameter(const HDF5DataParameter& from); + + inline HDF5DataParameter& operator=(const HDF5DataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const HDF5DataParameter& default_instance(); + + static const HDF5DataParameter* internal_default_instance(); + + void Swap(HDF5DataParameter* other); + + // implements Message ---------------------------------------------- + + inline HDF5DataParameter* New() const { return New(NULL); } + + HDF5DataParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const HDF5DataParameter& from); + void MergeFrom(const HDF5DataParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HDF5DataParameter* other); + void UnsafeMergeFrom(const HDF5DataParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 1; + const ::std::string& source() const; + void set_source(const ::std::string& value); + void set_source(const char* value); + void set_source(const char* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 2; + bool has_batch_size() const; + void clear_batch_size(); + static const int kBatchSizeFieldNumber = 2; + ::google::protobuf::uint32 batch_size() const; + void set_batch_size(::google::protobuf::uint32 value); + + // optional bool shuffle = 3 [default = false]; + bool has_shuffle() const; + void clear_shuffle(); + static const int kShuffleFieldNumber = 3; + bool shuffle() const; + void set_shuffle(bool value); + + // @@protoc_insertion_point(class_scope:caffe.HDF5DataParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + inline void set_has_batch_size(); + inline void clear_has_batch_size(); + inline void set_has_shuffle(); + inline void clear_has_shuffle(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + bool shuffle_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed HDF5DataParameter_default_instance_; + +// ------------------------------------------------------------------- + +class HDF5OutputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.HDF5OutputParameter) */ { + public: + HDF5OutputParameter(); + virtual ~HDF5OutputParameter(); + + HDF5OutputParameter(const HDF5OutputParameter& from); + + inline HDF5OutputParameter& operator=(const HDF5OutputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const HDF5OutputParameter& default_instance(); + + static const HDF5OutputParameter* internal_default_instance(); + + void Swap(HDF5OutputParameter* other); + + // implements Message ---------------------------------------------- + + inline HDF5OutputParameter* New() const { return New(NULL); } + + HDF5OutputParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const HDF5OutputParameter& from); + void MergeFrom(const HDF5OutputParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HDF5OutputParameter* other); + void UnsafeMergeFrom(const HDF5OutputParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string file_name = 1; + bool has_file_name() const; + void clear_file_name(); + static const int kFileNameFieldNumber = 1; + const ::std::string& file_name() const; + void set_file_name(const ::std::string& value); + void set_file_name(const char* value); + void set_file_name(const char* value, size_t size); + ::std::string* mutable_file_name(); + ::std::string* release_file_name(); + void set_allocated_file_name(::std::string* file_name); + + // @@protoc_insertion_point(class_scope:caffe.HDF5OutputParameter) + private: + inline void set_has_file_name(); + inline void clear_has_file_name(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr file_name_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed HDF5OutputParameter_default_instance_; + +// ------------------------------------------------------------------- + +class HingeLossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.HingeLossParameter) */ { + public: + HingeLossParameter(); + virtual ~HingeLossParameter(); + + HingeLossParameter(const HingeLossParameter& from); + + inline HingeLossParameter& operator=(const HingeLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const HingeLossParameter& default_instance(); + + static const HingeLossParameter* internal_default_instance(); + + void Swap(HingeLossParameter* other); + + // implements Message ---------------------------------------------- + + inline HingeLossParameter* New() const { return New(NULL); } + + HingeLossParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const HingeLossParameter& from); + void MergeFrom(const HingeLossParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HingeLossParameter* other); + void UnsafeMergeFrom(const HingeLossParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef HingeLossParameter_Norm Norm; + static const Norm L1 = + HingeLossParameter_Norm_L1; + static const Norm L2 = + HingeLossParameter_Norm_L2; + static inline bool Norm_IsValid(int value) { + return HingeLossParameter_Norm_IsValid(value); + } + static const Norm Norm_MIN = + HingeLossParameter_Norm_Norm_MIN; + static const Norm Norm_MAX = + HingeLossParameter_Norm_Norm_MAX; + static const int Norm_ARRAYSIZE = + HingeLossParameter_Norm_Norm_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Norm_descriptor() { + return HingeLossParameter_Norm_descriptor(); + } + static inline const ::std::string& Norm_Name(Norm value) { + return HingeLossParameter_Norm_Name(value); + } + static inline bool Norm_Parse(const ::std::string& name, + Norm* value) { + return HingeLossParameter_Norm_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; + bool has_norm() const; + void clear_norm(); + static const int kNormFieldNumber = 1; + ::caffe::HingeLossParameter_Norm norm() const; + void set_norm(::caffe::HingeLossParameter_Norm value); + + // @@protoc_insertion_point(class_scope:caffe.HingeLossParameter) + private: + inline void set_has_norm(); + inline void clear_has_norm(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + int norm_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed HingeLossParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ImageDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ImageDataParameter) */ { + public: + ImageDataParameter(); + virtual ~ImageDataParameter(); + + ImageDataParameter(const ImageDataParameter& from); + + inline ImageDataParameter& operator=(const ImageDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ImageDataParameter& default_instance(); + + static const ImageDataParameter* internal_default_instance(); + + void Swap(ImageDataParameter* other); + + // implements Message ---------------------------------------------- + + inline ImageDataParameter* New() const { return New(NULL); } + + ImageDataParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ImageDataParameter& from); + void MergeFrom(const ImageDataParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ImageDataParameter* other); + void UnsafeMergeFrom(const ImageDataParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 1; + const ::std::string& source() const; + void set_source(const ::std::string& value); + void set_source(const char* value); + void set_source(const char* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 4 [default = 1]; + bool has_batch_size() const; + void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + ::google::protobuf::uint32 batch_size() const; + void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 rand_skip = 7 [default = 0]; + bool has_rand_skip() const; + void clear_rand_skip(); + static const int kRandSkipFieldNumber = 7; + ::google::protobuf::uint32 rand_skip() const; + void set_rand_skip(::google::protobuf::uint32 value); + + // optional bool shuffle = 8 [default = false]; + bool has_shuffle() const; + void clear_shuffle(); + static const int kShuffleFieldNumber = 8; + bool shuffle() const; + void set_shuffle(bool value); + + // optional uint32 new_height = 9 [default = 0]; + bool has_new_height() const; + void clear_new_height(); + static const int kNewHeightFieldNumber = 9; + ::google::protobuf::uint32 new_height() const; + void set_new_height(::google::protobuf::uint32 value); + + // optional uint32 new_width = 10 [default = 0]; + bool has_new_width() const; + void clear_new_width(); + static const int kNewWidthFieldNumber = 10; + ::google::protobuf::uint32 new_width() const; + void set_new_width(::google::protobuf::uint32 value); + + // optional bool is_color = 11 [default = true]; + bool has_is_color() const; + void clear_is_color(); + static const int kIsColorFieldNumber = 11; + bool is_color() const; + void set_is_color(bool value); + + // optional float scale = 2 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 2; + float scale() const; + void set_scale(float value); + + // optional string mean_file = 3; + bool has_mean_file() const; + void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + const ::std::string& mean_file() const; + void set_mean_file(const ::std::string& value); + void set_mean_file(const char* value); + void set_mean_file(const char* value, size_t size); + ::std::string* mutable_mean_file(); + ::std::string* release_mean_file(); + void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 crop_size = 5 [default = 0]; + bool has_crop_size() const; + void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + ::google::protobuf::uint32 crop_size() const; + void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + bool has_mirror() const; + void clear_mirror(); + static const int kMirrorFieldNumber = 6; + bool mirror() const; + void set_mirror(bool value); + + // optional string root_folder = 12 [default = ""]; + bool has_root_folder() const; + void clear_root_folder(); + static const int kRootFolderFieldNumber = 12; + const ::std::string& root_folder() const; + void set_root_folder(const ::std::string& value); + void set_root_folder(const char* value); + void set_root_folder(const char* value, size_t size); + ::std::string* mutable_root_folder(); + ::std::string* release_root_folder(); + void set_allocated_root_folder(::std::string* root_folder); + + // @@protoc_insertion_point(class_scope:caffe.ImageDataParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + inline void set_has_batch_size(); + inline void clear_has_batch_size(); + inline void set_has_rand_skip(); + inline void clear_has_rand_skip(); + inline void set_has_shuffle(); + inline void clear_has_shuffle(); + inline void set_has_new_height(); + inline void clear_has_new_height(); + inline void set_has_new_width(); + inline void clear_has_new_width(); + inline void set_has_is_color(); + inline void clear_has_is_color(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_mean_file(); + inline void clear_has_mean_file(); + inline void set_has_crop_size(); + inline void clear_has_crop_size(); + inline void set_has_mirror(); + inline void clear_has_mirror(); + inline void set_has_root_folder(); + inline void clear_has_root_folder(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::internal::ArenaStringPtr root_folder_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::uint32 new_height_; + ::google::protobuf::uint32 new_width_; + bool shuffle_; + bool mirror_; + ::google::protobuf::uint32 crop_size_; + float scale_; + ::google::protobuf::uint32 batch_size_; + bool is_color_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ImageDataParameter_default_instance_; + +// ------------------------------------------------------------------- + +class InfogainLossParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.InfogainLossParameter) */ { + public: + InfogainLossParameter(); + virtual ~InfogainLossParameter(); + + InfogainLossParameter(const InfogainLossParameter& from); + + inline InfogainLossParameter& operator=(const InfogainLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const InfogainLossParameter& default_instance(); + + static const InfogainLossParameter* internal_default_instance(); + + void Swap(InfogainLossParameter* other); + + // implements Message ---------------------------------------------- + + inline InfogainLossParameter* New() const { return New(NULL); } + + InfogainLossParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const InfogainLossParameter& from); + void MergeFrom(const InfogainLossParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InfogainLossParameter* other); + void UnsafeMergeFrom(const InfogainLossParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 1; + const ::std::string& source() const; + void set_source(const ::std::string& value); + void set_source(const char* value); + void set_source(const char* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // @@protoc_insertion_point(class_scope:caffe.InfogainLossParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed InfogainLossParameter_default_instance_; + +// ------------------------------------------------------------------- + +class InnerProductParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.InnerProductParameter) */ { + public: + InnerProductParameter(); + virtual ~InnerProductParameter(); + + InnerProductParameter(const InnerProductParameter& from); + + inline InnerProductParameter& operator=(const InnerProductParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const InnerProductParameter& default_instance(); + + static const InnerProductParameter* internal_default_instance(); + + void Swap(InnerProductParameter* other); + + // implements Message ---------------------------------------------- + + inline InnerProductParameter* New() const { return New(NULL); } + + InnerProductParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const InnerProductParameter& from); + void MergeFrom(const InnerProductParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InnerProductParameter* other); + void UnsafeMergeFrom(const InnerProductParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + bool has_num_output() const; + void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + ::google::protobuf::uint32 num_output() const; + void set_num_output(::google::protobuf::uint32 value); + + // optional bool bias_term = 2 [default = true]; + bool has_bias_term() const; + void clear_bias_term(); + static const int kBiasTermFieldNumber = 2; + bool bias_term() const; + void set_bias_term(bool value); + + // optional .caffe.FillerParameter weight_filler = 3; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 3; + const ::caffe::FillerParameter& weight_filler() const; + ::caffe::FillerParameter* mutable_weight_filler(); + ::caffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::caffe::FillerParameter* weight_filler); + + // optional .caffe.FillerParameter bias_filler = 4; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 4; + const ::caffe::FillerParameter& bias_filler() const; + ::caffe::FillerParameter* mutable_bias_filler(); + ::caffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::caffe::FillerParameter* bias_filler); + + // optional int32 axis = 5 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 5; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional bool transpose = 6 [default = false]; + bool has_transpose() const; + void clear_transpose(); + static const int kTransposeFieldNumber = 6; + bool transpose() const; + void set_transpose(bool value); + + // @@protoc_insertion_point(class_scope:caffe.InnerProductParameter) + private: + inline void set_has_num_output(); + inline void clear_has_num_output(); + inline void set_has_bias_term(); + inline void clear_has_bias_term(); + inline void set_has_weight_filler(); + inline void clear_has_weight_filler(); + inline void set_has_bias_filler(); + inline void clear_has_bias_filler(); + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_transpose(); + inline void clear_has_transpose(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* weight_filler_; + ::caffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 num_output_; + bool transpose_; + bool bias_term_; + ::google::protobuf::int32 axis_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed InnerProductParameter_default_instance_; + +// ------------------------------------------------------------------- + +class InputParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.InputParameter) */ { + public: + InputParameter(); + virtual ~InputParameter(); + + InputParameter(const InputParameter& from); + + inline InputParameter& operator=(const InputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const InputParameter& default_instance(); + + static const InputParameter* internal_default_instance(); + + void Swap(InputParameter* other); + + // implements Message ---------------------------------------------- + + inline InputParameter* New() const { return New(NULL); } + + InputParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const InputParameter& from); + void MergeFrom(const InputParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InputParameter* other); + void UnsafeMergeFrom(const InputParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .caffe.BlobShape shape = 1; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::caffe::BlobShape& shape(int index) const; + ::caffe::BlobShape* mutable_shape(int index); + ::caffe::BlobShape* add_shape(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& + shape() const; + + // @@protoc_insertion_point(class_scope:caffe.InputParameter) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape > shape_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed InputParameter_default_instance_; + +// ------------------------------------------------------------------- + +class LogParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.LogParameter) */ { + public: + LogParameter(); + virtual ~LogParameter(); + + LogParameter(const LogParameter& from); + + inline LogParameter& operator=(const LogParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LogParameter& default_instance(); + + static const LogParameter* internal_default_instance(); + + void Swap(LogParameter* other); + + // implements Message ---------------------------------------------- + + inline LogParameter* New() const { return New(NULL); } + + LogParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LogParameter& from); + void MergeFrom(const LogParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LogParameter* other); + void UnsafeMergeFrom(const LogParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float base = 1 [default = -1]; + bool has_base() const; + void clear_base(); + static const int kBaseFieldNumber = 1; + float base() const; + void set_base(float value); + + // optional float scale = 2 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 2; + float scale() const; + void set_scale(float value); + + // optional float shift = 3 [default = 0]; + bool has_shift() const; + void clear_shift(); + static const int kShiftFieldNumber = 3; + float shift() const; + void set_shift(float value); + + // @@protoc_insertion_point(class_scope:caffe.LogParameter) + private: + inline void set_has_base(); + inline void clear_has_base(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_shift(); + inline void clear_has_shift(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float shift_; + float base_; + float scale_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed LogParameter_default_instance_; + +// ------------------------------------------------------------------- + +class LRNParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.LRNParameter) */ { + public: + LRNParameter(); + virtual ~LRNParameter(); + + LRNParameter(const LRNParameter& from); + + inline LRNParameter& operator=(const LRNParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LRNParameter& default_instance(); + + static const LRNParameter* internal_default_instance(); + + void Swap(LRNParameter* other); + + // implements Message ---------------------------------------------- + + inline LRNParameter* New() const { return New(NULL); } + + LRNParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LRNParameter& from); + void MergeFrom(const LRNParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LRNParameter* other); + void UnsafeMergeFrom(const LRNParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef LRNParameter_NormRegion NormRegion; + static const NormRegion ACROSS_CHANNELS = + LRNParameter_NormRegion_ACROSS_CHANNELS; + static const NormRegion WITHIN_CHANNEL = + LRNParameter_NormRegion_WITHIN_CHANNEL; + static inline bool NormRegion_IsValid(int value) { + return LRNParameter_NormRegion_IsValid(value); + } + static const NormRegion NormRegion_MIN = + LRNParameter_NormRegion_NormRegion_MIN; + static const NormRegion NormRegion_MAX = + LRNParameter_NormRegion_NormRegion_MAX; + static const int NormRegion_ARRAYSIZE = + LRNParameter_NormRegion_NormRegion_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + NormRegion_descriptor() { + return LRNParameter_NormRegion_descriptor(); + } + static inline const ::std::string& NormRegion_Name(NormRegion value) { + return LRNParameter_NormRegion_Name(value); + } + static inline bool NormRegion_Parse(const ::std::string& name, + NormRegion* value) { + return LRNParameter_NormRegion_Parse(name, value); + } + + typedef LRNParameter_Engine Engine; + static const Engine DEFAULT = + LRNParameter_Engine_DEFAULT; + static const Engine CAFFE = + LRNParameter_Engine_CAFFE; + static const Engine CUDNN = + LRNParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return LRNParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + LRNParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + LRNParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + LRNParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return LRNParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return LRNParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return LRNParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional uint32 local_size = 1 [default = 5]; + bool has_local_size() const; + void clear_local_size(); + static const int kLocalSizeFieldNumber = 1; + ::google::protobuf::uint32 local_size() const; + void set_local_size(::google::protobuf::uint32 value); + + // optional float alpha = 2 [default = 1]; + bool has_alpha() const; + void clear_alpha(); + static const int kAlphaFieldNumber = 2; + float alpha() const; + void set_alpha(float value); + + // optional float beta = 3 [default = 0.75]; + bool has_beta() const; + void clear_beta(); + static const int kBetaFieldNumber = 3; + float beta() const; + void set_beta(float value); + + // optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + bool has_norm_region() const; + void clear_norm_region(); + static const int kNormRegionFieldNumber = 4; + ::caffe::LRNParameter_NormRegion norm_region() const; + void set_norm_region(::caffe::LRNParameter_NormRegion value); + + // optional float k = 5 [default = 1]; + bool has_k() const; + void clear_k(); + static const int kKFieldNumber = 5; + float k() const; + void set_k(float value); + + // optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 6; + ::caffe::LRNParameter_Engine engine() const; + void set_engine(::caffe::LRNParameter_Engine value); + + // @@protoc_insertion_point(class_scope:caffe.LRNParameter) + private: + inline void set_has_local_size(); + inline void clear_has_local_size(); + inline void set_has_alpha(); + inline void clear_has_alpha(); + inline void set_has_beta(); + inline void clear_has_beta(); + inline void set_has_norm_region(); + inline void clear_has_norm_region(); + inline void set_has_k(); + inline void clear_has_k(); + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + int norm_region_; + int engine_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + float k_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed LRNParameter_default_instance_; + +// ------------------------------------------------------------------- + +class MemoryDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.MemoryDataParameter) */ { + public: + MemoryDataParameter(); + virtual ~MemoryDataParameter(); + + MemoryDataParameter(const MemoryDataParameter& from); + + inline MemoryDataParameter& operator=(const MemoryDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryDataParameter& default_instance(); + + static const MemoryDataParameter* internal_default_instance(); + + void Swap(MemoryDataParameter* other); + + // implements Message ---------------------------------------------- + + inline MemoryDataParameter* New() const { return New(NULL); } + + MemoryDataParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MemoryDataParameter& from); + void MergeFrom(const MemoryDataParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MemoryDataParameter* other); + void UnsafeMergeFrom(const MemoryDataParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 batch_size = 1; + bool has_batch_size() const; + void clear_batch_size(); + static const int kBatchSizeFieldNumber = 1; + ::google::protobuf::uint32 batch_size() const; + void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 channels = 2; + bool has_channels() const; + void clear_channels(); + static const int kChannelsFieldNumber = 2; + ::google::protobuf::uint32 channels() const; + void set_channels(::google::protobuf::uint32 value); + + // optional uint32 height = 3; + bool has_height() const; + void clear_height(); + static const int kHeightFieldNumber = 3; + ::google::protobuf::uint32 height() const; + void set_height(::google::protobuf::uint32 value); + + // optional uint32 width = 4; + bool has_width() const; + void clear_width(); + static const int kWidthFieldNumber = 4; + ::google::protobuf::uint32 width() const; + void set_width(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:caffe.MemoryDataParameter) + private: + inline void set_has_batch_size(); + inline void clear_has_batch_size(); + inline void set_has_channels(); + inline void clear_has_channels(); + inline void set_has_height(); + inline void clear_has_height(); + inline void set_has_width(); + inline void clear_has_width(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 channels_; + ::google::protobuf::uint32 height_; + ::google::protobuf::uint32 width_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed MemoryDataParameter_default_instance_; + +// ------------------------------------------------------------------- + +class MVNParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.MVNParameter) */ { + public: + MVNParameter(); + virtual ~MVNParameter(); + + MVNParameter(const MVNParameter& from); + + inline MVNParameter& operator=(const MVNParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MVNParameter& default_instance(); + + static const MVNParameter* internal_default_instance(); + + void Swap(MVNParameter* other); + + // implements Message ---------------------------------------------- + + inline MVNParameter* New() const { return New(NULL); } + + MVNParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MVNParameter& from); + void MergeFrom(const MVNParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MVNParameter* other); + void UnsafeMergeFrom(const MVNParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool normalize_variance = 1 [default = true]; + bool has_normalize_variance() const; + void clear_normalize_variance(); + static const int kNormalizeVarianceFieldNumber = 1; + bool normalize_variance() const; + void set_normalize_variance(bool value); + + // optional bool across_channels = 2 [default = false]; + bool has_across_channels() const; + void clear_across_channels(); + static const int kAcrossChannelsFieldNumber = 2; + bool across_channels() const; + void set_across_channels(bool value); + + // optional float eps = 3 [default = 1e-09]; + bool has_eps() const; + void clear_eps(); + static const int kEpsFieldNumber = 3; + float eps() const; + void set_eps(float value); + + // @@protoc_insertion_point(class_scope:caffe.MVNParameter) + private: + inline void set_has_normalize_variance(); + inline void clear_has_normalize_variance(); + inline void set_has_across_channels(); + inline void clear_has_across_channels(); + inline void set_has_eps(); + inline void clear_has_eps(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + bool across_channels_; + bool normalize_variance_; + float eps_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed MVNParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ParameterParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ParameterParameter) */ { + public: + ParameterParameter(); + virtual ~ParameterParameter(); + + ParameterParameter(const ParameterParameter& from); + + inline ParameterParameter& operator=(const ParameterParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ParameterParameter& default_instance(); + + static const ParameterParameter* internal_default_instance(); + + void Swap(ParameterParameter* other); + + // implements Message ---------------------------------------------- + + inline ParameterParameter* New() const { return New(NULL); } + + ParameterParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ParameterParameter& from); + void MergeFrom(const ParameterParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ParameterParameter* other); + void UnsafeMergeFrom(const ParameterParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.BlobShape shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::caffe::BlobShape& shape() const; + ::caffe::BlobShape* mutable_shape(); + ::caffe::BlobShape* release_shape(); + void set_allocated_shape(::caffe::BlobShape* shape); + + // @@protoc_insertion_point(class_scope:caffe.ParameterParameter) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::BlobShape* shape_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ParameterParameter_default_instance_; + +// ------------------------------------------------------------------- + +class PoolingParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.PoolingParameter) */ { + public: + PoolingParameter(); + virtual ~PoolingParameter(); + + PoolingParameter(const PoolingParameter& from); + + inline PoolingParameter& operator=(const PoolingParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PoolingParameter& default_instance(); + + static const PoolingParameter* internal_default_instance(); + + void Swap(PoolingParameter* other); + + // implements Message ---------------------------------------------- + + inline PoolingParameter* New() const { return New(NULL); } + + PoolingParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PoolingParameter& from); + void MergeFrom(const PoolingParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PoolingParameter* other); + void UnsafeMergeFrom(const PoolingParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef PoolingParameter_PoolMethod PoolMethod; + static const PoolMethod MAX = + PoolingParameter_PoolMethod_MAX; + static const PoolMethod AVE = + PoolingParameter_PoolMethod_AVE; + static const PoolMethod STOCHASTIC = + PoolingParameter_PoolMethod_STOCHASTIC; + static inline bool PoolMethod_IsValid(int value) { + return PoolingParameter_PoolMethod_IsValid(value); + } + static const PoolMethod PoolMethod_MIN = + PoolingParameter_PoolMethod_PoolMethod_MIN; + static const PoolMethod PoolMethod_MAX = + PoolingParameter_PoolMethod_PoolMethod_MAX; + static const int PoolMethod_ARRAYSIZE = + PoolingParameter_PoolMethod_PoolMethod_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + PoolMethod_descriptor() { + return PoolingParameter_PoolMethod_descriptor(); + } + static inline const ::std::string& PoolMethod_Name(PoolMethod value) { + return PoolingParameter_PoolMethod_Name(value); + } + static inline bool PoolMethod_Parse(const ::std::string& name, + PoolMethod* value) { + return PoolingParameter_PoolMethod_Parse(name, value); + } + + typedef PoolingParameter_Engine Engine; + static const Engine DEFAULT = + PoolingParameter_Engine_DEFAULT; + static const Engine CAFFE = + PoolingParameter_Engine_CAFFE; + static const Engine CUDNN = + PoolingParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return PoolingParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + PoolingParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + PoolingParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + PoolingParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return PoolingParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return PoolingParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return PoolingParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 1; + ::caffe::PoolingParameter_PoolMethod pool() const; + void set_pool(::caffe::PoolingParameter_PoolMethod value); + + // optional uint32 pad = 4 [default = 0]; + bool has_pad() const; + void clear_pad(); + static const int kPadFieldNumber = 4; + ::google::protobuf::uint32 pad() const; + void set_pad(::google::protobuf::uint32 value); + + // optional uint32 pad_h = 9 [default = 0]; + bool has_pad_h() const; + void clear_pad_h(); + static const int kPadHFieldNumber = 9; + ::google::protobuf::uint32 pad_h() const; + void set_pad_h(::google::protobuf::uint32 value); + + // optional uint32 pad_w = 10 [default = 0]; + bool has_pad_w() const; + void clear_pad_w(); + static const int kPadWFieldNumber = 10; + ::google::protobuf::uint32 pad_w() const; + void set_pad_w(::google::protobuf::uint32 value); + + // optional uint32 kernel_size = 2; + bool has_kernel_size() const; + void clear_kernel_size(); + static const int kKernelSizeFieldNumber = 2; + ::google::protobuf::uint32 kernel_size() const; + void set_kernel_size(::google::protobuf::uint32 value); + + // optional uint32 kernel_h = 5; + bool has_kernel_h() const; + void clear_kernel_h(); + static const int kKernelHFieldNumber = 5; + ::google::protobuf::uint32 kernel_h() const; + void set_kernel_h(::google::protobuf::uint32 value); + + // optional uint32 kernel_w = 6; + bool has_kernel_w() const; + void clear_kernel_w(); + static const int kKernelWFieldNumber = 6; + ::google::protobuf::uint32 kernel_w() const; + void set_kernel_w(::google::protobuf::uint32 value); + + // optional uint32 stride = 3 [default = 1]; + bool has_stride() const; + void clear_stride(); + static const int kStrideFieldNumber = 3; + ::google::protobuf::uint32 stride() const; + void set_stride(::google::protobuf::uint32 value); + + // optional uint32 stride_h = 7; + bool has_stride_h() const; + void clear_stride_h(); + static const int kStrideHFieldNumber = 7; + ::google::protobuf::uint32 stride_h() const; + void set_stride_h(::google::protobuf::uint32 value); + + // optional uint32 stride_w = 8; + bool has_stride_w() const; + void clear_stride_w(); + static const int kStrideWFieldNumber = 8; + ::google::protobuf::uint32 stride_w() const; + void set_stride_w(::google::protobuf::uint32 value); + + // optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 11; + ::caffe::PoolingParameter_Engine engine() const; + void set_engine(::caffe::PoolingParameter_Engine value); + + // optional bool global_pooling = 12 [default = false]; + bool has_global_pooling() const; + void clear_global_pooling(); + static const int kGlobalPoolingFieldNumber = 12; + bool global_pooling() const; + void set_global_pooling(bool value); + + // @@protoc_insertion_point(class_scope:caffe.PoolingParameter) + private: + inline void set_has_pool(); + inline void clear_has_pool(); + inline void set_has_pad(); + inline void clear_has_pad(); + inline void set_has_pad_h(); + inline void clear_has_pad_h(); + inline void set_has_pad_w(); + inline void clear_has_pad_w(); + inline void set_has_kernel_size(); + inline void clear_has_kernel_size(); + inline void set_has_kernel_h(); + inline void clear_has_kernel_h(); + inline void set_has_kernel_w(); + inline void clear_has_kernel_w(); + inline void set_has_stride(); + inline void clear_has_stride(); + inline void set_has_stride_h(); + inline void clear_has_stride_h(); + inline void set_has_stride_w(); + inline void clear_has_stride_w(); + inline void set_has_engine(); + inline void clear_has_engine(); + inline void set_has_global_pooling(); + inline void clear_has_global_pooling(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + int pool_; + ::google::protobuf::uint32 pad_; + ::google::protobuf::uint32 pad_h_; + ::google::protobuf::uint32 pad_w_; + ::google::protobuf::uint32 kernel_size_; + ::google::protobuf::uint32 kernel_h_; + ::google::protobuf::uint32 kernel_w_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + int engine_; + bool global_pooling_; + ::google::protobuf::uint32 stride_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed PoolingParameter_default_instance_; + +// ------------------------------------------------------------------- + +class PowerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.PowerParameter) */ { + public: + PowerParameter(); + virtual ~PowerParameter(); + + PowerParameter(const PowerParameter& from); + + inline PowerParameter& operator=(const PowerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PowerParameter& default_instance(); + + static const PowerParameter* internal_default_instance(); + + void Swap(PowerParameter* other); + + // implements Message ---------------------------------------------- + + inline PowerParameter* New() const { return New(NULL); } + + PowerParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PowerParameter& from); + void MergeFrom(const PowerParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PowerParameter* other); + void UnsafeMergeFrom(const PowerParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float power = 1 [default = 1]; + bool has_power() const; + void clear_power(); + static const int kPowerFieldNumber = 1; + float power() const; + void set_power(float value); + + // optional float scale = 2 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 2; + float scale() const; + void set_scale(float value); + + // optional float shift = 3 [default = 0]; + bool has_shift() const; + void clear_shift(); + static const int kShiftFieldNumber = 3; + float shift() const; + void set_shift(float value); + + // @@protoc_insertion_point(class_scope:caffe.PowerParameter) + private: + inline void set_has_power(); + inline void clear_has_power(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_shift(); + inline void clear_has_shift(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float shift_; + float power_; + float scale_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed PowerParameter_default_instance_; + +// ------------------------------------------------------------------- + +class PythonParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.PythonParameter) */ { + public: + PythonParameter(); + virtual ~PythonParameter(); + + PythonParameter(const PythonParameter& from); + + inline PythonParameter& operator=(const PythonParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PythonParameter& default_instance(); + + static const PythonParameter* internal_default_instance(); + + void Swap(PythonParameter* other); + + // implements Message ---------------------------------------------- + + inline PythonParameter* New() const { return New(NULL); } + + PythonParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PythonParameter& from); + void MergeFrom(const PythonParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PythonParameter* other); + void UnsafeMergeFrom(const PythonParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string module = 1; + bool has_module() const; + void clear_module(); + static const int kModuleFieldNumber = 1; + const ::std::string& module() const; + void set_module(const ::std::string& value); + void set_module(const char* value); + void set_module(const char* value, size_t size); + ::std::string* mutable_module(); + ::std::string* release_module(); + void set_allocated_module(::std::string* module); + + // optional string layer = 2; + bool has_layer() const; + void clear_layer(); + static const int kLayerFieldNumber = 2; + const ::std::string& layer() const; + void set_layer(const ::std::string& value); + void set_layer(const char* value); + void set_layer(const char* value, size_t size); + ::std::string* mutable_layer(); + ::std::string* release_layer(); + void set_allocated_layer(::std::string* layer); + + // optional string param_str = 3 [default = ""]; + bool has_param_str() const; + void clear_param_str(); + static const int kParamStrFieldNumber = 3; + const ::std::string& param_str() const; + void set_param_str(const ::std::string& value); + void set_param_str(const char* value); + void set_param_str(const char* value, size_t size); + ::std::string* mutable_param_str(); + ::std::string* release_param_str(); + void set_allocated_param_str(::std::string* param_str); + + // optional bool share_in_parallel = 4 [default = false]; + bool has_share_in_parallel() const; + void clear_share_in_parallel(); + static const int kShareInParallelFieldNumber = 4; + bool share_in_parallel() const; + void set_share_in_parallel(bool value); + + // @@protoc_insertion_point(class_scope:caffe.PythonParameter) + private: + inline void set_has_module(); + inline void clear_has_module(); + inline void set_has_layer(); + inline void clear_has_layer(); + inline void set_has_param_str(); + inline void clear_has_param_str(); + inline void set_has_share_in_parallel(); + inline void clear_has_share_in_parallel(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr module_; + ::google::protobuf::internal::ArenaStringPtr layer_; + ::google::protobuf::internal::ArenaStringPtr param_str_; + bool share_in_parallel_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed PythonParameter_default_instance_; + +// ------------------------------------------------------------------- + +class RecurrentParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.RecurrentParameter) */ { + public: + RecurrentParameter(); + virtual ~RecurrentParameter(); + + RecurrentParameter(const RecurrentParameter& from); + + inline RecurrentParameter& operator=(const RecurrentParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const RecurrentParameter& default_instance(); + + static const RecurrentParameter* internal_default_instance(); + + void Swap(RecurrentParameter* other); + + // implements Message ---------------------------------------------- + + inline RecurrentParameter* New() const { return New(NULL); } + + RecurrentParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const RecurrentParameter& from); + void MergeFrom(const RecurrentParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(RecurrentParameter* other); + void UnsafeMergeFrom(const RecurrentParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1 [default = 0]; + bool has_num_output() const; + void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + ::google::protobuf::uint32 num_output() const; + void set_num_output(::google::protobuf::uint32 value); + + // optional .caffe.FillerParameter weight_filler = 2; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 2; + const ::caffe::FillerParameter& weight_filler() const; + ::caffe::FillerParameter* mutable_weight_filler(); + ::caffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::caffe::FillerParameter* weight_filler); + + // optional .caffe.FillerParameter bias_filler = 3; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 3; + const ::caffe::FillerParameter& bias_filler() const; + ::caffe::FillerParameter* mutable_bias_filler(); + ::caffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::caffe::FillerParameter* bias_filler); + + // optional bool debug_info = 4 [default = false]; + bool has_debug_info() const; + void clear_debug_info(); + static const int kDebugInfoFieldNumber = 4; + bool debug_info() const; + void set_debug_info(bool value); + + // optional bool expose_hidden = 5 [default = false]; + bool has_expose_hidden() const; + void clear_expose_hidden(); + static const int kExposeHiddenFieldNumber = 5; + bool expose_hidden() const; + void set_expose_hidden(bool value); + + // @@protoc_insertion_point(class_scope:caffe.RecurrentParameter) + private: + inline void set_has_num_output(); + inline void clear_has_num_output(); + inline void set_has_weight_filler(); + inline void clear_has_weight_filler(); + inline void set_has_bias_filler(); + inline void clear_has_bias_filler(); + inline void set_has_debug_info(); + inline void clear_has_debug_info(); + inline void set_has_expose_hidden(); + inline void clear_has_expose_hidden(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* weight_filler_; + ::caffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 num_output_; + bool debug_info_; + bool expose_hidden_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed RecurrentParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ReductionParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ReductionParameter) */ { + public: + ReductionParameter(); + virtual ~ReductionParameter(); + + ReductionParameter(const ReductionParameter& from); + + inline ReductionParameter& operator=(const ReductionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ReductionParameter& default_instance(); + + static const ReductionParameter* internal_default_instance(); + + void Swap(ReductionParameter* other); + + // implements Message ---------------------------------------------- + + inline ReductionParameter* New() const { return New(NULL); } + + ReductionParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ReductionParameter& from); + void MergeFrom(const ReductionParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReductionParameter* other); + void UnsafeMergeFrom(const ReductionParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef ReductionParameter_ReductionOp ReductionOp; + static const ReductionOp SUM = + ReductionParameter_ReductionOp_SUM; + static const ReductionOp ASUM = + ReductionParameter_ReductionOp_ASUM; + static const ReductionOp SUMSQ = + ReductionParameter_ReductionOp_SUMSQ; + static const ReductionOp MEAN = + ReductionParameter_ReductionOp_MEAN; + static inline bool ReductionOp_IsValid(int value) { + return ReductionParameter_ReductionOp_IsValid(value); + } + static const ReductionOp ReductionOp_MIN = + ReductionParameter_ReductionOp_ReductionOp_MIN; + static const ReductionOp ReductionOp_MAX = + ReductionParameter_ReductionOp_ReductionOp_MAX; + static const int ReductionOp_ARRAYSIZE = + ReductionParameter_ReductionOp_ReductionOp_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + ReductionOp_descriptor() { + return ReductionParameter_ReductionOp_descriptor(); + } + static inline const ::std::string& ReductionOp_Name(ReductionOp value) { + return ReductionParameter_ReductionOp_Name(value); + } + static inline bool ReductionOp_Parse(const ::std::string& name, + ReductionOp* value) { + return ReductionParameter_ReductionOp_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + bool has_operation() const; + void clear_operation(); + static const int kOperationFieldNumber = 1; + ::caffe::ReductionParameter_ReductionOp operation() const; + void set_operation(::caffe::ReductionParameter_ReductionOp value); + + // optional int32 axis = 2 [default = 0]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 2; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional float coeff = 3 [default = 1]; + bool has_coeff() const; + void clear_coeff(); + static const int kCoeffFieldNumber = 3; + float coeff() const; + void set_coeff(float value); + + // @@protoc_insertion_point(class_scope:caffe.ReductionParameter) + private: + inline void set_has_operation(); + inline void clear_has_operation(); + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_coeff(); + inline void clear_has_coeff(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + int operation_; + float coeff_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ReductionParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ReLUParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ReLUParameter) */ { + public: + ReLUParameter(); + virtual ~ReLUParameter(); + + ReLUParameter(const ReLUParameter& from); + + inline ReLUParameter& operator=(const ReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ReLUParameter& default_instance(); + + static const ReLUParameter* internal_default_instance(); + + void Swap(ReLUParameter* other); + + // implements Message ---------------------------------------------- + + inline ReLUParameter* New() const { return New(NULL); } + + ReLUParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ReLUParameter& from); + void MergeFrom(const ReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReLUParameter* other); + void UnsafeMergeFrom(const ReLUParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef ReLUParameter_Engine Engine; + static const Engine DEFAULT = + ReLUParameter_Engine_DEFAULT; + static const Engine CAFFE = + ReLUParameter_Engine_CAFFE; + static const Engine CUDNN = + ReLUParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return ReLUParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + ReLUParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + ReLUParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + ReLUParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return ReLUParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return ReLUParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return ReLUParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional float negative_slope = 1 [default = 0]; + bool has_negative_slope() const; + void clear_negative_slope(); + static const int kNegativeSlopeFieldNumber = 1; + float negative_slope() const; + void set_negative_slope(float value); + + // optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 2; + ::caffe::ReLUParameter_Engine engine() const; + void set_engine(::caffe::ReLUParameter_Engine value); + + // @@protoc_insertion_point(class_scope:caffe.ReLUParameter) + private: + inline void set_has_negative_slope(); + inline void clear_has_negative_slope(); + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float negative_slope_; + int engine_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ReLUParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ReshapeParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ReshapeParameter) */ { + public: + ReshapeParameter(); + virtual ~ReshapeParameter(); + + ReshapeParameter(const ReshapeParameter& from); + + inline ReshapeParameter& operator=(const ReshapeParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ReshapeParameter& default_instance(); + + static const ReshapeParameter* internal_default_instance(); + + void Swap(ReshapeParameter* other); + + // implements Message ---------------------------------------------- + + inline ReshapeParameter* New() const { return New(NULL); } + + ReshapeParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ReshapeParameter& from); + void MergeFrom(const ReshapeParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReshapeParameter* other); + void UnsafeMergeFrom(const ReshapeParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.BlobShape shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::caffe::BlobShape& shape() const; + ::caffe::BlobShape* mutable_shape(); + ::caffe::BlobShape* release_shape(); + void set_allocated_shape(::caffe::BlobShape* shape); + + // optional int32 axis = 2 [default = 0]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 2; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 3 [default = -1]; + bool has_num_axes() const; + void clear_num_axes(); + static const int kNumAxesFieldNumber = 3; + ::google::protobuf::int32 num_axes() const; + void set_num_axes(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.ReshapeParameter) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_num_axes(); + inline void clear_has_num_axes(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::BlobShape* shape_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ReshapeParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ScaleParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ScaleParameter) */ { + public: + ScaleParameter(); + virtual ~ScaleParameter(); + + ScaleParameter(const ScaleParameter& from); + + inline ScaleParameter& operator=(const ScaleParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ScaleParameter& default_instance(); + + static const ScaleParameter* internal_default_instance(); + + void Swap(ScaleParameter* other); + + // implements Message ---------------------------------------------- + + inline ScaleParameter* New() const { return New(NULL); } + + ScaleParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ScaleParameter& from); + void MergeFrom(const ScaleParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ScaleParameter* other); + void UnsafeMergeFrom(const ScaleParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 1; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 2 [default = 1]; + bool has_num_axes() const; + void clear_num_axes(); + static const int kNumAxesFieldNumber = 2; + ::google::protobuf::int32 num_axes() const; + void set_num_axes(::google::protobuf::int32 value); + + // optional .caffe.FillerParameter filler = 3; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 3; + const ::caffe::FillerParameter& filler() const; + ::caffe::FillerParameter* mutable_filler(); + ::caffe::FillerParameter* release_filler(); + void set_allocated_filler(::caffe::FillerParameter* filler); + + // optional bool bias_term = 4 [default = false]; + bool has_bias_term() const; + void clear_bias_term(); + static const int kBiasTermFieldNumber = 4; + bool bias_term() const; + void set_bias_term(bool value); + + // optional .caffe.FillerParameter bias_filler = 5; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + const ::caffe::FillerParameter& bias_filler() const; + ::caffe::FillerParameter* mutable_bias_filler(); + ::caffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::caffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:caffe.ScaleParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_num_axes(); + inline void clear_has_num_axes(); + inline void set_has_filler(); + inline void clear_has_filler(); + inline void set_has_bias_term(); + inline void clear_has_bias_term(); + inline void set_has_bias_filler(); + inline void clear_has_bias_filler(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* filler_; + ::caffe::FillerParameter* bias_filler_; + bool bias_term_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ScaleParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SigmoidParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SigmoidParameter) */ { + public: + SigmoidParameter(); + virtual ~SigmoidParameter(); + + SigmoidParameter(const SigmoidParameter& from); + + inline SigmoidParameter& operator=(const SigmoidParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SigmoidParameter& default_instance(); + + static const SigmoidParameter* internal_default_instance(); + + void Swap(SigmoidParameter* other); + + // implements Message ---------------------------------------------- + + inline SigmoidParameter* New() const { return New(NULL); } + + SigmoidParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SigmoidParameter& from); + void MergeFrom(const SigmoidParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SigmoidParameter* other); + void UnsafeMergeFrom(const SigmoidParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef SigmoidParameter_Engine Engine; + static const Engine DEFAULT = + SigmoidParameter_Engine_DEFAULT; + static const Engine CAFFE = + SigmoidParameter_Engine_CAFFE; + static const Engine CUDNN = + SigmoidParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return SigmoidParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + SigmoidParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + SigmoidParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + SigmoidParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return SigmoidParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return SigmoidParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return SigmoidParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::caffe::SigmoidParameter_Engine engine() const; + void set_engine(::caffe::SigmoidParameter_Engine value); + + // @@protoc_insertion_point(class_scope:caffe.SigmoidParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + int engine_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SigmoidParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SliceParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SliceParameter) */ { + public: + SliceParameter(); + virtual ~SliceParameter(); + + SliceParameter(const SliceParameter& from); + + inline SliceParameter& operator=(const SliceParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SliceParameter& default_instance(); + + static const SliceParameter* internal_default_instance(); + + void Swap(SliceParameter* other); + + // implements Message ---------------------------------------------- + + inline SliceParameter* New() const { return New(NULL); } + + SliceParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SliceParameter& from); + void MergeFrom(const SliceParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SliceParameter* other); + void UnsafeMergeFrom(const SliceParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 3 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 3; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // repeated uint32 slice_point = 2; + int slice_point_size() const; + void clear_slice_point(); + static const int kSlicePointFieldNumber = 2; + ::google::protobuf::uint32 slice_point(int index) const; + void set_slice_point(int index, ::google::protobuf::uint32 value); + void add_slice_point(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + slice_point() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_slice_point(); + + // optional uint32 slice_dim = 1 [default = 1]; + bool has_slice_dim() const; + void clear_slice_dim(); + static const int kSliceDimFieldNumber = 1; + ::google::protobuf::uint32 slice_dim() const; + void set_slice_dim(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:caffe.SliceParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_slice_dim(); + inline void clear_has_slice_dim(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > slice_point_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 slice_dim_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SliceParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SoftmaxParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SoftmaxParameter) */ { + public: + SoftmaxParameter(); + virtual ~SoftmaxParameter(); + + SoftmaxParameter(const SoftmaxParameter& from); + + inline SoftmaxParameter& operator=(const SoftmaxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SoftmaxParameter& default_instance(); + + static const SoftmaxParameter* internal_default_instance(); + + void Swap(SoftmaxParameter* other); + + // implements Message ---------------------------------------------- + + inline SoftmaxParameter* New() const { return New(NULL); } + + SoftmaxParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SoftmaxParameter& from); + void MergeFrom(const SoftmaxParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SoftmaxParameter* other); + void UnsafeMergeFrom(const SoftmaxParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef SoftmaxParameter_Engine Engine; + static const Engine DEFAULT = + SoftmaxParameter_Engine_DEFAULT; + static const Engine CAFFE = + SoftmaxParameter_Engine_CAFFE; + static const Engine CUDNN = + SoftmaxParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return SoftmaxParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + SoftmaxParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + SoftmaxParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + SoftmaxParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return SoftmaxParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return SoftmaxParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return SoftmaxParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::caffe::SoftmaxParameter_Engine engine() const; + void set_engine(::caffe::SoftmaxParameter_Engine value); + + // optional int32 axis = 2 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 2; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.SoftmaxParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + int engine_; + ::google::protobuf::int32 axis_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SoftmaxParameter_default_instance_; + +// ------------------------------------------------------------------- + +class TanHParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.TanHParameter) */ { + public: + TanHParameter(); + virtual ~TanHParameter(); + + TanHParameter(const TanHParameter& from); + + inline TanHParameter& operator=(const TanHParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TanHParameter& default_instance(); + + static const TanHParameter* internal_default_instance(); + + void Swap(TanHParameter* other); + + // implements Message ---------------------------------------------- + + inline TanHParameter* New() const { return New(NULL); } + + TanHParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TanHParameter& from); + void MergeFrom(const TanHParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TanHParameter* other); + void UnsafeMergeFrom(const TanHParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef TanHParameter_Engine Engine; + static const Engine DEFAULT = + TanHParameter_Engine_DEFAULT; + static const Engine CAFFE = + TanHParameter_Engine_CAFFE; + static const Engine CUDNN = + TanHParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return TanHParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + TanHParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + TanHParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + TanHParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return TanHParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return TanHParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return TanHParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::caffe::TanHParameter_Engine engine() const; + void set_engine(::caffe::TanHParameter_Engine value); + + // @@protoc_insertion_point(class_scope:caffe.TanHParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + int engine_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed TanHParameter_default_instance_; + +// ------------------------------------------------------------------- + +class TileParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.TileParameter) */ { + public: + TileParameter(); + virtual ~TileParameter(); + + TileParameter(const TileParameter& from); + + inline TileParameter& operator=(const TileParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TileParameter& default_instance(); + + static const TileParameter* internal_default_instance(); + + void Swap(TileParameter* other); + + // implements Message ---------------------------------------------- + + inline TileParameter* New() const { return New(NULL); } + + TileParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TileParameter& from); + void MergeFrom(const TileParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TileParameter* other); + void UnsafeMergeFrom(const TileParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + bool has_axis() const; + void clear_axis(); + static const int kAxisFieldNumber = 1; + ::google::protobuf::int32 axis() const; + void set_axis(::google::protobuf::int32 value); + + // optional int32 tiles = 2; + bool has_tiles() const; + void clear_tiles(); + static const int kTilesFieldNumber = 2; + ::google::protobuf::int32 tiles() const; + void set_tiles(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:caffe.TileParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_tiles(); + inline void clear_has_tiles(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int32 tiles_; + ::google::protobuf::int32 axis_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed TileParameter_default_instance_; + +// ------------------------------------------------------------------- + +class ThresholdParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.ThresholdParameter) */ { + public: + ThresholdParameter(); + virtual ~ThresholdParameter(); + + ThresholdParameter(const ThresholdParameter& from); + + inline ThresholdParameter& operator=(const ThresholdParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ThresholdParameter& default_instance(); + + static const ThresholdParameter* internal_default_instance(); + + void Swap(ThresholdParameter* other); + + // implements Message ---------------------------------------------- + + inline ThresholdParameter* New() const { return New(NULL); } + + ThresholdParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ThresholdParameter& from); + void MergeFrom(const ThresholdParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ThresholdParameter* other); + void UnsafeMergeFrom(const ThresholdParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float threshold = 1 [default = 0]; + bool has_threshold() const; + void clear_threshold(); + static const int kThresholdFieldNumber = 1; + float threshold() const; + void set_threshold(float value); + + // @@protoc_insertion_point(class_scope:caffe.ThresholdParameter) + private: + inline void set_has_threshold(); + inline void clear_has_threshold(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float threshold_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed ThresholdParameter_default_instance_; + +// ------------------------------------------------------------------- + +class WindowDataParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.WindowDataParameter) */ { + public: + WindowDataParameter(); + virtual ~WindowDataParameter(); + + WindowDataParameter(const WindowDataParameter& from); + + inline WindowDataParameter& operator=(const WindowDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const WindowDataParameter& default_instance(); + + static const WindowDataParameter* internal_default_instance(); + + void Swap(WindowDataParameter* other); + + // implements Message ---------------------------------------------- + + inline WindowDataParameter* New() const { return New(NULL); } + + WindowDataParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const WindowDataParameter& from); + void MergeFrom(const WindowDataParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(WindowDataParameter* other); + void UnsafeMergeFrom(const WindowDataParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 1; + const ::std::string& source() const; + void set_source(const ::std::string& value); + void set_source(const char* value); + void set_source(const char* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // optional float scale = 2 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 2; + float scale() const; + void set_scale(float value); + + // optional string mean_file = 3; + bool has_mean_file() const; + void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + const ::std::string& mean_file() const; + void set_mean_file(const ::std::string& value); + void set_mean_file(const char* value); + void set_mean_file(const char* value, size_t size); + ::std::string* mutable_mean_file(); + ::std::string* release_mean_file(); + void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 batch_size = 4; + bool has_batch_size() const; + void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + ::google::protobuf::uint32 batch_size() const; + void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 crop_size = 5 [default = 0]; + bool has_crop_size() const; + void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + ::google::protobuf::uint32 crop_size() const; + void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + bool has_mirror() const; + void clear_mirror(); + static const int kMirrorFieldNumber = 6; + bool mirror() const; + void set_mirror(bool value); + + // optional float fg_threshold = 7 [default = 0.5]; + bool has_fg_threshold() const; + void clear_fg_threshold(); + static const int kFgThresholdFieldNumber = 7; + float fg_threshold() const; + void set_fg_threshold(float value); + + // optional float bg_threshold = 8 [default = 0.5]; + bool has_bg_threshold() const; + void clear_bg_threshold(); + static const int kBgThresholdFieldNumber = 8; + float bg_threshold() const; + void set_bg_threshold(float value); + + // optional float fg_fraction = 9 [default = 0.25]; + bool has_fg_fraction() const; + void clear_fg_fraction(); + static const int kFgFractionFieldNumber = 9; + float fg_fraction() const; + void set_fg_fraction(float value); + + // optional uint32 context_pad = 10 [default = 0]; + bool has_context_pad() const; + void clear_context_pad(); + static const int kContextPadFieldNumber = 10; + ::google::protobuf::uint32 context_pad() const; + void set_context_pad(::google::protobuf::uint32 value); + + // optional string crop_mode = 11 [default = "warp"]; + bool has_crop_mode() const; + void clear_crop_mode(); + static const int kCropModeFieldNumber = 11; + const ::std::string& crop_mode() const; + void set_crop_mode(const ::std::string& value); + void set_crop_mode(const char* value); + void set_crop_mode(const char* value, size_t size); + ::std::string* mutable_crop_mode(); + ::std::string* release_crop_mode(); + void set_allocated_crop_mode(::std::string* crop_mode); + + // optional bool cache_images = 12 [default = false]; + bool has_cache_images() const; + void clear_cache_images(); + static const int kCacheImagesFieldNumber = 12; + bool cache_images() const; + void set_cache_images(bool value); + + // optional string root_folder = 13 [default = ""]; + bool has_root_folder() const; + void clear_root_folder(); + static const int kRootFolderFieldNumber = 13; + const ::std::string& root_folder() const; + void set_root_folder(const ::std::string& value); + void set_root_folder(const char* value); + void set_root_folder(const char* value, size_t size); + ::std::string* mutable_root_folder(); + ::std::string* release_root_folder(); + void set_allocated_root_folder(::std::string* root_folder); + + // @@protoc_insertion_point(class_scope:caffe.WindowDataParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_mean_file(); + inline void clear_has_mean_file(); + inline void set_has_batch_size(); + inline void clear_has_batch_size(); + inline void set_has_crop_size(); + inline void clear_has_crop_size(); + inline void set_has_mirror(); + inline void clear_has_mirror(); + inline void set_has_fg_threshold(); + inline void clear_has_fg_threshold(); + inline void set_has_bg_threshold(); + inline void clear_has_bg_threshold(); + inline void set_has_fg_fraction(); + inline void clear_has_fg_fraction(); + inline void set_has_context_pad(); + inline void clear_has_context_pad(); + inline void set_has_crop_mode(); + inline void clear_has_crop_mode(); + inline void set_has_cache_images(); + inline void clear_has_cache_images(); + inline void set_has_root_folder(); + inline void clear_has_root_folder(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + static ::std::string* _default_crop_mode_; + ::google::protobuf::internal::ArenaStringPtr crop_mode_; + ::google::protobuf::internal::ArenaStringPtr root_folder_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool cache_images_; + ::google::protobuf::uint32 context_pad_; + float scale_; + float fg_threshold_; + float bg_threshold_; + float fg_fraction_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed WindowDataParameter_default_instance_; + +// ------------------------------------------------------------------- + +class SPPParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.SPPParameter) */ { + public: + SPPParameter(); + virtual ~SPPParameter(); + + SPPParameter(const SPPParameter& from); + + inline SPPParameter& operator=(const SPPParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SPPParameter& default_instance(); + + static const SPPParameter* internal_default_instance(); + + void Swap(SPPParameter* other); + + // implements Message ---------------------------------------------- + + inline SPPParameter* New() const { return New(NULL); } + + SPPParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SPPParameter& from); + void MergeFrom(const SPPParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SPPParameter* other); + void UnsafeMergeFrom(const SPPParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef SPPParameter_PoolMethod PoolMethod; + static const PoolMethod MAX = + SPPParameter_PoolMethod_MAX; + static const PoolMethod AVE = + SPPParameter_PoolMethod_AVE; + static const PoolMethod STOCHASTIC = + SPPParameter_PoolMethod_STOCHASTIC; + static inline bool PoolMethod_IsValid(int value) { + return SPPParameter_PoolMethod_IsValid(value); + } + static const PoolMethod PoolMethod_MIN = + SPPParameter_PoolMethod_PoolMethod_MIN; + static const PoolMethod PoolMethod_MAX = + SPPParameter_PoolMethod_PoolMethod_MAX; + static const int PoolMethod_ARRAYSIZE = + SPPParameter_PoolMethod_PoolMethod_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + PoolMethod_descriptor() { + return SPPParameter_PoolMethod_descriptor(); + } + static inline const ::std::string& PoolMethod_Name(PoolMethod value) { + return SPPParameter_PoolMethod_Name(value); + } + static inline bool PoolMethod_Parse(const ::std::string& name, + PoolMethod* value) { + return SPPParameter_PoolMethod_Parse(name, value); + } + + typedef SPPParameter_Engine Engine; + static const Engine DEFAULT = + SPPParameter_Engine_DEFAULT; + static const Engine CAFFE = + SPPParameter_Engine_CAFFE; + static const Engine CUDNN = + SPPParameter_Engine_CUDNN; + static inline bool Engine_IsValid(int value) { + return SPPParameter_Engine_IsValid(value); + } + static const Engine Engine_MIN = + SPPParameter_Engine_Engine_MIN; + static const Engine Engine_MAX = + SPPParameter_Engine_Engine_MAX; + static const int Engine_ARRAYSIZE = + SPPParameter_Engine_Engine_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Engine_descriptor() { + return SPPParameter_Engine_descriptor(); + } + static inline const ::std::string& Engine_Name(Engine value) { + return SPPParameter_Engine_Name(value); + } + static inline bool Engine_Parse(const ::std::string& name, + Engine* value) { + return SPPParameter_Engine_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional uint32 pyramid_height = 1; + bool has_pyramid_height() const; + void clear_pyramid_height(); + static const int kPyramidHeightFieldNumber = 1; + ::google::protobuf::uint32 pyramid_height() const; + void set_pyramid_height(::google::protobuf::uint32 value); + + // optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 2; + ::caffe::SPPParameter_PoolMethod pool() const; + void set_pool(::caffe::SPPParameter_PoolMethod value); + + // optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 6; + ::caffe::SPPParameter_Engine engine() const; + void set_engine(::caffe::SPPParameter_Engine value); + + // @@protoc_insertion_point(class_scope:caffe.SPPParameter) + private: + inline void set_has_pyramid_height(); + inline void clear_has_pyramid_height(); + inline void set_has_pool(); + inline void clear_has_pool(); + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::uint32 pyramid_height_; + int pool_; + int engine_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed SPPParameter_default_instance_; + +// ------------------------------------------------------------------- + +class V1LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.V1LayerParameter) */ { + public: + V1LayerParameter(); + virtual ~V1LayerParameter(); + + V1LayerParameter(const V1LayerParameter& from); + + inline V1LayerParameter& operator=(const V1LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const V1LayerParameter& default_instance(); + + static const V1LayerParameter* internal_default_instance(); + + void Swap(V1LayerParameter* other); + + // implements Message ---------------------------------------------- + + inline V1LayerParameter* New() const { return New(NULL); } + + V1LayerParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const V1LayerParameter& from); + void MergeFrom(const V1LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(V1LayerParameter* other); + void UnsafeMergeFrom(const V1LayerParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef V1LayerParameter_LayerType LayerType; + static const LayerType NONE = + V1LayerParameter_LayerType_NONE; + static const LayerType ABSVAL = + V1LayerParameter_LayerType_ABSVAL; + static const LayerType ACCURACY = + V1LayerParameter_LayerType_ACCURACY; + static const LayerType ARGMAX = + V1LayerParameter_LayerType_ARGMAX; + static const LayerType BNLL = + V1LayerParameter_LayerType_BNLL; + static const LayerType CONCAT = + V1LayerParameter_LayerType_CONCAT; + static const LayerType CONTRASTIVE_LOSS = + V1LayerParameter_LayerType_CONTRASTIVE_LOSS; + static const LayerType CONVOLUTION = + V1LayerParameter_LayerType_CONVOLUTION; + static const LayerType DATA = + V1LayerParameter_LayerType_DATA; + static const LayerType DECONVOLUTION = + V1LayerParameter_LayerType_DECONVOLUTION; + static const LayerType DROPOUT = + V1LayerParameter_LayerType_DROPOUT; + static const LayerType DUMMY_DATA = + V1LayerParameter_LayerType_DUMMY_DATA; + static const LayerType EUCLIDEAN_LOSS = + V1LayerParameter_LayerType_EUCLIDEAN_LOSS; + static const LayerType ELTWISE = + V1LayerParameter_LayerType_ELTWISE; + static const LayerType EXP = + V1LayerParameter_LayerType_EXP; + static const LayerType FLATTEN = + V1LayerParameter_LayerType_FLATTEN; + static const LayerType HDF5_DATA = + V1LayerParameter_LayerType_HDF5_DATA; + static const LayerType HDF5_OUTPUT = + V1LayerParameter_LayerType_HDF5_OUTPUT; + static const LayerType HINGE_LOSS = + V1LayerParameter_LayerType_HINGE_LOSS; + static const LayerType IM2COL = + V1LayerParameter_LayerType_IM2COL; + static const LayerType IMAGE_DATA = + V1LayerParameter_LayerType_IMAGE_DATA; + static const LayerType INFOGAIN_LOSS = + V1LayerParameter_LayerType_INFOGAIN_LOSS; + static const LayerType INNER_PRODUCT = + V1LayerParameter_LayerType_INNER_PRODUCT; + static const LayerType LRN = + V1LayerParameter_LayerType_LRN; + static const LayerType MEMORY_DATA = + V1LayerParameter_LayerType_MEMORY_DATA; + static const LayerType MULTINOMIAL_LOGISTIC_LOSS = + V1LayerParameter_LayerType_MULTINOMIAL_LOGISTIC_LOSS; + static const LayerType MVN = + V1LayerParameter_LayerType_MVN; + static const LayerType POOLING = + V1LayerParameter_LayerType_POOLING; + static const LayerType POWER = + V1LayerParameter_LayerType_POWER; + static const LayerType RELU = + V1LayerParameter_LayerType_RELU; + static const LayerType SIGMOID = + V1LayerParameter_LayerType_SIGMOID; + static const LayerType SIGMOID_CROSS_ENTROPY_LOSS = + V1LayerParameter_LayerType_SIGMOID_CROSS_ENTROPY_LOSS; + static const LayerType SILENCE = + V1LayerParameter_LayerType_SILENCE; + static const LayerType SOFTMAX = + V1LayerParameter_LayerType_SOFTMAX; + static const LayerType SOFTMAX_LOSS = + V1LayerParameter_LayerType_SOFTMAX_LOSS; + static const LayerType SPLIT = + V1LayerParameter_LayerType_SPLIT; + static const LayerType SLICE = + V1LayerParameter_LayerType_SLICE; + static const LayerType TANH = + V1LayerParameter_LayerType_TANH; + static const LayerType WINDOW_DATA = + V1LayerParameter_LayerType_WINDOW_DATA; + static const LayerType THRESHOLD = + V1LayerParameter_LayerType_THRESHOLD; + static inline bool LayerType_IsValid(int value) { + return V1LayerParameter_LayerType_IsValid(value); + } + static const LayerType LayerType_MIN = + V1LayerParameter_LayerType_LayerType_MIN; + static const LayerType LayerType_MAX = + V1LayerParameter_LayerType_LayerType_MAX; + static const int LayerType_ARRAYSIZE = + V1LayerParameter_LayerType_LayerType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + LayerType_descriptor() { + return V1LayerParameter_LayerType_descriptor(); + } + static inline const ::std::string& LayerType_Name(LayerType value) { + return V1LayerParameter_LayerType_Name(value); + } + static inline bool LayerType_Parse(const ::std::string& name, + LayerType* value) { + return V1LayerParameter_LayerType_Parse(name, value); + } + + typedef V1LayerParameter_DimCheckMode DimCheckMode; + static const DimCheckMode STRICT = + V1LayerParameter_DimCheckMode_STRICT; + static const DimCheckMode PERMISSIVE = + V1LayerParameter_DimCheckMode_PERMISSIVE; + static inline bool DimCheckMode_IsValid(int value) { + return V1LayerParameter_DimCheckMode_IsValid(value); + } + static const DimCheckMode DimCheckMode_MIN = + V1LayerParameter_DimCheckMode_DimCheckMode_MIN; + static const DimCheckMode DimCheckMode_MAX = + V1LayerParameter_DimCheckMode_DimCheckMode_MAX; + static const int DimCheckMode_ARRAYSIZE = + V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + DimCheckMode_descriptor() { + return V1LayerParameter_DimCheckMode_descriptor(); + } + static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) { + return V1LayerParameter_DimCheckMode_Name(value); + } + static inline bool DimCheckMode_Parse(const ::std::string& name, + DimCheckMode* value) { + return V1LayerParameter_DimCheckMode_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // repeated string bottom = 2; + int bottom_size() const; + void clear_bottom(); + static const int kBottomFieldNumber = 2; + const ::std::string& bottom(int index) const; + ::std::string* mutable_bottom(int index); + void set_bottom(int index, const ::std::string& value); + void set_bottom(int index, const char* value); + void set_bottom(int index, const char* value, size_t size); + ::std::string* add_bottom(); + void add_bottom(const ::std::string& value); + void add_bottom(const char* value); + void add_bottom(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom(); + + // repeated string top = 3; + int top_size() const; + void clear_top(); + static const int kTopFieldNumber = 3; + const ::std::string& top(int index) const; + ::std::string* mutable_top(int index); + void set_top(int index, const ::std::string& value); + void set_top(int index, const char* value); + void set_top(int index, const char* value, size_t size); + ::std::string* add_top(); + void add_top(const ::std::string& value); + void add_top(const char* value); + void add_top(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top(); + + // optional string name = 4; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 4; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // repeated .caffe.NetStateRule include = 32; + int include_size() const; + void clear_include(); + static const int kIncludeFieldNumber = 32; + const ::caffe::NetStateRule& include(int index) const; + ::caffe::NetStateRule* mutable_include(int index); + ::caffe::NetStateRule* add_include(); + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* + mutable_include(); + const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& + include() const; + + // repeated .caffe.NetStateRule exclude = 33; + int exclude_size() const; + void clear_exclude(); + static const int kExcludeFieldNumber = 33; + const ::caffe::NetStateRule& exclude(int index) const; + ::caffe::NetStateRule* mutable_exclude(int index); + ::caffe::NetStateRule* add_exclude(); + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* + mutable_exclude(); + const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& + exclude() const; + + // optional .caffe.V1LayerParameter.LayerType type = 5; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 5; + ::caffe::V1LayerParameter_LayerType type() const; + void set_type(::caffe::V1LayerParameter_LayerType value); + + // repeated .caffe.BlobProto blobs = 6; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 6; + const ::caffe::BlobProto& blobs(int index) const; + ::caffe::BlobProto* mutable_blobs(int index); + ::caffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& + blobs() const; + + // repeated string param = 1001; + int param_size() const; + void clear_param(); + static const int kParamFieldNumber = 1001; + const ::std::string& param(int index) const; + ::std::string* mutable_param(int index); + void set_param(int index, const ::std::string& value); + void set_param(int index, const char* value); + void set_param(int index, const char* value, size_t size); + ::std::string* add_param(); + void add_param(const ::std::string& value); + void add_param(const char* value); + void add_param(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& param() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_param(); + + // repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + int blob_share_mode_size() const; + void clear_blob_share_mode(); + static const int kBlobShareModeFieldNumber = 1002; + ::caffe::V1LayerParameter_DimCheckMode blob_share_mode(int index) const; + void set_blob_share_mode(int index, ::caffe::V1LayerParameter_DimCheckMode value); + void add_blob_share_mode(::caffe::V1LayerParameter_DimCheckMode value); + const ::google::protobuf::RepeatedField& blob_share_mode() const; + ::google::protobuf::RepeatedField* mutable_blob_share_mode(); + + // repeated float blobs_lr = 7; + int blobs_lr_size() const; + void clear_blobs_lr(); + static const int kBlobsLrFieldNumber = 7; + float blobs_lr(int index) const; + void set_blobs_lr(int index, float value); + void add_blobs_lr(float value); + const ::google::protobuf::RepeatedField< float >& + blobs_lr() const; + ::google::protobuf::RepeatedField< float >* + mutable_blobs_lr(); + + // repeated float weight_decay = 8; + int weight_decay_size() const; + void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 8; + float weight_decay(int index) const; + void set_weight_decay(int index, float value); + void add_weight_decay(float value); + const ::google::protobuf::RepeatedField< float >& + weight_decay() const; + ::google::protobuf::RepeatedField< float >* + mutable_weight_decay(); + + // repeated float loss_weight = 35; + int loss_weight_size() const; + void clear_loss_weight(); + static const int kLossWeightFieldNumber = 35; + float loss_weight(int index) const; + void set_loss_weight(int index, float value); + void add_loss_weight(float value); + const ::google::protobuf::RepeatedField< float >& + loss_weight() const; + ::google::protobuf::RepeatedField< float >* + mutable_loss_weight(); + + // optional .caffe.AccuracyParameter accuracy_param = 27; + bool has_accuracy_param() const; + void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 27; + const ::caffe::AccuracyParameter& accuracy_param() const; + ::caffe::AccuracyParameter* mutable_accuracy_param(); + ::caffe::AccuracyParameter* release_accuracy_param(); + void set_allocated_accuracy_param(::caffe::AccuracyParameter* accuracy_param); + + // optional .caffe.ArgMaxParameter argmax_param = 23; + bool has_argmax_param() const; + void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 23; + const ::caffe::ArgMaxParameter& argmax_param() const; + ::caffe::ArgMaxParameter* mutable_argmax_param(); + ::caffe::ArgMaxParameter* release_argmax_param(); + void set_allocated_argmax_param(::caffe::ArgMaxParameter* argmax_param); + + // optional .caffe.ConcatParameter concat_param = 9; + bool has_concat_param() const; + void clear_concat_param(); + static const int kConcatParamFieldNumber = 9; + const ::caffe::ConcatParameter& concat_param() const; + ::caffe::ConcatParameter* mutable_concat_param(); + ::caffe::ConcatParameter* release_concat_param(); + void set_allocated_concat_param(::caffe::ConcatParameter* concat_param); + + // optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; + bool has_contrastive_loss_param() const; + void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 40; + const ::caffe::ContrastiveLossParameter& contrastive_loss_param() const; + ::caffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + ::caffe::ContrastiveLossParameter* release_contrastive_loss_param(); + void set_allocated_contrastive_loss_param(::caffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .caffe.ConvolutionParameter convolution_param = 10; + bool has_convolution_param() const; + void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 10; + const ::caffe::ConvolutionParameter& convolution_param() const; + ::caffe::ConvolutionParameter* mutable_convolution_param(); + ::caffe::ConvolutionParameter* release_convolution_param(); + void set_allocated_convolution_param(::caffe::ConvolutionParameter* convolution_param); + + // optional .caffe.DataParameter data_param = 11; + bool has_data_param() const; + void clear_data_param(); + static const int kDataParamFieldNumber = 11; + const ::caffe::DataParameter& data_param() const; + ::caffe::DataParameter* mutable_data_param(); + ::caffe::DataParameter* release_data_param(); + void set_allocated_data_param(::caffe::DataParameter* data_param); + + // optional .caffe.DropoutParameter dropout_param = 12; + bool has_dropout_param() const; + void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 12; + const ::caffe::DropoutParameter& dropout_param() const; + ::caffe::DropoutParameter* mutable_dropout_param(); + ::caffe::DropoutParameter* release_dropout_param(); + void set_allocated_dropout_param(::caffe::DropoutParameter* dropout_param); + + // optional .caffe.DummyDataParameter dummy_data_param = 26; + bool has_dummy_data_param() const; + void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 26; + const ::caffe::DummyDataParameter& dummy_data_param() const; + ::caffe::DummyDataParameter* mutable_dummy_data_param(); + ::caffe::DummyDataParameter* release_dummy_data_param(); + void set_allocated_dummy_data_param(::caffe::DummyDataParameter* dummy_data_param); + + // optional .caffe.EltwiseParameter eltwise_param = 24; + bool has_eltwise_param() const; + void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 24; + const ::caffe::EltwiseParameter& eltwise_param() const; + ::caffe::EltwiseParameter* mutable_eltwise_param(); + ::caffe::EltwiseParameter* release_eltwise_param(); + void set_allocated_eltwise_param(::caffe::EltwiseParameter* eltwise_param); + + // optional .caffe.ExpParameter exp_param = 41; + bool has_exp_param() const; + void clear_exp_param(); + static const int kExpParamFieldNumber = 41; + const ::caffe::ExpParameter& exp_param() const; + ::caffe::ExpParameter* mutable_exp_param(); + ::caffe::ExpParameter* release_exp_param(); + void set_allocated_exp_param(::caffe::ExpParameter* exp_param); + + // optional .caffe.HDF5DataParameter hdf5_data_param = 13; + bool has_hdf5_data_param() const; + void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 13; + const ::caffe::HDF5DataParameter& hdf5_data_param() const; + ::caffe::HDF5DataParameter* mutable_hdf5_data_param(); + ::caffe::HDF5DataParameter* release_hdf5_data_param(); + void set_allocated_hdf5_data_param(::caffe::HDF5DataParameter* hdf5_data_param); + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 14; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 14; + const ::caffe::HDF5OutputParameter& hdf5_output_param() const; + ::caffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::caffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param); + + // optional .caffe.HingeLossParameter hinge_loss_param = 29; + bool has_hinge_loss_param() const; + void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 29; + const ::caffe::HingeLossParameter& hinge_loss_param() const; + ::caffe::HingeLossParameter* mutable_hinge_loss_param(); + ::caffe::HingeLossParameter* release_hinge_loss_param(); + void set_allocated_hinge_loss_param(::caffe::HingeLossParameter* hinge_loss_param); + + // optional .caffe.ImageDataParameter image_data_param = 15; + bool has_image_data_param() const; + void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 15; + const ::caffe::ImageDataParameter& image_data_param() const; + ::caffe::ImageDataParameter* mutable_image_data_param(); + ::caffe::ImageDataParameter* release_image_data_param(); + void set_allocated_image_data_param(::caffe::ImageDataParameter* image_data_param); + + // optional .caffe.InfogainLossParameter infogain_loss_param = 16; + bool has_infogain_loss_param() const; + void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 16; + const ::caffe::InfogainLossParameter& infogain_loss_param() const; + ::caffe::InfogainLossParameter* mutable_infogain_loss_param(); + ::caffe::InfogainLossParameter* release_infogain_loss_param(); + void set_allocated_infogain_loss_param(::caffe::InfogainLossParameter* infogain_loss_param); + + // optional .caffe.InnerProductParameter inner_product_param = 17; + bool has_inner_product_param() const; + void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 17; + const ::caffe::InnerProductParameter& inner_product_param() const; + ::caffe::InnerProductParameter* mutable_inner_product_param(); + ::caffe::InnerProductParameter* release_inner_product_param(); + void set_allocated_inner_product_param(::caffe::InnerProductParameter* inner_product_param); + + // optional .caffe.LRNParameter lrn_param = 18; + bool has_lrn_param() const; + void clear_lrn_param(); + static const int kLrnParamFieldNumber = 18; + const ::caffe::LRNParameter& lrn_param() const; + ::caffe::LRNParameter* mutable_lrn_param(); + ::caffe::LRNParameter* release_lrn_param(); + void set_allocated_lrn_param(::caffe::LRNParameter* lrn_param); + + // optional .caffe.MemoryDataParameter memory_data_param = 22; + bool has_memory_data_param() const; + void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 22; + const ::caffe::MemoryDataParameter& memory_data_param() const; + ::caffe::MemoryDataParameter* mutable_memory_data_param(); + ::caffe::MemoryDataParameter* release_memory_data_param(); + void set_allocated_memory_data_param(::caffe::MemoryDataParameter* memory_data_param); + + // optional .caffe.MVNParameter mvn_param = 34; + bool has_mvn_param() const; + void clear_mvn_param(); + static const int kMvnParamFieldNumber = 34; + const ::caffe::MVNParameter& mvn_param() const; + ::caffe::MVNParameter* mutable_mvn_param(); + ::caffe::MVNParameter* release_mvn_param(); + void set_allocated_mvn_param(::caffe::MVNParameter* mvn_param); + + // optional .caffe.PoolingParameter pooling_param = 19; + bool has_pooling_param() const; + void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 19; + const ::caffe::PoolingParameter& pooling_param() const; + ::caffe::PoolingParameter* mutable_pooling_param(); + ::caffe::PoolingParameter* release_pooling_param(); + void set_allocated_pooling_param(::caffe::PoolingParameter* pooling_param); + + // optional .caffe.PowerParameter power_param = 21; + bool has_power_param() const; + void clear_power_param(); + static const int kPowerParamFieldNumber = 21; + const ::caffe::PowerParameter& power_param() const; + ::caffe::PowerParameter* mutable_power_param(); + ::caffe::PowerParameter* release_power_param(); + void set_allocated_power_param(::caffe::PowerParameter* power_param); + + // optional .caffe.ReLUParameter relu_param = 30; + bool has_relu_param() const; + void clear_relu_param(); + static const int kReluParamFieldNumber = 30; + const ::caffe::ReLUParameter& relu_param() const; + ::caffe::ReLUParameter* mutable_relu_param(); + ::caffe::ReLUParameter* release_relu_param(); + void set_allocated_relu_param(::caffe::ReLUParameter* relu_param); + + // optional .caffe.SigmoidParameter sigmoid_param = 38; + bool has_sigmoid_param() const; + void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 38; + const ::caffe::SigmoidParameter& sigmoid_param() const; + ::caffe::SigmoidParameter* mutable_sigmoid_param(); + ::caffe::SigmoidParameter* release_sigmoid_param(); + void set_allocated_sigmoid_param(::caffe::SigmoidParameter* sigmoid_param); + + // optional .caffe.SoftmaxParameter softmax_param = 39; + bool has_softmax_param() const; + void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 39; + const ::caffe::SoftmaxParameter& softmax_param() const; + ::caffe::SoftmaxParameter* mutable_softmax_param(); + ::caffe::SoftmaxParameter* release_softmax_param(); + void set_allocated_softmax_param(::caffe::SoftmaxParameter* softmax_param); + + // optional .caffe.SliceParameter slice_param = 31; + bool has_slice_param() const; + void clear_slice_param(); + static const int kSliceParamFieldNumber = 31; + const ::caffe::SliceParameter& slice_param() const; + ::caffe::SliceParameter* mutable_slice_param(); + ::caffe::SliceParameter* release_slice_param(); + void set_allocated_slice_param(::caffe::SliceParameter* slice_param); + + // optional .caffe.TanHParameter tanh_param = 37; + bool has_tanh_param() const; + void clear_tanh_param(); + static const int kTanhParamFieldNumber = 37; + const ::caffe::TanHParameter& tanh_param() const; + ::caffe::TanHParameter* mutable_tanh_param(); + ::caffe::TanHParameter* release_tanh_param(); + void set_allocated_tanh_param(::caffe::TanHParameter* tanh_param); + + // optional .caffe.ThresholdParameter threshold_param = 25; + bool has_threshold_param() const; + void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 25; + const ::caffe::ThresholdParameter& threshold_param() const; + ::caffe::ThresholdParameter* mutable_threshold_param(); + ::caffe::ThresholdParameter* release_threshold_param(); + void set_allocated_threshold_param(::caffe::ThresholdParameter* threshold_param); + + // optional .caffe.WindowDataParameter window_data_param = 20; + bool has_window_data_param() const; + void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 20; + const ::caffe::WindowDataParameter& window_data_param() const; + ::caffe::WindowDataParameter* mutable_window_data_param(); + ::caffe::WindowDataParameter* release_window_data_param(); + void set_allocated_window_data_param(::caffe::WindowDataParameter* window_data_param); + + // optional .caffe.TransformationParameter transform_param = 36; + bool has_transform_param() const; + void clear_transform_param(); + static const int kTransformParamFieldNumber = 36; + const ::caffe::TransformationParameter& transform_param() const; + ::caffe::TransformationParameter* mutable_transform_param(); + ::caffe::TransformationParameter* release_transform_param(); + void set_allocated_transform_param(::caffe::TransformationParameter* transform_param); + + // optional .caffe.LossParameter loss_param = 42; + bool has_loss_param() const; + void clear_loss_param(); + static const int kLossParamFieldNumber = 42; + const ::caffe::LossParameter& loss_param() const; + ::caffe::LossParameter* mutable_loss_param(); + ::caffe::LossParameter* release_loss_param(); + void set_allocated_loss_param(::caffe::LossParameter* loss_param); + + // optional .caffe.V0LayerParameter layer = 1; + bool has_layer() const; + void clear_layer(); + static const int kLayerFieldNumber = 1; + const ::caffe::V0LayerParameter& layer() const; + ::caffe::V0LayerParameter* mutable_layer(); + ::caffe::V0LayerParameter* release_layer(); + void set_allocated_layer(::caffe::V0LayerParameter* layer); + + // @@protoc_insertion_point(class_scope:caffe.V1LayerParameter) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_accuracy_param(); + inline void clear_has_accuracy_param(); + inline void set_has_argmax_param(); + inline void clear_has_argmax_param(); + inline void set_has_concat_param(); + inline void clear_has_concat_param(); + inline void set_has_contrastive_loss_param(); + inline void clear_has_contrastive_loss_param(); + inline void set_has_convolution_param(); + inline void clear_has_convolution_param(); + inline void set_has_data_param(); + inline void clear_has_data_param(); + inline void set_has_dropout_param(); + inline void clear_has_dropout_param(); + inline void set_has_dummy_data_param(); + inline void clear_has_dummy_data_param(); + inline void set_has_eltwise_param(); + inline void clear_has_eltwise_param(); + inline void set_has_exp_param(); + inline void clear_has_exp_param(); + inline void set_has_hdf5_data_param(); + inline void clear_has_hdf5_data_param(); + inline void set_has_hdf5_output_param(); + inline void clear_has_hdf5_output_param(); + inline void set_has_hinge_loss_param(); + inline void clear_has_hinge_loss_param(); + inline void set_has_image_data_param(); + inline void clear_has_image_data_param(); + inline void set_has_infogain_loss_param(); + inline void clear_has_infogain_loss_param(); + inline void set_has_inner_product_param(); + inline void clear_has_inner_product_param(); + inline void set_has_lrn_param(); + inline void clear_has_lrn_param(); + inline void set_has_memory_data_param(); + inline void clear_has_memory_data_param(); + inline void set_has_mvn_param(); + inline void clear_has_mvn_param(); + inline void set_has_pooling_param(); + inline void clear_has_pooling_param(); + inline void set_has_power_param(); + inline void clear_has_power_param(); + inline void set_has_relu_param(); + inline void clear_has_relu_param(); + inline void set_has_sigmoid_param(); + inline void clear_has_sigmoid_param(); + inline void set_has_softmax_param(); + inline void clear_has_softmax_param(); + inline void set_has_slice_param(); + inline void clear_has_slice_param(); + inline void set_has_tanh_param(); + inline void clear_has_tanh_param(); + inline void set_has_threshold_param(); + inline void clear_has_threshold_param(); + inline void set_has_window_data_param(); + inline void clear_has_window_data_param(); + inline void set_has_transform_param(); + inline void clear_has_transform_param(); + inline void set_has_loss_param(); + inline void clear_has_loss_param(); + inline void set_has_layer(); + inline void clear_has_layer(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<2> _has_bits_; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule > exclude_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto > blobs_; + ::google::protobuf::RepeatedPtrField< ::std::string> param_; + ::google::protobuf::RepeatedField blob_share_mode_; + ::google::protobuf::RepeatedField< float > blobs_lr_; + ::google::protobuf::RepeatedField< float > weight_decay_; + ::google::protobuf::RepeatedField< float > loss_weight_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::caffe::AccuracyParameter* accuracy_param_; + ::caffe::ArgMaxParameter* argmax_param_; + ::caffe::ConcatParameter* concat_param_; + ::caffe::ContrastiveLossParameter* contrastive_loss_param_; + ::caffe::ConvolutionParameter* convolution_param_; + ::caffe::DataParameter* data_param_; + ::caffe::DropoutParameter* dropout_param_; + ::caffe::DummyDataParameter* dummy_data_param_; + ::caffe::EltwiseParameter* eltwise_param_; + ::caffe::ExpParameter* exp_param_; + ::caffe::HDF5DataParameter* hdf5_data_param_; + ::caffe::HDF5OutputParameter* hdf5_output_param_; + ::caffe::HingeLossParameter* hinge_loss_param_; + ::caffe::ImageDataParameter* image_data_param_; + ::caffe::InfogainLossParameter* infogain_loss_param_; + ::caffe::InnerProductParameter* inner_product_param_; + ::caffe::LRNParameter* lrn_param_; + ::caffe::MemoryDataParameter* memory_data_param_; + ::caffe::MVNParameter* mvn_param_; + ::caffe::PoolingParameter* pooling_param_; + ::caffe::PowerParameter* power_param_; + ::caffe::ReLUParameter* relu_param_; + ::caffe::SigmoidParameter* sigmoid_param_; + ::caffe::SoftmaxParameter* softmax_param_; + ::caffe::SliceParameter* slice_param_; + ::caffe::TanHParameter* tanh_param_; + ::caffe::ThresholdParameter* threshold_param_; + ::caffe::WindowDataParameter* window_data_param_; + ::caffe::TransformationParameter* transform_param_; + ::caffe::LossParameter* loss_param_; + ::caffe::V0LayerParameter* layer_; + int type_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed V1LayerParameter_default_instance_; + +// ------------------------------------------------------------------- + +class V0LayerParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.V0LayerParameter) */ { + public: + V0LayerParameter(); + virtual ~V0LayerParameter(); + + V0LayerParameter(const V0LayerParameter& from); + + inline V0LayerParameter& operator=(const V0LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const V0LayerParameter& default_instance(); + + static const V0LayerParameter* internal_default_instance(); + + void Swap(V0LayerParameter* other); + + // implements Message ---------------------------------------------- + + inline V0LayerParameter* New() const { return New(NULL); } + + V0LayerParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const V0LayerParameter& from); + void MergeFrom(const V0LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(V0LayerParameter* other); + void UnsafeMergeFrom(const V0LayerParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef V0LayerParameter_PoolMethod PoolMethod; + static const PoolMethod MAX = + V0LayerParameter_PoolMethod_MAX; + static const PoolMethod AVE = + V0LayerParameter_PoolMethod_AVE; + static const PoolMethod STOCHASTIC = + V0LayerParameter_PoolMethod_STOCHASTIC; + static inline bool PoolMethod_IsValid(int value) { + return V0LayerParameter_PoolMethod_IsValid(value); + } + static const PoolMethod PoolMethod_MIN = + V0LayerParameter_PoolMethod_PoolMethod_MIN; + static const PoolMethod PoolMethod_MAX = + V0LayerParameter_PoolMethod_PoolMethod_MAX; + static const int PoolMethod_ARRAYSIZE = + V0LayerParameter_PoolMethod_PoolMethod_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + PoolMethod_descriptor() { + return V0LayerParameter_PoolMethod_descriptor(); + } + static inline const ::std::string& PoolMethod_Name(PoolMethod value) { + return V0LayerParameter_PoolMethod_Name(value); + } + static inline bool PoolMethod_Parse(const ::std::string& name, + PoolMethod* value) { + return V0LayerParameter_PoolMethod_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional string type = 2; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 2; + const ::std::string& type() const; + void set_type(const ::std::string& value); + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + + // optional uint32 num_output = 3; + bool has_num_output() const; + void clear_num_output(); + static const int kNumOutputFieldNumber = 3; + ::google::protobuf::uint32 num_output() const; + void set_num_output(::google::protobuf::uint32 value); + + // optional bool biasterm = 4 [default = true]; + bool has_biasterm() const; + void clear_biasterm(); + static const int kBiastermFieldNumber = 4; + bool biasterm() const; + void set_biasterm(bool value); + + // optional .caffe.FillerParameter weight_filler = 5; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 5; + const ::caffe::FillerParameter& weight_filler() const; + ::caffe::FillerParameter* mutable_weight_filler(); + ::caffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::caffe::FillerParameter* weight_filler); + + // optional .caffe.FillerParameter bias_filler = 6; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 6; + const ::caffe::FillerParameter& bias_filler() const; + ::caffe::FillerParameter* mutable_bias_filler(); + ::caffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::caffe::FillerParameter* bias_filler); + + // optional uint32 pad = 7 [default = 0]; + bool has_pad() const; + void clear_pad(); + static const int kPadFieldNumber = 7; + ::google::protobuf::uint32 pad() const; + void set_pad(::google::protobuf::uint32 value); + + // optional uint32 kernelsize = 8; + bool has_kernelsize() const; + void clear_kernelsize(); + static const int kKernelsizeFieldNumber = 8; + ::google::protobuf::uint32 kernelsize() const; + void set_kernelsize(::google::protobuf::uint32 value); + + // optional uint32 group = 9 [default = 1]; + bool has_group() const; + void clear_group(); + static const int kGroupFieldNumber = 9; + ::google::protobuf::uint32 group() const; + void set_group(::google::protobuf::uint32 value); + + // optional uint32 stride = 10 [default = 1]; + bool has_stride() const; + void clear_stride(); + static const int kStrideFieldNumber = 10; + ::google::protobuf::uint32 stride() const; + void set_stride(::google::protobuf::uint32 value); + + // optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 11; + ::caffe::V0LayerParameter_PoolMethod pool() const; + void set_pool(::caffe::V0LayerParameter_PoolMethod value); + + // optional float dropout_ratio = 12 [default = 0.5]; + bool has_dropout_ratio() const; + void clear_dropout_ratio(); + static const int kDropoutRatioFieldNumber = 12; + float dropout_ratio() const; + void set_dropout_ratio(float value); + + // optional uint32 local_size = 13 [default = 5]; + bool has_local_size() const; + void clear_local_size(); + static const int kLocalSizeFieldNumber = 13; + ::google::protobuf::uint32 local_size() const; + void set_local_size(::google::protobuf::uint32 value); + + // optional float alpha = 14 [default = 1]; + bool has_alpha() const; + void clear_alpha(); + static const int kAlphaFieldNumber = 14; + float alpha() const; + void set_alpha(float value); + + // optional float beta = 15 [default = 0.75]; + bool has_beta() const; + void clear_beta(); + static const int kBetaFieldNumber = 15; + float beta() const; + void set_beta(float value); + + // optional float k = 22 [default = 1]; + bool has_k() const; + void clear_k(); + static const int kKFieldNumber = 22; + float k() const; + void set_k(float value); + + // optional string source = 16; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 16; + const ::std::string& source() const; + void set_source(const ::std::string& value); + void set_source(const char* value); + void set_source(const char* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // optional float scale = 17 [default = 1]; + bool has_scale() const; + void clear_scale(); + static const int kScaleFieldNumber = 17; + float scale() const; + void set_scale(float value); + + // optional string meanfile = 18; + bool has_meanfile() const; + void clear_meanfile(); + static const int kMeanfileFieldNumber = 18; + const ::std::string& meanfile() const; + void set_meanfile(const ::std::string& value); + void set_meanfile(const char* value); + void set_meanfile(const char* value, size_t size); + ::std::string* mutable_meanfile(); + ::std::string* release_meanfile(); + void set_allocated_meanfile(::std::string* meanfile); + + // optional uint32 batchsize = 19; + bool has_batchsize() const; + void clear_batchsize(); + static const int kBatchsizeFieldNumber = 19; + ::google::protobuf::uint32 batchsize() const; + void set_batchsize(::google::protobuf::uint32 value); + + // optional uint32 cropsize = 20 [default = 0]; + bool has_cropsize() const; + void clear_cropsize(); + static const int kCropsizeFieldNumber = 20; + ::google::protobuf::uint32 cropsize() const; + void set_cropsize(::google::protobuf::uint32 value); + + // optional bool mirror = 21 [default = false]; + bool has_mirror() const; + void clear_mirror(); + static const int kMirrorFieldNumber = 21; + bool mirror() const; + void set_mirror(bool value); + + // repeated .caffe.BlobProto blobs = 50; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 50; + const ::caffe::BlobProto& blobs(int index) const; + ::caffe::BlobProto* mutable_blobs(int index); + ::caffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& + blobs() const; + + // repeated float blobs_lr = 51; + int blobs_lr_size() const; + void clear_blobs_lr(); + static const int kBlobsLrFieldNumber = 51; + float blobs_lr(int index) const; + void set_blobs_lr(int index, float value); + void add_blobs_lr(float value); + const ::google::protobuf::RepeatedField< float >& + blobs_lr() const; + ::google::protobuf::RepeatedField< float >* + mutable_blobs_lr(); + + // repeated float weight_decay = 52; + int weight_decay_size() const; + void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 52; + float weight_decay(int index) const; + void set_weight_decay(int index, float value); + void add_weight_decay(float value); + const ::google::protobuf::RepeatedField< float >& + weight_decay() const; + ::google::protobuf::RepeatedField< float >* + mutable_weight_decay(); + + // optional uint32 rand_skip = 53 [default = 0]; + bool has_rand_skip() const; + void clear_rand_skip(); + static const int kRandSkipFieldNumber = 53; + ::google::protobuf::uint32 rand_skip() const; + void set_rand_skip(::google::protobuf::uint32 value); + + // optional float det_fg_threshold = 54 [default = 0.5]; + bool has_det_fg_threshold() const; + void clear_det_fg_threshold(); + static const int kDetFgThresholdFieldNumber = 54; + float det_fg_threshold() const; + void set_det_fg_threshold(float value); + + // optional float det_bg_threshold = 55 [default = 0.5]; + bool has_det_bg_threshold() const; + void clear_det_bg_threshold(); + static const int kDetBgThresholdFieldNumber = 55; + float det_bg_threshold() const; + void set_det_bg_threshold(float value); + + // optional float det_fg_fraction = 56 [default = 0.25]; + bool has_det_fg_fraction() const; + void clear_det_fg_fraction(); + static const int kDetFgFractionFieldNumber = 56; + float det_fg_fraction() const; + void set_det_fg_fraction(float value); + + // optional uint32 det_context_pad = 58 [default = 0]; + bool has_det_context_pad() const; + void clear_det_context_pad(); + static const int kDetContextPadFieldNumber = 58; + ::google::protobuf::uint32 det_context_pad() const; + void set_det_context_pad(::google::protobuf::uint32 value); + + // optional string det_crop_mode = 59 [default = "warp"]; + bool has_det_crop_mode() const; + void clear_det_crop_mode(); + static const int kDetCropModeFieldNumber = 59; + const ::std::string& det_crop_mode() const; + void set_det_crop_mode(const ::std::string& value); + void set_det_crop_mode(const char* value); + void set_det_crop_mode(const char* value, size_t size); + ::std::string* mutable_det_crop_mode(); + ::std::string* release_det_crop_mode(); + void set_allocated_det_crop_mode(::std::string* det_crop_mode); + + // optional int32 new_num = 60 [default = 0]; + bool has_new_num() const; + void clear_new_num(); + static const int kNewNumFieldNumber = 60; + ::google::protobuf::int32 new_num() const; + void set_new_num(::google::protobuf::int32 value); + + // optional int32 new_channels = 61 [default = 0]; + bool has_new_channels() const; + void clear_new_channels(); + static const int kNewChannelsFieldNumber = 61; + ::google::protobuf::int32 new_channels() const; + void set_new_channels(::google::protobuf::int32 value); + + // optional int32 new_height = 62 [default = 0]; + bool has_new_height() const; + void clear_new_height(); + static const int kNewHeightFieldNumber = 62; + ::google::protobuf::int32 new_height() const; + void set_new_height(::google::protobuf::int32 value); + + // optional int32 new_width = 63 [default = 0]; + bool has_new_width() const; + void clear_new_width(); + static const int kNewWidthFieldNumber = 63; + ::google::protobuf::int32 new_width() const; + void set_new_width(::google::protobuf::int32 value); + + // optional bool shuffle_images = 64 [default = false]; + bool has_shuffle_images() const; + void clear_shuffle_images(); + static const int kShuffleImagesFieldNumber = 64; + bool shuffle_images() const; + void set_shuffle_images(bool value); + + // optional uint32 concat_dim = 65 [default = 1]; + bool has_concat_dim() const; + void clear_concat_dim(); + static const int kConcatDimFieldNumber = 65; + ::google::protobuf::uint32 concat_dim() const; + void set_concat_dim(::google::protobuf::uint32 value); + + // optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 1001; + const ::caffe::HDF5OutputParameter& hdf5_output_param() const; + ::caffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::caffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param); + + // @@protoc_insertion_point(class_scope:caffe.V0LayerParameter) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_num_output(); + inline void clear_has_num_output(); + inline void set_has_biasterm(); + inline void clear_has_biasterm(); + inline void set_has_weight_filler(); + inline void clear_has_weight_filler(); + inline void set_has_bias_filler(); + inline void clear_has_bias_filler(); + inline void set_has_pad(); + inline void clear_has_pad(); + inline void set_has_kernelsize(); + inline void clear_has_kernelsize(); + inline void set_has_group(); + inline void clear_has_group(); + inline void set_has_stride(); + inline void clear_has_stride(); + inline void set_has_pool(); + inline void clear_has_pool(); + inline void set_has_dropout_ratio(); + inline void clear_has_dropout_ratio(); + inline void set_has_local_size(); + inline void clear_has_local_size(); + inline void set_has_alpha(); + inline void clear_has_alpha(); + inline void set_has_beta(); + inline void clear_has_beta(); + inline void set_has_k(); + inline void clear_has_k(); + inline void set_has_source(); + inline void clear_has_source(); + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_meanfile(); + inline void clear_has_meanfile(); + inline void set_has_batchsize(); + inline void clear_has_batchsize(); + inline void set_has_cropsize(); + inline void clear_has_cropsize(); + inline void set_has_mirror(); + inline void clear_has_mirror(); + inline void set_has_rand_skip(); + inline void clear_has_rand_skip(); + inline void set_has_det_fg_threshold(); + inline void clear_has_det_fg_threshold(); + inline void set_has_det_bg_threshold(); + inline void clear_has_det_bg_threshold(); + inline void set_has_det_fg_fraction(); + inline void clear_has_det_fg_fraction(); + inline void set_has_det_context_pad(); + inline void clear_has_det_context_pad(); + inline void set_has_det_crop_mode(); + inline void clear_has_det_crop_mode(); + inline void set_has_new_num(); + inline void clear_has_new_num(); + inline void set_has_new_channels(); + inline void clear_has_new_channels(); + inline void set_has_new_height(); + inline void clear_has_new_height(); + inline void set_has_new_width(); + inline void clear_has_new_width(); + inline void set_has_shuffle_images(); + inline void clear_has_shuffle_images(); + inline void set_has_concat_dim(); + inline void clear_has_concat_dim(); + inline void set_has_hdf5_output_param(); + inline void clear_has_hdf5_output_param(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<2> _has_bits_; + ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto > blobs_; + ::google::protobuf::RepeatedField< float > blobs_lr_; + ::google::protobuf::RepeatedField< float > weight_decay_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr meanfile_; + static ::std::string* _default_det_crop_mode_; + ::google::protobuf::internal::ArenaStringPtr det_crop_mode_; + ::caffe::FillerParameter* weight_filler_; + ::caffe::FillerParameter* bias_filler_; + ::caffe::HDF5OutputParameter* hdf5_output_param_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_; + ::google::protobuf::uint32 kernelsize_; + int pool_; + ::google::protobuf::uint32 batchsize_; + ::google::protobuf::uint32 cropsize_; + ::google::protobuf::uint32 rand_skip_; + bool mirror_; + bool shuffle_images_; + ::google::protobuf::uint32 det_context_pad_; + ::google::protobuf::int32 new_num_; + ::google::protobuf::int32 new_channels_; + ::google::protobuf::int32 new_height_; + ::google::protobuf::int32 new_width_; + ::google::protobuf::uint32 concat_dim_; + bool biasterm_; + ::google::protobuf::uint32 group_; + ::google::protobuf::uint32 stride_; + float dropout_ratio_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + float k_; + float scale_; + float det_fg_threshold_; + float det_bg_threshold_; + float det_fg_fraction_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed V0LayerParameter_default_instance_; + +// ------------------------------------------------------------------- + +class PReLUParameter : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.PReLUParameter) */ { + public: + PReLUParameter(); + virtual ~PReLUParameter(); + + PReLUParameter(const PReLUParameter& from); + + inline PReLUParameter& operator=(const PReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PReLUParameter& default_instance(); + + static const PReLUParameter* internal_default_instance(); + + void Swap(PReLUParameter* other); + + // implements Message ---------------------------------------------- + + inline PReLUParameter* New() const { return New(NULL); } + + PReLUParameter* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PReLUParameter& from); + void MergeFrom(const PReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PReLUParameter* other); + void UnsafeMergeFrom(const PReLUParameter& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.FillerParameter filler = 1; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 1; + const ::caffe::FillerParameter& filler() const; + ::caffe::FillerParameter* mutable_filler(); + ::caffe::FillerParameter* release_filler(); + void set_allocated_filler(::caffe::FillerParameter* filler); + + // optional bool channel_shared = 2 [default = false]; + bool has_channel_shared() const; + void clear_channel_shared(); + static const int kChannelSharedFieldNumber = 2; + bool channel_shared() const; + void set_channel_shared(bool value); + + // @@protoc_insertion_point(class_scope:caffe.PReLUParameter) + private: + inline void set_has_filler(); + inline void clear_has_filler(); + inline void set_has_channel_shared(); + inline void clear_has_channel_shared(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::caffe::FillerParameter* filler_; + bool channel_shared_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed PReLUParameter_default_instance_; + +// ------------------------------------------------------------------- + +class NormalizedBBox : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:caffe.NormalizedBBox) */ { + public: + NormalizedBBox(); + virtual ~NormalizedBBox(); + + NormalizedBBox(const NormalizedBBox& from); + + inline NormalizedBBox& operator=(const NormalizedBBox& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NormalizedBBox& default_instance(); + + static const NormalizedBBox* internal_default_instance(); + + void Swap(NormalizedBBox* other); + + // implements Message ---------------------------------------------- + + inline NormalizedBBox* New() const { return New(NULL); } + + NormalizedBBox* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NormalizedBBox& from); + void MergeFrom(const NormalizedBBox& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NormalizedBBox* other); + void UnsafeMergeFrom(const NormalizedBBox& from); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float xmin = 1; + bool has_xmin() const; + void clear_xmin(); + static const int kXminFieldNumber = 1; + float xmin() const; + void set_xmin(float value); + + // optional float ymin = 2; + bool has_ymin() const; + void clear_ymin(); + static const int kYminFieldNumber = 2; + float ymin() const; + void set_ymin(float value); + + // optional float xmax = 3; + bool has_xmax() const; + void clear_xmax(); + static const int kXmaxFieldNumber = 3; + float xmax() const; + void set_xmax(float value); + + // optional float ymax = 4; + bool has_ymax() const; + void clear_ymax(); + static const int kYmaxFieldNumber = 4; + float ymax() const; + void set_ymax(float value); + + // optional int32 label = 5; + bool has_label() const; + void clear_label(); + static const int kLabelFieldNumber = 5; + ::google::protobuf::int32 label() const; + void set_label(::google::protobuf::int32 value); + + // optional bool difficult = 6; + bool has_difficult() const; + void clear_difficult(); + static const int kDifficultFieldNumber = 6; + bool difficult() const; + void set_difficult(bool value); + + // optional float score = 7; + bool has_score() const; + void clear_score(); + static const int kScoreFieldNumber = 7; + float score() const; + void set_score(float value); + + // optional float size = 8; + bool has_size() const; + void clear_size(); + static const int kSizeFieldNumber = 8; + float size() const; + void set_size(float value); + + // @@protoc_insertion_point(class_scope:caffe.NormalizedBBox) + private: + inline void set_has_xmin(); + inline void clear_has_xmin(); + inline void set_has_ymin(); + inline void clear_has_ymin(); + inline void set_has_xmax(); + inline void clear_has_xmax(); + inline void set_has_ymax(); + inline void clear_has_ymax(); + inline void set_has_label(); + inline void clear_has_label(); + inline void set_has_difficult(); + inline void clear_has_difficult(); + inline void set_has_score(); + inline void clear_has_score(); + inline void set_has_size(); + inline void clear_has_size(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + float xmin_; + float ymin_; + float xmax_; + float ymax_; + ::google::protobuf::int32 label_; + bool difficult_; + float score_; + float size_; + friend void protobuf_InitDefaults_caffe_2eproto_impl(); + friend void protobuf_AddDesc_caffe_2eproto_impl(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NormalizedBBox_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// BlobShape + +// repeated int64 dim = 1 [packed = true]; +inline int BlobShape::dim_size() const { + return dim_.size(); +} +inline void BlobShape::clear_dim() { + dim_.Clear(); +} +inline ::google::protobuf::int64 BlobShape::dim(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobShape.dim) + return dim_.Get(index); +} +inline void BlobShape::set_dim(int index, ::google::protobuf::int64 value) { + dim_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobShape.dim) +} +inline void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobShape.dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:caffe.BlobShape.dim) + return dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobShape.dim) + return &dim_; +} + +inline const BlobShape* BlobShape::internal_default_instance() { + return &BlobShape_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// BlobProto + +// optional .caffe.BlobShape shape = 7; +inline bool BlobProto::has_shape() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void BlobProto::set_has_shape() { + _has_bits_[0] |= 0x00000001u; +} +inline void BlobProto::clear_has_shape() { + _has_bits_[0] &= ~0x00000001u; +} +inline void BlobProto::clear_shape() { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::caffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.shape) + return shape_ != NULL ? *shape_ + : *::caffe::BlobShape::internal_default_instance(); +} +inline ::caffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::caffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:caffe.BlobProto.shape) + return shape_; +} +inline ::caffe::BlobShape* BlobProto::release_shape() { + // @@protoc_insertion_point(field_release:caffe.BlobProto.shape) + clear_has_shape(); + ::caffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void BlobProto::set_allocated_shape(::caffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.BlobProto.shape) +} + +// repeated float data = 5 [packed = true]; +inline int BlobProto::data_size() const { + return data_.size(); +} +inline void BlobProto::clear_data() { + data_.Clear(); +} +inline float BlobProto::data(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.data) + return data_.Get(index); +} +inline void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.data) +} +inline void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.data) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.data) + return data_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.data) + return &data_; +} + +// repeated float diff = 6 [packed = true]; +inline int BlobProto::diff_size() const { + return diff_.size(); +} +inline void BlobProto::clear_diff() { + diff_.Clear(); +} +inline float BlobProto::diff(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.diff) + return diff_.Get(index); +} +inline void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.diff) +} +inline void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.diff) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.diff) + return diff_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.diff) + return &diff_; +} + +// repeated double double_data = 8 [packed = true]; +inline int BlobProto::double_data_size() const { + return double_data_.size(); +} +inline void BlobProto::clear_double_data() { + double_data_.Clear(); +} +inline double BlobProto::double_data(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.double_data) + return double_data_.Get(index); +} +inline void BlobProto::set_double_data(int index, double value) { + double_data_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.double_data) +} +inline void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.double_data) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.double_data) + return double_data_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.double_data) + return &double_data_; +} + +// repeated double double_diff = 9 [packed = true]; +inline int BlobProto::double_diff_size() const { + return double_diff_.size(); +} +inline void BlobProto::clear_double_diff() { + double_diff_.Clear(); +} +inline double BlobProto::double_diff(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.double_diff) + return double_diff_.Get(index); +} +inline void BlobProto::set_double_diff(int index, double value) { + double_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.BlobProto.double_diff) +} +inline void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:caffe.BlobProto.double_diff) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:caffe.BlobProto.double_diff) + return double_diff_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProto.double_diff) + return &double_diff_; +} + +// optional int32 num = 1 [default = 0]; +inline bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000020u; +} +inline void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000020u; +} +inline void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} +inline ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.num) + return num_; +} +inline void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +inline bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000040u; +} +inline void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000040u; +} +inline void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +inline ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.channels) + return channels_; +} +inline void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +inline bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000080u; +} +inline void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000080u; +} +inline void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} +inline ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.height) + return height_; +} +inline void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +inline bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000100u; +} +inline void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000100u; +} +inline void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} +inline ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:caffe.BlobProto.width) + return width_; +} +inline void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:caffe.BlobProto.width) +} + +inline const BlobProto* BlobProto::internal_default_instance() { + return &BlobProto_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// BlobProtoVector + +// repeated .caffe.BlobProto blobs = 1; +inline int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +inline void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +inline const ::caffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +inline ::caffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +inline ::caffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.BlobProtoVector.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:caffe.BlobProtoVector.blobs) + return blobs_; +} + +inline const BlobProtoVector* BlobProtoVector::internal_default_instance() { + return &BlobProtoVector_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// PermuteParameter + +// repeated uint32 order = 1; +inline int PermuteParameter::order_size() const { + return order_.size(); +} +inline void PermuteParameter::clear_order() { + order_.Clear(); +} +inline ::google::protobuf::uint32 PermuteParameter::order(int index) const { + // @@protoc_insertion_point(field_get:caffe.PermuteParameter.order) + return order_.Get(index); +} +inline void PermuteParameter::set_order(int index, ::google::protobuf::uint32 value) { + order_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.PermuteParameter.order) +} +inline void PermuteParameter::add_order(::google::protobuf::uint32 value) { + order_.Add(value); + // @@protoc_insertion_point(field_add:caffe.PermuteParameter.order) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +PermuteParameter::order() const { + // @@protoc_insertion_point(field_list:caffe.PermuteParameter.order) + return order_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +PermuteParameter::mutable_order() { + // @@protoc_insertion_point(field_mutable_list:caffe.PermuteParameter.order) + return &order_; +} + +inline const PermuteParameter* PermuteParameter::internal_default_instance() { + return &PermuteParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NormalizeBBoxParameter + +// optional bool across_spatial = 1 [default = true]; +inline bool NormalizeBBoxParameter::has_across_spatial() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NormalizeBBoxParameter::set_has_across_spatial() { + _has_bits_[0] |= 0x00000001u; +} +inline void NormalizeBBoxParameter::clear_has_across_spatial() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NormalizeBBoxParameter::clear_across_spatial() { + across_spatial_ = true; + clear_has_across_spatial(); +} +inline bool NormalizeBBoxParameter::across_spatial() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.across_spatial) + return across_spatial_; +} +inline void NormalizeBBoxParameter::set_across_spatial(bool value) { + set_has_across_spatial(); + across_spatial_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizeBBoxParameter.across_spatial) +} + +// optional .caffe.FillerParameter scale_filler = 2; +inline bool NormalizeBBoxParameter::has_scale_filler() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NormalizeBBoxParameter::set_has_scale_filler() { + _has_bits_[0] |= 0x00000002u; +} +inline void NormalizeBBoxParameter::clear_has_scale_filler() { + _has_bits_[0] &= ~0x00000002u; +} +inline void NormalizeBBoxParameter::clear_scale_filler() { + if (scale_filler_ != NULL) scale_filler_->::caffe::FillerParameter::Clear(); + clear_has_scale_filler(); +} +inline const ::caffe::FillerParameter& NormalizeBBoxParameter::scale_filler() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.scale_filler) + return scale_filler_ != NULL ? *scale_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* NormalizeBBoxParameter::mutable_scale_filler() { + set_has_scale_filler(); + if (scale_filler_ == NULL) { + scale_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.NormalizeBBoxParameter.scale_filler) + return scale_filler_; +} +inline ::caffe::FillerParameter* NormalizeBBoxParameter::release_scale_filler() { + // @@protoc_insertion_point(field_release:caffe.NormalizeBBoxParameter.scale_filler) + clear_has_scale_filler(); + ::caffe::FillerParameter* temp = scale_filler_; + scale_filler_ = NULL; + return temp; +} +inline void NormalizeBBoxParameter::set_allocated_scale_filler(::caffe::FillerParameter* scale_filler) { + delete scale_filler_; + scale_filler_ = scale_filler; + if (scale_filler) { + set_has_scale_filler(); + } else { + clear_has_scale_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.NormalizeBBoxParameter.scale_filler) +} + +// optional bool channel_shared = 3 [default = true]; +inline bool NormalizeBBoxParameter::has_channel_shared() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void NormalizeBBoxParameter::set_has_channel_shared() { + _has_bits_[0] |= 0x00000004u; +} +inline void NormalizeBBoxParameter::clear_has_channel_shared() { + _has_bits_[0] &= ~0x00000004u; +} +inline void NormalizeBBoxParameter::clear_channel_shared() { + channel_shared_ = true; + clear_has_channel_shared(); +} +inline bool NormalizeBBoxParameter::channel_shared() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.channel_shared) + return channel_shared_; +} +inline void NormalizeBBoxParameter::set_channel_shared(bool value) { + set_has_channel_shared(); + channel_shared_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizeBBoxParameter.channel_shared) +} + +// optional float eps = 4 [default = 1e-10]; +inline bool NormalizeBBoxParameter::has_eps() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void NormalizeBBoxParameter::set_has_eps() { + _has_bits_[0] |= 0x00000008u; +} +inline void NormalizeBBoxParameter::clear_has_eps() { + _has_bits_[0] &= ~0x00000008u; +} +inline void NormalizeBBoxParameter::clear_eps() { + eps_ = 1e-10f; + clear_has_eps(); +} +inline float NormalizeBBoxParameter::eps() const { + // @@protoc_insertion_point(field_get:caffe.NormalizeBBoxParameter.eps) + return eps_; +} +inline void NormalizeBBoxParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizeBBoxParameter.eps) +} + +inline const NormalizeBBoxParameter* NormalizeBBoxParameter::internal_default_instance() { + return &NormalizeBBoxParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// PriorBoxParameter + +// optional float min_size = 1; +inline bool PriorBoxParameter::has_min_size() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PriorBoxParameter::set_has_min_size() { + _has_bits_[0] |= 0x00000001u; +} +inline void PriorBoxParameter::clear_has_min_size() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PriorBoxParameter::clear_min_size() { + min_size_ = 0; + clear_has_min_size(); +} +inline float PriorBoxParameter::min_size() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.min_size) + return min_size_; +} +inline void PriorBoxParameter::set_min_size(float value) { + set_has_min_size(); + min_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.min_size) +} + +// optional float max_size = 2; +inline bool PriorBoxParameter::has_max_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PriorBoxParameter::set_has_max_size() { + _has_bits_[0] |= 0x00000002u; +} +inline void PriorBoxParameter::clear_has_max_size() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PriorBoxParameter::clear_max_size() { + max_size_ = 0; + clear_has_max_size(); +} +inline float PriorBoxParameter::max_size() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.max_size) + return max_size_; +} +inline void PriorBoxParameter::set_max_size(float value) { + set_has_max_size(); + max_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.max_size) +} + +// repeated float aspect_ratio = 3; +inline int PriorBoxParameter::aspect_ratio_size() const { + return aspect_ratio_.size(); +} +inline void PriorBoxParameter::clear_aspect_ratio() { + aspect_ratio_.Clear(); +} +inline float PriorBoxParameter::aspect_ratio(int index) const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.aspect_ratio) + return aspect_ratio_.Get(index); +} +inline void PriorBoxParameter::set_aspect_ratio(int index, float value) { + aspect_ratio_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.aspect_ratio) +} +inline void PriorBoxParameter::add_aspect_ratio(float value) { + aspect_ratio_.Add(value); + // @@protoc_insertion_point(field_add:caffe.PriorBoxParameter.aspect_ratio) +} +inline const ::google::protobuf::RepeatedField< float >& +PriorBoxParameter::aspect_ratio() const { + // @@protoc_insertion_point(field_list:caffe.PriorBoxParameter.aspect_ratio) + return aspect_ratio_; +} +inline ::google::protobuf::RepeatedField< float >* +PriorBoxParameter::mutable_aspect_ratio() { + // @@protoc_insertion_point(field_mutable_list:caffe.PriorBoxParameter.aspect_ratio) + return &aspect_ratio_; +} + +// optional bool flip = 4 [default = true]; +inline bool PriorBoxParameter::has_flip() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void PriorBoxParameter::set_has_flip() { + _has_bits_[0] |= 0x00000008u; +} +inline void PriorBoxParameter::clear_has_flip() { + _has_bits_[0] &= ~0x00000008u; +} +inline void PriorBoxParameter::clear_flip() { + flip_ = true; + clear_has_flip(); +} +inline bool PriorBoxParameter::flip() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.flip) + return flip_; +} +inline void PriorBoxParameter::set_flip(bool value) { + set_has_flip(); + flip_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.flip) +} + +// optional bool clip = 5 [default = true]; +inline bool PriorBoxParameter::has_clip() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void PriorBoxParameter::set_has_clip() { + _has_bits_[0] |= 0x00000010u; +} +inline void PriorBoxParameter::clear_has_clip() { + _has_bits_[0] &= ~0x00000010u; +} +inline void PriorBoxParameter::clear_clip() { + clip_ = true; + clear_has_clip(); +} +inline bool PriorBoxParameter::clip() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.clip) + return clip_; +} +inline void PriorBoxParameter::set_clip(bool value) { + set_has_clip(); + clip_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.clip) +} + +// repeated float variance = 6; +inline int PriorBoxParameter::variance_size() const { + return variance_.size(); +} +inline void PriorBoxParameter::clear_variance() { + variance_.Clear(); +} +inline float PriorBoxParameter::variance(int index) const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.variance) + return variance_.Get(index); +} +inline void PriorBoxParameter::set_variance(int index, float value) { + variance_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.variance) +} +inline void PriorBoxParameter::add_variance(float value) { + variance_.Add(value); + // @@protoc_insertion_point(field_add:caffe.PriorBoxParameter.variance) +} +inline const ::google::protobuf::RepeatedField< float >& +PriorBoxParameter::variance() const { + // @@protoc_insertion_point(field_list:caffe.PriorBoxParameter.variance) + return variance_; +} +inline ::google::protobuf::RepeatedField< float >* +PriorBoxParameter::mutable_variance() { + // @@protoc_insertion_point(field_mutable_list:caffe.PriorBoxParameter.variance) + return &variance_; +} + +// optional uint32 img_size = 7; +inline bool PriorBoxParameter::has_img_size() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void PriorBoxParameter::set_has_img_size() { + _has_bits_[0] |= 0x00000040u; +} +inline void PriorBoxParameter::clear_has_img_size() { + _has_bits_[0] &= ~0x00000040u; +} +inline void PriorBoxParameter::clear_img_size() { + img_size_ = 0u; + clear_has_img_size(); +} +inline ::google::protobuf::uint32 PriorBoxParameter::img_size() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.img_size) + return img_size_; +} +inline void PriorBoxParameter::set_img_size(::google::protobuf::uint32 value) { + set_has_img_size(); + img_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.img_size) +} + +// optional uint32 img_h = 8; +inline bool PriorBoxParameter::has_img_h() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void PriorBoxParameter::set_has_img_h() { + _has_bits_[0] |= 0x00000080u; +} +inline void PriorBoxParameter::clear_has_img_h() { + _has_bits_[0] &= ~0x00000080u; +} +inline void PriorBoxParameter::clear_img_h() { + img_h_ = 0u; + clear_has_img_h(); +} +inline ::google::protobuf::uint32 PriorBoxParameter::img_h() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.img_h) + return img_h_; +} +inline void PriorBoxParameter::set_img_h(::google::protobuf::uint32 value) { + set_has_img_h(); + img_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.img_h) +} + +// optional uint32 img_w = 9; +inline bool PriorBoxParameter::has_img_w() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void PriorBoxParameter::set_has_img_w() { + _has_bits_[0] |= 0x00000100u; +} +inline void PriorBoxParameter::clear_has_img_w() { + _has_bits_[0] &= ~0x00000100u; +} +inline void PriorBoxParameter::clear_img_w() { + img_w_ = 0u; + clear_has_img_w(); +} +inline ::google::protobuf::uint32 PriorBoxParameter::img_w() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.img_w) + return img_w_; +} +inline void PriorBoxParameter::set_img_w(::google::protobuf::uint32 value) { + set_has_img_w(); + img_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.img_w) +} + +// optional float step = 10; +inline bool PriorBoxParameter::has_step() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void PriorBoxParameter::set_has_step() { + _has_bits_[0] |= 0x00000200u; +} +inline void PriorBoxParameter::clear_has_step() { + _has_bits_[0] &= ~0x00000200u; +} +inline void PriorBoxParameter::clear_step() { + step_ = 0; + clear_has_step(); +} +inline float PriorBoxParameter::step() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.step) + return step_; +} +inline void PriorBoxParameter::set_step(float value) { + set_has_step(); + step_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.step) +} + +// optional float step_h = 11; +inline bool PriorBoxParameter::has_step_h() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void PriorBoxParameter::set_has_step_h() { + _has_bits_[0] |= 0x00000400u; +} +inline void PriorBoxParameter::clear_has_step_h() { + _has_bits_[0] &= ~0x00000400u; +} +inline void PriorBoxParameter::clear_step_h() { + step_h_ = 0; + clear_has_step_h(); +} +inline float PriorBoxParameter::step_h() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.step_h) + return step_h_; +} +inline void PriorBoxParameter::set_step_h(float value) { + set_has_step_h(); + step_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.step_h) +} + +// optional float step_w = 12; +inline bool PriorBoxParameter::has_step_w() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void PriorBoxParameter::set_has_step_w() { + _has_bits_[0] |= 0x00000800u; +} +inline void PriorBoxParameter::clear_has_step_w() { + _has_bits_[0] &= ~0x00000800u; +} +inline void PriorBoxParameter::clear_step_w() { + step_w_ = 0; + clear_has_step_w(); +} +inline float PriorBoxParameter::step_w() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.step_w) + return step_w_; +} +inline void PriorBoxParameter::set_step_w(float value) { + set_has_step_w(); + step_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.step_w) +} + +// optional float offset = 13 [default = 0.5]; +inline bool PriorBoxParameter::has_offset() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void PriorBoxParameter::set_has_offset() { + _has_bits_[0] |= 0x00001000u; +} +inline void PriorBoxParameter::clear_has_offset() { + _has_bits_[0] &= ~0x00001000u; +} +inline void PriorBoxParameter::clear_offset() { + offset_ = 0.5f; + clear_has_offset(); +} +inline float PriorBoxParameter::offset() const { + // @@protoc_insertion_point(field_get:caffe.PriorBoxParameter.offset) + return offset_; +} +inline void PriorBoxParameter::set_offset(float value) { + set_has_offset(); + offset_ = value; + // @@protoc_insertion_point(field_set:caffe.PriorBoxParameter.offset) +} + +inline const PriorBoxParameter* PriorBoxParameter::internal_default_instance() { + return &PriorBoxParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// DetectionOutputParameter + +// optional uint32 num_classes = 1; +inline bool DetectionOutputParameter::has_num_classes() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DetectionOutputParameter::set_has_num_classes() { + _has_bits_[0] |= 0x00000001u; +} +inline void DetectionOutputParameter::clear_has_num_classes() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DetectionOutputParameter::clear_num_classes() { + num_classes_ = 0u; + clear_has_num_classes(); +} +inline ::google::protobuf::uint32 DetectionOutputParameter::num_classes() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.num_classes) + return num_classes_; +} +inline void DetectionOutputParameter::set_num_classes(::google::protobuf::uint32 value) { + set_has_num_classes(); + num_classes_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.num_classes) +} + +// optional bool share_location = 2 [default = true]; +inline bool DetectionOutputParameter::has_share_location() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DetectionOutputParameter::set_has_share_location() { + _has_bits_[0] |= 0x00000002u; +} +inline void DetectionOutputParameter::clear_has_share_location() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DetectionOutputParameter::clear_share_location() { + share_location_ = true; + clear_has_share_location(); +} +inline bool DetectionOutputParameter::share_location() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.share_location) + return share_location_; +} +inline void DetectionOutputParameter::set_share_location(bool value) { + set_has_share_location(); + share_location_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.share_location) +} + +// optional int32 background_label_id = 3 [default = 0]; +inline bool DetectionOutputParameter::has_background_label_id() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void DetectionOutputParameter::set_has_background_label_id() { + _has_bits_[0] |= 0x00000004u; +} +inline void DetectionOutputParameter::clear_has_background_label_id() { + _has_bits_[0] &= ~0x00000004u; +} +inline void DetectionOutputParameter::clear_background_label_id() { + background_label_id_ = 0; + clear_has_background_label_id(); +} +inline ::google::protobuf::int32 DetectionOutputParameter::background_label_id() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.background_label_id) + return background_label_id_; +} +inline void DetectionOutputParameter::set_background_label_id(::google::protobuf::int32 value) { + set_has_background_label_id(); + background_label_id_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.background_label_id) +} + +// optional .caffe.NonMaximumSuppressionParameter nms_param = 4; +inline bool DetectionOutputParameter::has_nms_param() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void DetectionOutputParameter::set_has_nms_param() { + _has_bits_[0] |= 0x00000008u; +} +inline void DetectionOutputParameter::clear_has_nms_param() { + _has_bits_[0] &= ~0x00000008u; +} +inline void DetectionOutputParameter::clear_nms_param() { + if (nms_param_ != NULL) nms_param_->::caffe::NonMaximumSuppressionParameter::Clear(); + clear_has_nms_param(); +} +inline const ::caffe::NonMaximumSuppressionParameter& DetectionOutputParameter::nms_param() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.nms_param) + return nms_param_ != NULL ? *nms_param_ + : *::caffe::NonMaximumSuppressionParameter::internal_default_instance(); +} +inline ::caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::mutable_nms_param() { + set_has_nms_param(); + if (nms_param_ == NULL) { + nms_param_ = new ::caffe::NonMaximumSuppressionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.DetectionOutputParameter.nms_param) + return nms_param_; +} +inline ::caffe::NonMaximumSuppressionParameter* DetectionOutputParameter::release_nms_param() { + // @@protoc_insertion_point(field_release:caffe.DetectionOutputParameter.nms_param) + clear_has_nms_param(); + ::caffe::NonMaximumSuppressionParameter* temp = nms_param_; + nms_param_ = NULL; + return temp; +} +inline void DetectionOutputParameter::set_allocated_nms_param(::caffe::NonMaximumSuppressionParameter* nms_param) { + delete nms_param_; + nms_param_ = nms_param; + if (nms_param) { + set_has_nms_param(); + } else { + clear_has_nms_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.DetectionOutputParameter.nms_param) +} + +// optional .caffe.SaveOutputParameter save_output_param = 5; +inline bool DetectionOutputParameter::has_save_output_param() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void DetectionOutputParameter::set_has_save_output_param() { + _has_bits_[0] |= 0x00000010u; +} +inline void DetectionOutputParameter::clear_has_save_output_param() { + _has_bits_[0] &= ~0x00000010u; +} +inline void DetectionOutputParameter::clear_save_output_param() { + if (save_output_param_ != NULL) save_output_param_->::caffe::SaveOutputParameter::Clear(); + clear_has_save_output_param(); +} +inline const ::caffe::SaveOutputParameter& DetectionOutputParameter::save_output_param() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.save_output_param) + return save_output_param_ != NULL ? *save_output_param_ + : *::caffe::SaveOutputParameter::internal_default_instance(); +} +inline ::caffe::SaveOutputParameter* DetectionOutputParameter::mutable_save_output_param() { + set_has_save_output_param(); + if (save_output_param_ == NULL) { + save_output_param_ = new ::caffe::SaveOutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.DetectionOutputParameter.save_output_param) + return save_output_param_; +} +inline ::caffe::SaveOutputParameter* DetectionOutputParameter::release_save_output_param() { + // @@protoc_insertion_point(field_release:caffe.DetectionOutputParameter.save_output_param) + clear_has_save_output_param(); + ::caffe::SaveOutputParameter* temp = save_output_param_; + save_output_param_ = NULL; + return temp; +} +inline void DetectionOutputParameter::set_allocated_save_output_param(::caffe::SaveOutputParameter* save_output_param) { + delete save_output_param_; + save_output_param_ = save_output_param; + if (save_output_param) { + set_has_save_output_param(); + } else { + clear_has_save_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.DetectionOutputParameter.save_output_param) +} + +// optional .caffe.PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; +inline bool DetectionOutputParameter::has_code_type() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void DetectionOutputParameter::set_has_code_type() { + _has_bits_[0] |= 0x00000020u; +} +inline void DetectionOutputParameter::clear_has_code_type() { + _has_bits_[0] &= ~0x00000020u; +} +inline void DetectionOutputParameter::clear_code_type() { + code_type_ = 1; + clear_has_code_type(); +} +inline ::caffe::PriorBoxParameter_CodeType DetectionOutputParameter::code_type() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.code_type) + return static_cast< ::caffe::PriorBoxParameter_CodeType >(code_type_); +} +inline void DetectionOutputParameter::set_code_type(::caffe::PriorBoxParameter_CodeType value) { + assert(::caffe::PriorBoxParameter_CodeType_IsValid(value)); + set_has_code_type(); + code_type_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.code_type) +} + +// optional bool variance_encoded_in_target = 8 [default = false]; +inline bool DetectionOutputParameter::has_variance_encoded_in_target() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void DetectionOutputParameter::set_has_variance_encoded_in_target() { + _has_bits_[0] |= 0x00000040u; +} +inline void DetectionOutputParameter::clear_has_variance_encoded_in_target() { + _has_bits_[0] &= ~0x00000040u; +} +inline void DetectionOutputParameter::clear_variance_encoded_in_target() { + variance_encoded_in_target_ = false; + clear_has_variance_encoded_in_target(); +} +inline bool DetectionOutputParameter::variance_encoded_in_target() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.variance_encoded_in_target) + return variance_encoded_in_target_; +} +inline void DetectionOutputParameter::set_variance_encoded_in_target(bool value) { + set_has_variance_encoded_in_target(); + variance_encoded_in_target_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.variance_encoded_in_target) +} + +// optional int32 keep_top_k = 7 [default = -1]; +inline bool DetectionOutputParameter::has_keep_top_k() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void DetectionOutputParameter::set_has_keep_top_k() { + _has_bits_[0] |= 0x00000080u; +} +inline void DetectionOutputParameter::clear_has_keep_top_k() { + _has_bits_[0] &= ~0x00000080u; +} +inline void DetectionOutputParameter::clear_keep_top_k() { + keep_top_k_ = -1; + clear_has_keep_top_k(); +} +inline ::google::protobuf::int32 DetectionOutputParameter::keep_top_k() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.keep_top_k) + return keep_top_k_; +} +inline void DetectionOutputParameter::set_keep_top_k(::google::protobuf::int32 value) { + set_has_keep_top_k(); + keep_top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.keep_top_k) +} + +// optional float confidence_threshold = 9; +inline bool DetectionOutputParameter::has_confidence_threshold() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void DetectionOutputParameter::set_has_confidence_threshold() { + _has_bits_[0] |= 0x00000100u; +} +inline void DetectionOutputParameter::clear_has_confidence_threshold() { + _has_bits_[0] &= ~0x00000100u; +} +inline void DetectionOutputParameter::clear_confidence_threshold() { + confidence_threshold_ = 0; + clear_has_confidence_threshold(); +} +inline float DetectionOutputParameter::confidence_threshold() const { + // @@protoc_insertion_point(field_get:caffe.DetectionOutputParameter.confidence_threshold) + return confidence_threshold_; +} +inline void DetectionOutputParameter::set_confidence_threshold(float value) { + set_has_confidence_threshold(); + confidence_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.DetectionOutputParameter.confidence_threshold) +} + +inline const DetectionOutputParameter* DetectionOutputParameter::internal_default_instance() { + return &DetectionOutputParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// Datum + +// optional int32 channels = 1; +inline bool Datum::has_channels() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Datum::set_has_channels() { + _has_bits_[0] |= 0x00000001u; +} +inline void Datum::clear_has_channels() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Datum::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +inline ::google::protobuf::int32 Datum::channels() const { + // @@protoc_insertion_point(field_get:caffe.Datum.channels) + return channels_; +} +inline void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.channels) +} + +// optional int32 height = 2; +inline bool Datum::has_height() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Datum::set_has_height() { + _has_bits_[0] |= 0x00000002u; +} +inline void Datum::clear_has_height() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Datum::clear_height() { + height_ = 0; + clear_has_height(); +} +inline ::google::protobuf::int32 Datum::height() const { + // @@protoc_insertion_point(field_get:caffe.Datum.height) + return height_; +} +inline void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.height) +} + +// optional int32 width = 3; +inline bool Datum::has_width() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Datum::set_has_width() { + _has_bits_[0] |= 0x00000004u; +} +inline void Datum::clear_has_width() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Datum::clear_width() { + width_ = 0; + clear_has_width(); +} +inline ::google::protobuf::int32 Datum::width() const { + // @@protoc_insertion_point(field_get:caffe.Datum.width) + return width_; +} +inline void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.width) +} + +// optional bytes data = 4; +inline bool Datum::has_data() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Datum::set_has_data() { + _has_bits_[0] |= 0x00000008u; +} +inline void Datum::clear_has_data() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Datum::clear_data() { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_data(); +} +inline const ::std::string& Datum::data() const { + // @@protoc_insertion_point(field_get:caffe.Datum.data) + return data_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Datum::set_data(const ::std::string& value) { + set_has_data(); + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.Datum.data) +} +inline void Datum::set_data(const char* value) { + set_has_data(); + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.Datum.data) +} +inline void Datum::set_data(const void* value, size_t size) { + set_has_data(); + data_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.Datum.data) +} +inline ::std::string* Datum::mutable_data() { + set_has_data(); + // @@protoc_insertion_point(field_mutable:caffe.Datum.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Datum::release_data() { + // @@protoc_insertion_point(field_release:caffe.Datum.data) + clear_has_data(); + return data_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Datum::set_allocated_data(::std::string* data) { + if (data != NULL) { + set_has_data(); + } else { + clear_has_data(); + } + data_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), data); + // @@protoc_insertion_point(field_set_allocated:caffe.Datum.data) +} + +// optional int32 label = 5; +inline bool Datum::has_label() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void Datum::set_has_label() { + _has_bits_[0] |= 0x00000010u; +} +inline void Datum::clear_has_label() { + _has_bits_[0] &= ~0x00000010u; +} +inline void Datum::clear_label() { + label_ = 0; + clear_has_label(); +} +inline ::google::protobuf::int32 Datum::label() const { + // @@protoc_insertion_point(field_get:caffe.Datum.label) + return label_; +} +inline void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.label) +} + +// repeated float float_data = 6; +inline int Datum::float_data_size() const { + return float_data_.size(); +} +inline void Datum::clear_float_data() { + float_data_.Clear(); +} +inline float Datum::float_data(int index) const { + // @@protoc_insertion_point(field_get:caffe.Datum.float_data) + return float_data_.Get(index); +} +inline void Datum::set_float_data(int index, float value) { + float_data_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.Datum.float_data) +} +inline void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:caffe.Datum.float_data) +} +inline const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:caffe.Datum.float_data) + return float_data_; +} +inline ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:caffe.Datum.float_data) + return &float_data_; +} + +// optional bool encoded = 7 [default = false]; +inline bool Datum::has_encoded() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void Datum::set_has_encoded() { + _has_bits_[0] |= 0x00000040u; +} +inline void Datum::clear_has_encoded() { + _has_bits_[0] &= ~0x00000040u; +} +inline void Datum::clear_encoded() { + encoded_ = false; + clear_has_encoded(); +} +inline bool Datum::encoded() const { + // @@protoc_insertion_point(field_get:caffe.Datum.encoded) + return encoded_; +} +inline void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:caffe.Datum.encoded) +} + +inline const Datum* Datum::internal_default_instance() { + return &Datum_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// FillerParameter + +// optional string type = 1 [default = "constant"]; +inline bool FillerParameter::has_type() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FillerParameter::set_has_type() { + _has_bits_[0] |= 0x00000001u; +} +inline void FillerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FillerParameter::clear_type() { + type_.ClearToDefaultNoArena(_default_type_); + clear_has_type(); +} +inline const ::std::string& FillerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.type) + return type_.GetNoArena(_default_type_); +} +inline void FillerParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(_default_type_, value); + // @@protoc_insertion_point(field_set:caffe.FillerParameter.type) +} +inline void FillerParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(_default_type_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.FillerParameter.type) +} +inline void FillerParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(_default_type_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.FillerParameter.type) +} +inline ::std::string* FillerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.FillerParameter.type) + return type_.MutableNoArena(_default_type_); +} +inline ::std::string* FillerParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.FillerParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(_default_type_); +} +inline void FillerParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(_default_type_, type); + // @@protoc_insertion_point(field_set_allocated:caffe.FillerParameter.type) +} + +// optional float value = 2 [default = 0]; +inline bool FillerParameter::has_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FillerParameter::set_has_value() { + _has_bits_[0] |= 0x00000002u; +} +inline void FillerParameter::clear_has_value() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FillerParameter::clear_value() { + value_ = 0; + clear_has_value(); +} +inline float FillerParameter::value() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.value) + return value_; +} +inline void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.value) +} + +// optional float min = 3 [default = 0]; +inline bool FillerParameter::has_min() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void FillerParameter::set_has_min() { + _has_bits_[0] |= 0x00000004u; +} +inline void FillerParameter::clear_has_min() { + _has_bits_[0] &= ~0x00000004u; +} +inline void FillerParameter::clear_min() { + min_ = 0; + clear_has_min(); +} +inline float FillerParameter::min() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.min) + return min_; +} +inline void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.min) +} + +// optional float max = 4 [default = 1]; +inline bool FillerParameter::has_max() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void FillerParameter::set_has_max() { + _has_bits_[0] |= 0x00000008u; +} +inline void FillerParameter::clear_has_max() { + _has_bits_[0] &= ~0x00000008u; +} +inline void FillerParameter::clear_max() { + max_ = 1; + clear_has_max(); +} +inline float FillerParameter::max() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.max) + return max_; +} +inline void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.max) +} + +// optional float mean = 5 [default = 0]; +inline bool FillerParameter::has_mean() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void FillerParameter::set_has_mean() { + _has_bits_[0] |= 0x00000010u; +} +inline void FillerParameter::clear_has_mean() { + _has_bits_[0] &= ~0x00000010u; +} +inline void FillerParameter::clear_mean() { + mean_ = 0; + clear_has_mean(); +} +inline float FillerParameter::mean() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.mean) + return mean_; +} +inline void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.mean) +} + +// optional float std = 6 [default = 1]; +inline bool FillerParameter::has_std() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void FillerParameter::set_has_std() { + _has_bits_[0] |= 0x00000020u; +} +inline void FillerParameter::clear_has_std() { + _has_bits_[0] &= ~0x00000020u; +} +inline void FillerParameter::clear_std() { + std_ = 1; + clear_has_std(); +} +inline float FillerParameter::std() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.std) + return std_; +} +inline void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.std) +} + +// optional int32 sparse = 7 [default = -1]; +inline bool FillerParameter::has_sparse() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void FillerParameter::set_has_sparse() { + _has_bits_[0] |= 0x00000040u; +} +inline void FillerParameter::clear_has_sparse() { + _has_bits_[0] &= ~0x00000040u; +} +inline void FillerParameter::clear_sparse() { + sparse_ = -1; + clear_has_sparse(); +} +inline ::google::protobuf::int32 FillerParameter::sparse() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.sparse) + return sparse_; +} +inline void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.sparse) +} + +// optional .caffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; +inline bool FillerParameter::has_variance_norm() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void FillerParameter::set_has_variance_norm() { + _has_bits_[0] |= 0x00000080u; +} +inline void FillerParameter::clear_has_variance_norm() { + _has_bits_[0] &= ~0x00000080u; +} +inline void FillerParameter::clear_variance_norm() { + variance_norm_ = 0; + clear_has_variance_norm(); +} +inline ::caffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:caffe.FillerParameter.variance_norm) + return static_cast< ::caffe::FillerParameter_VarianceNorm >(variance_norm_); +} +inline void FillerParameter::set_variance_norm(::caffe::FillerParameter_VarianceNorm value) { + assert(::caffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:caffe.FillerParameter.variance_norm) +} + +inline const FillerParameter* FillerParameter::internal_default_instance() { + return &FillerParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NetParameter + +// optional string name = 1; +inline bool NetParameter::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NetParameter::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void NetParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NetParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& NetParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NetParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.NetParameter.name) +} +inline void NetParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.NetParameter.name) +} +inline void NetParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.NetParameter.name) +} +inline ::std::string* NetParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* NetParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.NetParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NetParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.NetParameter.name) +} + +// repeated string input = 3; +inline int NetParameter::input_size() const { + return input_.size(); +} +inline void NetParameter::clear_input() { + input_.Clear(); +} +inline const ::std::string& NetParameter::input(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.input) + return input_.Get(index); +} +inline ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.input) + return input_.Mutable(index); +} +inline void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetParameter.input) + input_.Mutable(index)->assign(value); +} +inline void NetParameter::set_input(int index, const char* value) { + input_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetParameter.input) +} +inline void NetParameter::set_input(int index, const char* value, size_t size) { + input_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetParameter.input) +} +inline ::std::string* NetParameter::add_input() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetParameter.input) + return input_.Add(); +} +inline void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetParameter.input) +} +inline void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetParameter.input) +} +inline void NetParameter::add_input(const char* value, size_t size) { + input_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetParameter.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.input) + return &input_; +} + +// repeated .caffe.BlobShape input_shape = 8; +inline int NetParameter::input_shape_size() const { + return input_shape_.size(); +} +inline void NetParameter::clear_input_shape() { + input_shape_.Clear(); +} +inline const ::caffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +inline ::caffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +inline ::caffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:caffe.NetParameter.input_shape) + return input_shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.input_shape) + return &input_shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.input_shape) + return input_shape_; +} + +// repeated int32 input_dim = 4; +inline int NetParameter::input_dim_size() const { + return input_dim_.size(); +} +inline void NetParameter::clear_input_dim() { + input_dim_.Clear(); +} +inline ::google::protobuf::int32 NetParameter::input_dim(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.input_dim) + return input_dim_.Get(index); +} +inline void NetParameter::set_input_dim(int index, ::google::protobuf::int32 value) { + input_dim_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.NetParameter.input_dim) +} +inline void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:caffe.NetParameter.input_dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.input_dim) + return input_dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.input_dim) + return &input_dim_; +} + +// optional bool force_backward = 5 [default = false]; +inline bool NetParameter::has_force_backward() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void NetParameter::set_has_force_backward() { + _has_bits_[0] |= 0x00000010u; +} +inline void NetParameter::clear_has_force_backward() { + _has_bits_[0] &= ~0x00000010u; +} +inline void NetParameter::clear_force_backward() { + force_backward_ = false; + clear_has_force_backward(); +} +inline bool NetParameter::force_backward() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.force_backward) + return force_backward_; +} +inline void NetParameter::set_force_backward(bool value) { + set_has_force_backward(); + force_backward_ = value; + // @@protoc_insertion_point(field_set:caffe.NetParameter.force_backward) +} + +// optional .caffe.NetState state = 6; +inline bool NetParameter::has_state() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void NetParameter::set_has_state() { + _has_bits_[0] |= 0x00000020u; +} +inline void NetParameter::clear_has_state() { + _has_bits_[0] &= ~0x00000020u; +} +inline void NetParameter::clear_state() { + if (state_ != NULL) state_->::caffe::NetState::Clear(); + clear_has_state(); +} +inline const ::caffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.state) + return state_ != NULL ? *state_ + : *::caffe::NetState::internal_default_instance(); +} +inline ::caffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) { + state_ = new ::caffe::NetState; + } + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.state) + return state_; +} +inline ::caffe::NetState* NetParameter::release_state() { + // @@protoc_insertion_point(field_release:caffe.NetParameter.state) + clear_has_state(); + ::caffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +inline void NetParameter::set_allocated_state(::caffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.NetParameter.state) +} + +// optional bool debug_info = 7 [default = false]; +inline bool NetParameter::has_debug_info() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void NetParameter::set_has_debug_info() { + _has_bits_[0] |= 0x00000040u; +} +inline void NetParameter::clear_has_debug_info() { + _has_bits_[0] &= ~0x00000040u; +} +inline void NetParameter::clear_debug_info() { + debug_info_ = false; + clear_has_debug_info(); +} +inline bool NetParameter::debug_info() const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.debug_info) + return debug_info_; +} +inline void NetParameter::set_debug_info(bool value) { + set_has_debug_info(); + debug_info_ = value; + // @@protoc_insertion_point(field_set:caffe.NetParameter.debug_info) +} + +// repeated .caffe.LayerParameter layer = 100; +inline int NetParameter::layer_size() const { + return layer_.size(); +} +inline void NetParameter::clear_layer() { + layer_.Clear(); +} +inline const ::caffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.layer) + return layer_.Get(index); +} +inline ::caffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.layer) + return layer_.Mutable(index); +} +inline ::caffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:caffe.NetParameter.layer) + return layer_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.layer) + return &layer_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.layer) + return layer_; +} + +// repeated .caffe.V1LayerParameter layers = 2; +inline int NetParameter::layers_size() const { + return layers_.size(); +} +inline void NetParameter::clear_layers() { + layers_.Clear(); +} +inline const ::caffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetParameter.layers) + return layers_.Get(index); +} +inline ::caffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetParameter.layers) + return layers_.Mutable(index); +} +inline ::caffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:caffe.NetParameter.layers) + return layers_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetParameter.layers) + return &layers_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:caffe.NetParameter.layers) + return layers_; +} + +inline const NetParameter* NetParameter::internal_default_instance() { + return &NetParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SolverParameter + +// optional string net = 24; +inline bool SolverParameter::has_net() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SolverParameter::set_has_net() { + _has_bits_[0] |= 0x00000001u; +} +inline void SolverParameter::clear_has_net() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SolverParameter::clear_net() { + net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_net(); +} +inline const ::std::string& SolverParameter::net() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.net) + return net_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_net(const ::std::string& value) { + set_has_net(); + net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.net) +} +inline void SolverParameter::set_net(const char* value) { + set_has_net(); + net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.net) +} +inline void SolverParameter::set_net(const char* value, size_t size) { + set_has_net(); + net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.net) +} +inline ::std::string* SolverParameter::mutable_net() { + set_has_net(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.net) + return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_net() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.net) + clear_has_net(); + return net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_allocated_net(::std::string* net) { + if (net != NULL) { + set_has_net(); + } else { + clear_has_net(); + } + net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), net); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.net) +} + +// optional .caffe.NetParameter net_param = 25; +inline bool SolverParameter::has_net_param() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SolverParameter::set_has_net_param() { + _has_bits_[0] |= 0x00000002u; +} +inline void SolverParameter::clear_has_net_param() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SolverParameter::clear_net_param() { + if (net_param_ != NULL) net_param_->::caffe::NetParameter::Clear(); + clear_has_net_param(); +} +inline const ::caffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.net_param) + return net_param_ != NULL ? *net_param_ + : *::caffe::NetParameter::internal_default_instance(); +} +inline ::caffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) { + net_param_ = new ::caffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.net_param) + return net_param_; +} +inline ::caffe::NetParameter* SolverParameter::release_net_param() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.net_param) + clear_has_net_param(); + ::caffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_net_param(::caffe::NetParameter* net_param) { + delete net_param_; + net_param_ = net_param; + if (net_param) { + set_has_net_param(); + } else { + clear_has_net_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.net_param) +} + +// optional string train_net = 1; +inline bool SolverParameter::has_train_net() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SolverParameter::set_has_train_net() { + _has_bits_[0] |= 0x00000004u; +} +inline void SolverParameter::clear_has_train_net() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SolverParameter::clear_train_net() { + train_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_train_net(); +} +inline const ::std::string& SolverParameter::train_net() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.train_net) + return train_net_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_train_net(const ::std::string& value) { + set_has_train_net(); + train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.train_net) +} +inline void SolverParameter::set_train_net(const char* value) { + set_has_train_net(); + train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.train_net) +} +inline void SolverParameter::set_train_net(const char* value, size_t size) { + set_has_train_net(); + train_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.train_net) +} +inline ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.train_net) + return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_train_net() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.train_net) + clear_has_train_net(); + return train_net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_allocated_train_net(::std::string* train_net) { + if (train_net != NULL) { + set_has_train_net(); + } else { + clear_has_train_net(); + } + train_net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), train_net); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.train_net) +} + +// repeated string test_net = 2; +inline int SolverParameter::test_net_size() const { + return test_net_.size(); +} +inline void SolverParameter::clear_test_net() { + test_net_.Clear(); +} +inline const ::std::string& SolverParameter::test_net(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_net) + return test_net_.Get(index); +} +inline ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.test_net) + return test_net_.Mutable(index); +} +inline void SolverParameter::set_test_net(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_net) + test_net_.Mutable(index)->assign(value); +} +inline void SolverParameter::set_test_net(int index, const char* value) { + test_net_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.test_net) +} +inline void SolverParameter::set_test_net(int index, const char* value, size_t size) { + test_net_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.test_net) +} +inline ::std::string* SolverParameter::add_test_net() { + // @@protoc_insertion_point(field_add_mutable:caffe.SolverParameter.test_net) + return test_net_.Add(); +} +inline void SolverParameter::add_test_net(const ::std::string& value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_net) +} +inline void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.SolverParameter.test_net) +} +inline void SolverParameter::add_test_net(const char* value, size_t size) { + test_net_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.SolverParameter.test_net) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_net) + return test_net_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .caffe.NetParameter train_net_param = 21; +inline bool SolverParameter::has_train_net_param() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void SolverParameter::set_has_train_net_param() { + _has_bits_[0] |= 0x00000010u; +} +inline void SolverParameter::clear_has_train_net_param() { + _has_bits_[0] &= ~0x00000010u; +} +inline void SolverParameter::clear_train_net_param() { + if (train_net_param_ != NULL) train_net_param_->::caffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +inline const ::caffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.train_net_param) + return train_net_param_ != NULL ? *train_net_param_ + : *::caffe::NetParameter::internal_default_instance(); +} +inline ::caffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) { + train_net_param_ = new ::caffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.train_net_param) + return train_net_param_; +} +inline ::caffe::NetParameter* SolverParameter::release_train_net_param() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.train_net_param) + clear_has_train_net_param(); + ::caffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_net_param(::caffe::NetParameter* train_net_param) { + delete train_net_param_; + train_net_param_ = train_net_param; + if (train_net_param) { + set_has_train_net_param(); + } else { + clear_has_train_net_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.train_net_param) +} + +// repeated .caffe.NetParameter test_net_param = 22; +inline int SolverParameter::test_net_param_size() const { + return test_net_param_.size(); +} +inline void SolverParameter::clear_test_net_param() { + test_net_param_.Clear(); +} +inline const ::caffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +inline ::caffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +inline ::caffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_net_param) + return &test_net_param_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_net_param) + return test_net_param_; +} + +// optional .caffe.NetState train_state = 26; +inline bool SolverParameter::has_train_state() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void SolverParameter::set_has_train_state() { + _has_bits_[0] |= 0x00000040u; +} +inline void SolverParameter::clear_has_train_state() { + _has_bits_[0] &= ~0x00000040u; +} +inline void SolverParameter::clear_train_state() { + if (train_state_ != NULL) train_state_->::caffe::NetState::Clear(); + clear_has_train_state(); +} +inline const ::caffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.train_state) + return train_state_ != NULL ? *train_state_ + : *::caffe::NetState::internal_default_instance(); +} +inline ::caffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) { + train_state_ = new ::caffe::NetState; + } + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.train_state) + return train_state_; +} +inline ::caffe::NetState* SolverParameter::release_train_state() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.train_state) + clear_has_train_state(); + ::caffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_state(::caffe::NetState* train_state) { + delete train_state_; + train_state_ = train_state; + if (train_state) { + set_has_train_state(); + } else { + clear_has_train_state(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.train_state) +} + +// repeated .caffe.NetState test_state = 27; +inline int SolverParameter::test_state_size() const { + return test_state_.size(); +} +inline void SolverParameter::clear_test_state() { + test_state_.Clear(); +} +inline const ::caffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_state) + return test_state_.Get(index); +} +inline ::caffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +inline ::caffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_state) + return test_state_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_state) + return &test_state_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_state) + return test_state_; +} + +// repeated int32 test_iter = 3; +inline int SolverParameter::test_iter_size() const { + return test_iter_.size(); +} +inline void SolverParameter::clear_test_iter() { + test_iter_.Clear(); +} +inline ::google::protobuf::int32 SolverParameter::test_iter(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_iter) + return test_iter_.Get(index); +} +inline void SolverParameter::set_test_iter(int index, ::google::protobuf::int32 value) { + test_iter_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_iter) +} +inline void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:caffe.SolverParameter.test_iter) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.test_iter) + return test_iter_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.test_iter) + return &test_iter_; +} + +// optional int32 test_interval = 4 [default = 0]; +inline bool SolverParameter::has_test_interval() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void SolverParameter::set_has_test_interval() { + _has_bits_[0] |= 0x00000200u; +} +inline void SolverParameter::clear_has_test_interval() { + _has_bits_[0] &= ~0x00000200u; +} +inline void SolverParameter::clear_test_interval() { + test_interval_ = 0; + clear_has_test_interval(); +} +inline ::google::protobuf::int32 SolverParameter::test_interval() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_interval) + return test_interval_; +} +inline void SolverParameter::set_test_interval(::google::protobuf::int32 value) { + set_has_test_interval(); + test_interval_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_interval) +} + +// optional bool test_compute_loss = 19 [default = false]; +inline bool SolverParameter::has_test_compute_loss() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void SolverParameter::set_has_test_compute_loss() { + _has_bits_[0] |= 0x00000400u; +} +inline void SolverParameter::clear_has_test_compute_loss() { + _has_bits_[0] &= ~0x00000400u; +} +inline void SolverParameter::clear_test_compute_loss() { + test_compute_loss_ = false; + clear_has_test_compute_loss(); +} +inline bool SolverParameter::test_compute_loss() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_compute_loss) + return test_compute_loss_; +} +inline void SolverParameter::set_test_compute_loss(bool value) { + set_has_test_compute_loss(); + test_compute_loss_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_compute_loss) +} + +// optional bool test_initialization = 32 [default = true]; +inline bool SolverParameter::has_test_initialization() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void SolverParameter::set_has_test_initialization() { + _has_bits_[0] |= 0x00000800u; +} +inline void SolverParameter::clear_has_test_initialization() { + _has_bits_[0] &= ~0x00000800u; +} +inline void SolverParameter::clear_test_initialization() { + test_initialization_ = true; + clear_has_test_initialization(); +} +inline bool SolverParameter::test_initialization() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.test_initialization) + return test_initialization_; +} +inline void SolverParameter::set_test_initialization(bool value) { + set_has_test_initialization(); + test_initialization_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.test_initialization) +} + +// optional float base_lr = 5; +inline bool SolverParameter::has_base_lr() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void SolverParameter::set_has_base_lr() { + _has_bits_[0] |= 0x00001000u; +} +inline void SolverParameter::clear_has_base_lr() { + _has_bits_[0] &= ~0x00001000u; +} +inline void SolverParameter::clear_base_lr() { + base_lr_ = 0; + clear_has_base_lr(); +} +inline float SolverParameter::base_lr() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.base_lr) + return base_lr_; +} +inline void SolverParameter::set_base_lr(float value) { + set_has_base_lr(); + base_lr_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.base_lr) +} + +// optional int32 display = 6; +inline bool SolverParameter::has_display() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void SolverParameter::set_has_display() { + _has_bits_[0] |= 0x00002000u; +} +inline void SolverParameter::clear_has_display() { + _has_bits_[0] &= ~0x00002000u; +} +inline void SolverParameter::clear_display() { + display_ = 0; + clear_has_display(); +} +inline ::google::protobuf::int32 SolverParameter::display() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.display) + return display_; +} +inline void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.display) +} + +// optional int32 average_loss = 33 [default = 1]; +inline bool SolverParameter::has_average_loss() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void SolverParameter::set_has_average_loss() { + _has_bits_[0] |= 0x00004000u; +} +inline void SolverParameter::clear_has_average_loss() { + _has_bits_[0] &= ~0x00004000u; +} +inline void SolverParameter::clear_average_loss() { + average_loss_ = 1; + clear_has_average_loss(); +} +inline ::google::protobuf::int32 SolverParameter::average_loss() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.average_loss) + return average_loss_; +} +inline void SolverParameter::set_average_loss(::google::protobuf::int32 value) { + set_has_average_loss(); + average_loss_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.average_loss) +} + +// optional int32 max_iter = 7; +inline bool SolverParameter::has_max_iter() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void SolverParameter::set_has_max_iter() { + _has_bits_[0] |= 0x00008000u; +} +inline void SolverParameter::clear_has_max_iter() { + _has_bits_[0] &= ~0x00008000u; +} +inline void SolverParameter::clear_max_iter() { + max_iter_ = 0; + clear_has_max_iter(); +} +inline ::google::protobuf::int32 SolverParameter::max_iter() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.max_iter) + return max_iter_; +} +inline void SolverParameter::set_max_iter(::google::protobuf::int32 value) { + set_has_max_iter(); + max_iter_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.max_iter) +} + +// optional int32 iter_size = 36 [default = 1]; +inline bool SolverParameter::has_iter_size() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void SolverParameter::set_has_iter_size() { + _has_bits_[0] |= 0x00010000u; +} +inline void SolverParameter::clear_has_iter_size() { + _has_bits_[0] &= ~0x00010000u; +} +inline void SolverParameter::clear_iter_size() { + iter_size_ = 1; + clear_has_iter_size(); +} +inline ::google::protobuf::int32 SolverParameter::iter_size() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.iter_size) + return iter_size_; +} +inline void SolverParameter::set_iter_size(::google::protobuf::int32 value) { + set_has_iter_size(); + iter_size_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.iter_size) +} + +// optional string lr_policy = 8; +inline bool SolverParameter::has_lr_policy() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void SolverParameter::set_has_lr_policy() { + _has_bits_[0] |= 0x00020000u; +} +inline void SolverParameter::clear_has_lr_policy() { + _has_bits_[0] &= ~0x00020000u; +} +inline void SolverParameter::clear_lr_policy() { + lr_policy_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_lr_policy(); +} +inline const ::std::string& SolverParameter::lr_policy() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.lr_policy) + return lr_policy_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_lr_policy(const ::std::string& value) { + set_has_lr_policy(); + lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.lr_policy) +} +inline void SolverParameter::set_lr_policy(const char* value) { + set_has_lr_policy(); + lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.lr_policy) +} +inline void SolverParameter::set_lr_policy(const char* value, size_t size) { + set_has_lr_policy(); + lr_policy_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.lr_policy) +} +inline ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.lr_policy) + return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_lr_policy() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.lr_policy) + clear_has_lr_policy(); + return lr_policy_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_allocated_lr_policy(::std::string* lr_policy) { + if (lr_policy != NULL) { + set_has_lr_policy(); + } else { + clear_has_lr_policy(); + } + lr_policy_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), lr_policy); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.lr_policy) +} + +// optional float gamma = 9; +inline bool SolverParameter::has_gamma() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void SolverParameter::set_has_gamma() { + _has_bits_[0] |= 0x00040000u; +} +inline void SolverParameter::clear_has_gamma() { + _has_bits_[0] &= ~0x00040000u; +} +inline void SolverParameter::clear_gamma() { + gamma_ = 0; + clear_has_gamma(); +} +inline float SolverParameter::gamma() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.gamma) + return gamma_; +} +inline void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.gamma) +} + +// optional float power = 10; +inline bool SolverParameter::has_power() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +inline void SolverParameter::set_has_power() { + _has_bits_[0] |= 0x00080000u; +} +inline void SolverParameter::clear_has_power() { + _has_bits_[0] &= ~0x00080000u; +} +inline void SolverParameter::clear_power() { + power_ = 0; + clear_has_power(); +} +inline float SolverParameter::power() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.power) + return power_; +} +inline void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.power) +} + +// optional float momentum = 11; +inline bool SolverParameter::has_momentum() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +inline void SolverParameter::set_has_momentum() { + _has_bits_[0] |= 0x00100000u; +} +inline void SolverParameter::clear_has_momentum() { + _has_bits_[0] &= ~0x00100000u; +} +inline void SolverParameter::clear_momentum() { + momentum_ = 0; + clear_has_momentum(); +} +inline float SolverParameter::momentum() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.momentum) + return momentum_; +} +inline void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.momentum) +} + +// optional float weight_decay = 12; +inline bool SolverParameter::has_weight_decay() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +inline void SolverParameter::set_has_weight_decay() { + _has_bits_[0] |= 0x00200000u; +} +inline void SolverParameter::clear_has_weight_decay() { + _has_bits_[0] &= ~0x00200000u; +} +inline void SolverParameter::clear_weight_decay() { + weight_decay_ = 0; + clear_has_weight_decay(); +} +inline float SolverParameter::weight_decay() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.weight_decay) + return weight_decay_; +} +inline void SolverParameter::set_weight_decay(float value) { + set_has_weight_decay(); + weight_decay_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.weight_decay) +} + +// optional string regularization_type = 29 [default = "L2"]; +inline bool SolverParameter::has_regularization_type() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void SolverParameter::set_has_regularization_type() { + _has_bits_[0] |= 0x00400000u; +} +inline void SolverParameter::clear_has_regularization_type() { + _has_bits_[0] &= ~0x00400000u; +} +inline void SolverParameter::clear_regularization_type() { + regularization_type_.ClearToDefaultNoArena(_default_regularization_type_); + clear_has_regularization_type(); +} +inline const ::std::string& SolverParameter::regularization_type() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.regularization_type) + return regularization_type_.GetNoArena(_default_regularization_type_); +} +inline void SolverParameter::set_regularization_type(const ::std::string& value) { + set_has_regularization_type(); + regularization_type_.SetNoArena(_default_regularization_type_, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.regularization_type) +} +inline void SolverParameter::set_regularization_type(const char* value) { + set_has_regularization_type(); + regularization_type_.SetNoArena(_default_regularization_type_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.regularization_type) +} +inline void SolverParameter::set_regularization_type(const char* value, size_t size) { + set_has_regularization_type(); + regularization_type_.SetNoArena(_default_regularization_type_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.regularization_type) +} +inline ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.regularization_type) + return regularization_type_.MutableNoArena(_default_regularization_type_); +} +inline ::std::string* SolverParameter::release_regularization_type() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.regularization_type) + clear_has_regularization_type(); + return regularization_type_.ReleaseNoArena(_default_regularization_type_); +} +inline void SolverParameter::set_allocated_regularization_type(::std::string* regularization_type) { + if (regularization_type != NULL) { + set_has_regularization_type(); + } else { + clear_has_regularization_type(); + } + regularization_type_.SetAllocatedNoArena(_default_regularization_type_, regularization_type); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.regularization_type) +} + +// optional int32 stepsize = 13; +inline bool SolverParameter::has_stepsize() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void SolverParameter::set_has_stepsize() { + _has_bits_[0] |= 0x00800000u; +} +inline void SolverParameter::clear_has_stepsize() { + _has_bits_[0] &= ~0x00800000u; +} +inline void SolverParameter::clear_stepsize() { + stepsize_ = 0; + clear_has_stepsize(); +} +inline ::google::protobuf::int32 SolverParameter::stepsize() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.stepsize) + return stepsize_; +} +inline void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.stepsize) +} + +// repeated int32 stepvalue = 34; +inline int SolverParameter::stepvalue_size() const { + return stepvalue_.size(); +} +inline void SolverParameter::clear_stepvalue() { + stepvalue_.Clear(); +} +inline ::google::protobuf::int32 SolverParameter::stepvalue(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.stepvalue) + return stepvalue_.Get(index); +} +inline void SolverParameter::set_stepvalue(int index, ::google::protobuf::int32 value) { + stepvalue_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.stepvalue) +} +inline void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:caffe.SolverParameter.stepvalue) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:caffe.SolverParameter.stepvalue) + return stepvalue_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverParameter.stepvalue) + return &stepvalue_; +} + +// optional float clip_gradients = 35 [default = -1]; +inline bool SolverParameter::has_clip_gradients() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void SolverParameter::set_has_clip_gradients() { + _has_bits_[0] |= 0x02000000u; +} +inline void SolverParameter::clear_has_clip_gradients() { + _has_bits_[0] &= ~0x02000000u; +} +inline void SolverParameter::clear_clip_gradients() { + clip_gradients_ = -1; + clear_has_clip_gradients(); +} +inline float SolverParameter::clip_gradients() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.clip_gradients) + return clip_gradients_; +} +inline void SolverParameter::set_clip_gradients(float value) { + set_has_clip_gradients(); + clip_gradients_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.clip_gradients) +} + +// optional int32 snapshot = 14 [default = 0]; +inline bool SolverParameter::has_snapshot() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void SolverParameter::set_has_snapshot() { + _has_bits_[0] |= 0x04000000u; +} +inline void SolverParameter::clear_has_snapshot() { + _has_bits_[0] &= ~0x04000000u; +} +inline void SolverParameter::clear_snapshot() { + snapshot_ = 0; + clear_has_snapshot(); +} +inline ::google::protobuf::int32 SolverParameter::snapshot() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot) + return snapshot_; +} +inline void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot) +} + +// optional string snapshot_prefix = 15; +inline bool SolverParameter::has_snapshot_prefix() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void SolverParameter::set_has_snapshot_prefix() { + _has_bits_[0] |= 0x08000000u; +} +inline void SolverParameter::clear_has_snapshot_prefix() { + _has_bits_[0] &= ~0x08000000u; +} +inline void SolverParameter::clear_snapshot_prefix() { + snapshot_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_snapshot_prefix(); +} +inline const ::std::string& SolverParameter::snapshot_prefix() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_snapshot_prefix(const ::std::string& value) { + set_has_snapshot_prefix(); + snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_prefix) +} +inline void SolverParameter::set_snapshot_prefix(const char* value) { + set_has_snapshot_prefix(); + snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.snapshot_prefix) +} +inline void SolverParameter::set_snapshot_prefix(const char* value, size_t size) { + set_has_snapshot_prefix(); + snapshot_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.snapshot_prefix) +} +inline ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_snapshot_prefix() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.snapshot_prefix) + clear_has_snapshot_prefix(); + return snapshot_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverParameter::set_allocated_snapshot_prefix(::std::string* snapshot_prefix) { + if (snapshot_prefix != NULL) { + set_has_snapshot_prefix(); + } else { + clear_has_snapshot_prefix(); + } + snapshot_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), snapshot_prefix); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.snapshot_prefix) +} + +// optional bool snapshot_diff = 16 [default = false]; +inline bool SolverParameter::has_snapshot_diff() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void SolverParameter::set_has_snapshot_diff() { + _has_bits_[0] |= 0x10000000u; +} +inline void SolverParameter::clear_has_snapshot_diff() { + _has_bits_[0] &= ~0x10000000u; +} +inline void SolverParameter::clear_snapshot_diff() { + snapshot_diff_ = false; + clear_has_snapshot_diff(); +} +inline bool SolverParameter::snapshot_diff() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_diff) + return snapshot_diff_; +} +inline void SolverParameter::set_snapshot_diff(bool value) { + set_has_snapshot_diff(); + snapshot_diff_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_diff) +} + +// optional .caffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; +inline bool SolverParameter::has_snapshot_format() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void SolverParameter::set_has_snapshot_format() { + _has_bits_[0] |= 0x20000000u; +} +inline void SolverParameter::clear_has_snapshot_format() { + _has_bits_[0] &= ~0x20000000u; +} +inline void SolverParameter::clear_snapshot_format() { + snapshot_format_ = 1; + clear_has_snapshot_format(); +} +inline ::caffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_format) + return static_cast< ::caffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} +inline void SolverParameter::set_snapshot_format(::caffe::SolverParameter_SnapshotFormat value) { + assert(::caffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_format) +} + +// optional .caffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; +inline bool SolverParameter::has_solver_mode() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void SolverParameter::set_has_solver_mode() { + _has_bits_[0] |= 0x40000000u; +} +inline void SolverParameter::clear_has_solver_mode() { + _has_bits_[0] &= ~0x40000000u; +} +inline void SolverParameter::clear_solver_mode() { + solver_mode_ = 1; + clear_has_solver_mode(); +} +inline ::caffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.solver_mode) + return static_cast< ::caffe::SolverParameter_SolverMode >(solver_mode_); +} +inline void SolverParameter::set_solver_mode(::caffe::SolverParameter_SolverMode value) { + assert(::caffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.solver_mode) +} + +// optional int32 device_id = 18 [default = 0]; +inline bool SolverParameter::has_device_id() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void SolverParameter::set_has_device_id() { + _has_bits_[0] |= 0x80000000u; +} +inline void SolverParameter::clear_has_device_id() { + _has_bits_[0] &= ~0x80000000u; +} +inline void SolverParameter::clear_device_id() { + device_id_ = 0; + clear_has_device_id(); +} +inline ::google::protobuf::int32 SolverParameter::device_id() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.device_id) + return device_id_; +} +inline void SolverParameter::set_device_id(::google::protobuf::int32 value) { + set_has_device_id(); + device_id_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.device_id) +} + +// optional int64 random_seed = 20 [default = -1]; +inline bool SolverParameter::has_random_seed() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void SolverParameter::set_has_random_seed() { + _has_bits_[1] |= 0x00000001u; +} +inline void SolverParameter::clear_has_random_seed() { + _has_bits_[1] &= ~0x00000001u; +} +inline void SolverParameter::clear_random_seed() { + random_seed_ = GOOGLE_LONGLONG(-1); + clear_has_random_seed(); +} +inline ::google::protobuf::int64 SolverParameter::random_seed() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.random_seed) + return random_seed_; +} +inline void SolverParameter::set_random_seed(::google::protobuf::int64 value) { + set_has_random_seed(); + random_seed_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.random_seed) +} + +// optional string type = 40 [default = "SGD"]; +inline bool SolverParameter::has_type() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void SolverParameter::set_has_type() { + _has_bits_[1] |= 0x00000002u; +} +inline void SolverParameter::clear_has_type() { + _has_bits_[1] &= ~0x00000002u; +} +inline void SolverParameter::clear_type() { + type_.ClearToDefaultNoArena(_default_type_); + clear_has_type(); +} +inline const ::std::string& SolverParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.type) + return type_.GetNoArena(_default_type_); +} +inline void SolverParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(_default_type_, value); + // @@protoc_insertion_point(field_set:caffe.SolverParameter.type) +} +inline void SolverParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(_default_type_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverParameter.type) +} +inline void SolverParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(_default_type_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverParameter.type) +} +inline ::std::string* SolverParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.SolverParameter.type) + return type_.MutableNoArena(_default_type_); +} +inline ::std::string* SolverParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.SolverParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(_default_type_); +} +inline void SolverParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(_default_type_, type); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverParameter.type) +} + +// optional float delta = 31 [default = 1e-08]; +inline bool SolverParameter::has_delta() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void SolverParameter::set_has_delta() { + _has_bits_[1] |= 0x00000004u; +} +inline void SolverParameter::clear_has_delta() { + _has_bits_[1] &= ~0x00000004u; +} +inline void SolverParameter::clear_delta() { + delta_ = 1e-08f; + clear_has_delta(); +} +inline float SolverParameter::delta() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.delta) + return delta_; +} +inline void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.delta) +} + +// optional float momentum2 = 39 [default = 0.999]; +inline bool SolverParameter::has_momentum2() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void SolverParameter::set_has_momentum2() { + _has_bits_[1] |= 0x00000008u; +} +inline void SolverParameter::clear_has_momentum2() { + _has_bits_[1] &= ~0x00000008u; +} +inline void SolverParameter::clear_momentum2() { + momentum2_ = 0.999f; + clear_has_momentum2(); +} +inline float SolverParameter::momentum2() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.momentum2) + return momentum2_; +} +inline void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38 [default = 0.99]; +inline bool SolverParameter::has_rms_decay() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void SolverParameter::set_has_rms_decay() { + _has_bits_[1] |= 0x00000010u; +} +inline void SolverParameter::clear_has_rms_decay() { + _has_bits_[1] &= ~0x00000010u; +} +inline void SolverParameter::clear_rms_decay() { + rms_decay_ = 0.99f; + clear_has_rms_decay(); +} +inline float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.rms_decay) + return rms_decay_; +} +inline void SolverParameter::set_rms_decay(float value) { + set_has_rms_decay(); + rms_decay_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.rms_decay) +} + +// optional bool debug_info = 23 [default = false]; +inline bool SolverParameter::has_debug_info() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void SolverParameter::set_has_debug_info() { + _has_bits_[1] |= 0x00000020u; +} +inline void SolverParameter::clear_has_debug_info() { + _has_bits_[1] &= ~0x00000020u; +} +inline void SolverParameter::clear_debug_info() { + debug_info_ = false; + clear_has_debug_info(); +} +inline bool SolverParameter::debug_info() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.debug_info) + return debug_info_; +} +inline void SolverParameter::set_debug_info(bool value) { + set_has_debug_info(); + debug_info_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.debug_info) +} + +// optional bool snapshot_after_train = 28 [default = true]; +inline bool SolverParameter::has_snapshot_after_train() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void SolverParameter::set_has_snapshot_after_train() { + _has_bits_[1] |= 0x00000040u; +} +inline void SolverParameter::clear_has_snapshot_after_train() { + _has_bits_[1] &= ~0x00000040u; +} +inline void SolverParameter::clear_snapshot_after_train() { + snapshot_after_train_ = true; + clear_has_snapshot_after_train(); +} +inline bool SolverParameter::snapshot_after_train() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.snapshot_after_train) + return snapshot_after_train_; +} +inline void SolverParameter::set_snapshot_after_train(bool value) { + set_has_snapshot_after_train(); + snapshot_after_train_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.snapshot_after_train) +} + +// optional .caffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; +inline bool SolverParameter::has_solver_type() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void SolverParameter::set_has_solver_type() { + _has_bits_[1] |= 0x00000080u; +} +inline void SolverParameter::clear_has_solver_type() { + _has_bits_[1] &= ~0x00000080u; +} +inline void SolverParameter::clear_solver_type() { + solver_type_ = 0; + clear_has_solver_type(); +} +inline ::caffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:caffe.SolverParameter.solver_type) + return static_cast< ::caffe::SolverParameter_SolverType >(solver_type_); +} +inline void SolverParameter::set_solver_type(::caffe::SolverParameter_SolverType value) { + assert(::caffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverParameter.solver_type) +} + +inline const SolverParameter* SolverParameter::internal_default_instance() { + return &SolverParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SolverState + +// optional int32 iter = 1; +inline bool SolverState::has_iter() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SolverState::set_has_iter() { + _has_bits_[0] |= 0x00000001u; +} +inline void SolverState::clear_has_iter() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SolverState::clear_iter() { + iter_ = 0; + clear_has_iter(); +} +inline ::google::protobuf::int32 SolverState::iter() const { + // @@protoc_insertion_point(field_get:caffe.SolverState.iter) + return iter_; +} +inline void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverState.iter) +} + +// optional string learned_net = 2; +inline bool SolverState::has_learned_net() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SolverState::set_has_learned_net() { + _has_bits_[0] |= 0x00000002u; +} +inline void SolverState::clear_has_learned_net() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SolverState::clear_learned_net() { + learned_net_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_learned_net(); +} +inline const ::std::string& SolverState::learned_net() const { + // @@protoc_insertion_point(field_get:caffe.SolverState.learned_net) + return learned_net_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverState::set_learned_net(const ::std::string& value) { + set_has_learned_net(); + learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SolverState.learned_net) +} +inline void SolverState::set_learned_net(const char* value) { + set_has_learned_net(); + learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SolverState.learned_net) +} +inline void SolverState::set_learned_net(const char* value, size_t size) { + set_has_learned_net(); + learned_net_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SolverState.learned_net) +} +inline ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + // @@protoc_insertion_point(field_mutable:caffe.SolverState.learned_net) + return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverState::release_learned_net() { + // @@protoc_insertion_point(field_release:caffe.SolverState.learned_net) + clear_has_learned_net(); + return learned_net_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SolverState::set_allocated_learned_net(::std::string* learned_net) { + if (learned_net != NULL) { + set_has_learned_net(); + } else { + clear_has_learned_net(); + } + learned_net_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), learned_net); + // @@protoc_insertion_point(field_set_allocated:caffe.SolverState.learned_net) +} + +// repeated .caffe.BlobProto history = 3; +inline int SolverState::history_size() const { + return history_.size(); +} +inline void SolverState::clear_history() { + history_.Clear(); +} +inline const ::caffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:caffe.SolverState.history) + return history_.Get(index); +} +inline ::caffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:caffe.SolverState.history) + return history_.Mutable(index); +} +inline ::caffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:caffe.SolverState.history) + return history_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:caffe.SolverState.history) + return &history_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:caffe.SolverState.history) + return history_; +} + +// optional int32 current_step = 4 [default = 0]; +inline bool SolverState::has_current_step() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void SolverState::set_has_current_step() { + _has_bits_[0] |= 0x00000008u; +} +inline void SolverState::clear_has_current_step() { + _has_bits_[0] &= ~0x00000008u; +} +inline void SolverState::clear_current_step() { + current_step_ = 0; + clear_has_current_step(); +} +inline ::google::protobuf::int32 SolverState::current_step() const { + // @@protoc_insertion_point(field_get:caffe.SolverState.current_step) + return current_step_; +} +inline void SolverState::set_current_step(::google::protobuf::int32 value) { + set_has_current_step(); + current_step_ = value; + // @@protoc_insertion_point(field_set:caffe.SolverState.current_step) +} + +inline const SolverState* SolverState::internal_default_instance() { + return &SolverState_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NetState + +// optional .caffe.Phase phase = 1 [default = TEST]; +inline bool NetState::has_phase() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NetState::set_has_phase() { + _has_bits_[0] |= 0x00000001u; +} +inline void NetState::clear_has_phase() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NetState::clear_phase() { + phase_ = 1; + clear_has_phase(); +} +inline ::caffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:caffe.NetState.phase) + return static_cast< ::caffe::Phase >(phase_); +} +inline void NetState::set_phase(::caffe::Phase value) { + assert(::caffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:caffe.NetState.phase) +} + +// optional int32 level = 2 [default = 0]; +inline bool NetState::has_level() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NetState::set_has_level() { + _has_bits_[0] |= 0x00000002u; +} +inline void NetState::clear_has_level() { + _has_bits_[0] &= ~0x00000002u; +} +inline void NetState::clear_level() { + level_ = 0; + clear_has_level(); +} +inline ::google::protobuf::int32 NetState::level() const { + // @@protoc_insertion_point(field_get:caffe.NetState.level) + return level_; +} +inline void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:caffe.NetState.level) +} + +// repeated string stage = 3; +inline int NetState::stage_size() const { + return stage_.size(); +} +inline void NetState::clear_stage() { + stage_.Clear(); +} +inline const ::std::string& NetState::stage(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetState.stage) + return stage_.Get(index); +} +inline ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetState.stage) + return stage_.Mutable(index); +} +inline void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetState.stage) + stage_.Mutable(index)->assign(value); +} +inline void NetState::set_stage(int index, const char* value) { + stage_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetState.stage) +} +inline void NetState::set_stage(int index, const char* value, size_t size) { + stage_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetState.stage) +} +inline ::std::string* NetState::add_stage() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetState.stage) + return stage_.Add(); +} +inline void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetState.stage) +} +inline void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetState.stage) +} +inline void NetState::add_stage(const char* value, size_t size) { + stage_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetState.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:caffe.NetState.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetState.stage) + return &stage_; +} + +inline const NetState* NetState::internal_default_instance() { + return &NetState_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NetStateRule + +// optional .caffe.Phase phase = 1; +inline bool NetStateRule::has_phase() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NetStateRule::set_has_phase() { + _has_bits_[0] |= 0x00000001u; +} +inline void NetStateRule::clear_has_phase() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NetStateRule::clear_phase() { + phase_ = 0; + clear_has_phase(); +} +inline ::caffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.phase) + return static_cast< ::caffe::Phase >(phase_); +} +inline void NetStateRule::set_phase(::caffe::Phase value) { + assert(::caffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:caffe.NetStateRule.phase) +} + +// optional int32 min_level = 2; +inline bool NetStateRule::has_min_level() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NetStateRule::set_has_min_level() { + _has_bits_[0] |= 0x00000002u; +} +inline void NetStateRule::clear_has_min_level() { + _has_bits_[0] &= ~0x00000002u; +} +inline void NetStateRule::clear_min_level() { + min_level_ = 0; + clear_has_min_level(); +} +inline ::google::protobuf::int32 NetStateRule::min_level() const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.min_level) + return min_level_; +} +inline void NetStateRule::set_min_level(::google::protobuf::int32 value) { + set_has_min_level(); + min_level_ = value; + // @@protoc_insertion_point(field_set:caffe.NetStateRule.min_level) +} + +// optional int32 max_level = 3; +inline bool NetStateRule::has_max_level() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void NetStateRule::set_has_max_level() { + _has_bits_[0] |= 0x00000004u; +} +inline void NetStateRule::clear_has_max_level() { + _has_bits_[0] &= ~0x00000004u; +} +inline void NetStateRule::clear_max_level() { + max_level_ = 0; + clear_has_max_level(); +} +inline ::google::protobuf::int32 NetStateRule::max_level() const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.max_level) + return max_level_; +} +inline void NetStateRule::set_max_level(::google::protobuf::int32 value) { + set_has_max_level(); + max_level_ = value; + // @@protoc_insertion_point(field_set:caffe.NetStateRule.max_level) +} + +// repeated string stage = 4; +inline int NetStateRule::stage_size() const { + return stage_.size(); +} +inline void NetStateRule::clear_stage() { + stage_.Clear(); +} +inline const ::std::string& NetStateRule::stage(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.stage) + return stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetStateRule.stage) + return stage_.Mutable(index); +} +inline void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetStateRule.stage) + stage_.Mutable(index)->assign(value); +} +inline void NetStateRule::set_stage(int index, const char* value) { + stage_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetStateRule.stage) +} +inline void NetStateRule::set_stage(int index, const char* value, size_t size) { + stage_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetStateRule.stage) +} +inline ::std::string* NetStateRule::add_stage() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetStateRule.stage) + return stage_.Add(); +} +inline void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetStateRule.stage) +} +inline void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetStateRule.stage) +} +inline void NetStateRule::add_stage(const char* value, size_t size) { + stage_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetStateRule.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:caffe.NetStateRule.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetStateRule.stage) + return &stage_; +} + +// repeated string not_stage = 5; +inline int NetStateRule::not_stage_size() const { + return not_stage_.size(); +} +inline void NetStateRule::clear_not_stage() { + not_stage_.Clear(); +} +inline const ::std::string& NetStateRule::not_stage(int index) const { + // @@protoc_insertion_point(field_get:caffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:caffe.NetStateRule.not_stage) + return not_stage_.Mutable(index); +} +inline void NetStateRule::set_not_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.NetStateRule.not_stage) + not_stage_.Mutable(index)->assign(value); +} +inline void NetStateRule::set_not_stage(int index, const char* value) { + not_stage_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.NetStateRule.not_stage) +} +inline void NetStateRule::set_not_stage(int index, const char* value, size_t size) { + not_stage_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.NetStateRule.not_stage) +} +inline ::std::string* NetStateRule::add_not_stage() { + // @@protoc_insertion_point(field_add_mutable:caffe.NetStateRule.not_stage) + return not_stage_.Add(); +} +inline void NetStateRule::add_not_stage(const ::std::string& value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.NetStateRule.not_stage) +} +inline void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.NetStateRule.not_stage) +} +inline void NetStateRule::add_not_stage(const char* value, size_t size) { + not_stage_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.NetStateRule.not_stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:caffe.NetStateRule.not_stage) + return not_stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:caffe.NetStateRule.not_stage) + return ¬_stage_; +} + +inline const NetStateRule* NetStateRule::internal_default_instance() { + return &NetStateRule_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ParamSpec + +// optional string name = 1; +inline bool ParamSpec::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ParamSpec::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ParamSpec::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ParamSpec::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& ParamSpec::name() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ParamSpec::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ParamSpec.name) +} +inline void ParamSpec::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ParamSpec.name) +} +inline void ParamSpec::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ParamSpec.name) +} +inline ::std::string* ParamSpec::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.ParamSpec.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ParamSpec::release_name() { + // @@protoc_insertion_point(field_release:caffe.ParamSpec.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ParamSpec::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.ParamSpec.name) +} + +// optional .caffe.ParamSpec.DimCheckMode share_mode = 2; +inline bool ParamSpec::has_share_mode() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ParamSpec::set_has_share_mode() { + _has_bits_[0] |= 0x00000002u; +} +inline void ParamSpec::clear_has_share_mode() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ParamSpec::clear_share_mode() { + share_mode_ = 0; + clear_has_share_mode(); +} +inline ::caffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.share_mode) + return static_cast< ::caffe::ParamSpec_DimCheckMode >(share_mode_); +} +inline void ParamSpec::set_share_mode(::caffe::ParamSpec_DimCheckMode value) { + assert(::caffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:caffe.ParamSpec.share_mode) +} + +// optional float lr_mult = 3 [default = 1]; +inline bool ParamSpec::has_lr_mult() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ParamSpec::set_has_lr_mult() { + _has_bits_[0] |= 0x00000004u; +} +inline void ParamSpec::clear_has_lr_mult() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ParamSpec::clear_lr_mult() { + lr_mult_ = 1; + clear_has_lr_mult(); +} +inline float ParamSpec::lr_mult() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.lr_mult) + return lr_mult_; +} +inline void ParamSpec::set_lr_mult(float value) { + set_has_lr_mult(); + lr_mult_ = value; + // @@protoc_insertion_point(field_set:caffe.ParamSpec.lr_mult) +} + +// optional float decay_mult = 4 [default = 1]; +inline bool ParamSpec::has_decay_mult() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ParamSpec::set_has_decay_mult() { + _has_bits_[0] |= 0x00000008u; +} +inline void ParamSpec::clear_has_decay_mult() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ParamSpec::clear_decay_mult() { + decay_mult_ = 1; + clear_has_decay_mult(); +} +inline float ParamSpec::decay_mult() const { + // @@protoc_insertion_point(field_get:caffe.ParamSpec.decay_mult) + return decay_mult_; +} +inline void ParamSpec::set_decay_mult(float value) { + set_has_decay_mult(); + decay_mult_ = value; + // @@protoc_insertion_point(field_set:caffe.ParamSpec.decay_mult) +} + +inline const ParamSpec* ParamSpec::internal_default_instance() { + return &ParamSpec_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// LayerParameter + +// optional string name = 1; +inline bool LayerParameter::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void LayerParameter::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void LayerParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void LayerParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& LayerParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.name) +} +inline void LayerParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.name) +} +inline void LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.name) +} +inline ::std::string* LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void LayerParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.name) +} + +// optional string type = 2; +inline bool LayerParameter::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void LayerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void LayerParameter::clear_type() { + type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); +} +inline const ::std::string& LayerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.type) + return type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.type) +} +inline void LayerParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.type) +} +inline void LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.type) +} +inline ::std::string* LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void LayerParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.type) +} + +// repeated string bottom = 3; +inline int LayerParameter::bottom_size() const { + return bottom_.size(); +} +inline void LayerParameter::clear_bottom() { + bottom_.Clear(); +} +inline const ::std::string& LayerParameter::bottom(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.LayerParameter.bottom) + bottom_.Mutable(index)->assign(value); +} +inline void LayerParameter::set_bottom(int index, const char* value) { + bottom_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.bottom) +} +inline void LayerParameter::set_bottom(int index, const char* value, size_t size) { + bottom_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.bottom) +} +inline ::std::string* LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:caffe.LayerParameter.bottom) + return bottom_.Add(); +} +inline void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.bottom) +} +inline void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.LayerParameter.bottom) +} +inline void LayerParameter::add_bottom(const char* value, size_t size) { + bottom_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.bottom) + return &bottom_; +} + +// repeated string top = 4; +inline int LayerParameter::top_size() const { + return top_.size(); +} +inline void LayerParameter::clear_top() { + top_.Clear(); +} +inline const ::std::string& LayerParameter::top(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.top) + return top_.Mutable(index); +} +inline void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.LayerParameter.top) + top_.Mutable(index)->assign(value); +} +inline void LayerParameter::set_top(int index, const char* value) { + top_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.LayerParameter.top) +} +inline void LayerParameter::set_top(int index, const char* value, size_t size) { + top_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.LayerParameter.top) +} +inline ::std::string* LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:caffe.LayerParameter.top) + return top_.Add(); +} +inline void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.top) +} +inline void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.LayerParameter.top) +} +inline void LayerParameter::add_top(const char* value, size_t size) { + top_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.top) + return &top_; +} + +// optional .caffe.Phase phase = 10; +inline bool LayerParameter::has_phase() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void LayerParameter::set_has_phase() { + _has_bits_[0] |= 0x00000010u; +} +inline void LayerParameter::clear_has_phase() { + _has_bits_[0] &= ~0x00000010u; +} +inline void LayerParameter::clear_phase() { + phase_ = 0; + clear_has_phase(); +} +inline ::caffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.phase) + return static_cast< ::caffe::Phase >(phase_); +} +inline void LayerParameter::set_phase(::caffe::Phase value) { + assert(::caffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:caffe.LayerParameter.phase) +} + +// repeated float loss_weight = 5; +inline int LayerParameter::loss_weight_size() const { + return loss_weight_.size(); +} +inline void LayerParameter::clear_loss_weight() { + loss_weight_.Clear(); +} +inline float LayerParameter::loss_weight(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.loss_weight) + return loss_weight_.Get(index); +} +inline void LayerParameter::set_loss_weight(int index, float value) { + loss_weight_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.loss_weight) +} +inline void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .caffe.ParamSpec param = 6; +inline int LayerParameter::param_size() const { + return param_.size(); +} +inline void LayerParameter::clear_param() { + param_.Clear(); +} +inline const ::caffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.param) + return param_.Get(index); +} +inline ::caffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.param) + return param_.Mutable(index); +} +inline ::caffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.param) + return param_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.param) + return ¶m_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.param) + return param_; +} + +// repeated .caffe.BlobProto blobs = 7; +inline int LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::caffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::caffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::caffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.blobs) + return blobs_; +} + +// repeated bool propagate_down = 11; +inline int LayerParameter::propagate_down_size() const { + return propagate_down_.size(); +} +inline void LayerParameter::clear_propagate_down() { + propagate_down_.Clear(); +} +inline bool LayerParameter::propagate_down(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.propagate_down) + return propagate_down_.Get(index); +} +inline void LayerParameter::set_propagate_down(int index, bool value) { + propagate_down_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.LayerParameter.propagate_down) +} +inline void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:caffe.LayerParameter.propagate_down) +} +inline const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.propagate_down) + return propagate_down_; +} +inline ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .caffe.NetStateRule include = 8; +inline int LayerParameter::include_size() const { + return include_.size(); +} +inline void LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::caffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.include) + return include_.Get(index); +} +inline ::caffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.include) + return include_.Mutable(index); +} +inline ::caffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.include) + return include_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.include) + return &include_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.include) + return include_; +} + +// repeated .caffe.NetStateRule exclude = 9; +inline int LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::caffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::caffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::caffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:caffe.LayerParameter.exclude) + return exclude_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:caffe.LayerParameter.exclude) + return &exclude_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:caffe.LayerParameter.exclude) + return exclude_; +} + +// optional .caffe.TransformationParameter transform_param = 100; +inline bool LayerParameter::has_transform_param() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void LayerParameter::set_has_transform_param() { + _has_bits_[0] |= 0x00000800u; +} +inline void LayerParameter::clear_has_transform_param() { + _has_bits_[0] &= ~0x00000800u; +} +inline void LayerParameter::clear_transform_param() { + if (transform_param_ != NULL) transform_param_->::caffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::caffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ + : *::caffe::TransformationParameter::internal_default_instance(); +} +inline ::caffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::caffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.transform_param) + return transform_param_; +} +inline ::caffe::TransformationParameter* LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.transform_param) + clear_has_transform_param(); + ::caffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_transform_param(::caffe::TransformationParameter* transform_param) { + delete transform_param_; + transform_param_ = transform_param; + if (transform_param) { + set_has_transform_param(); + } else { + clear_has_transform_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.transform_param) +} + +// optional .caffe.LossParameter loss_param = 101; +inline bool LayerParameter::has_loss_param() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void LayerParameter::set_has_loss_param() { + _has_bits_[0] |= 0x00001000u; +} +inline void LayerParameter::clear_has_loss_param() { + _has_bits_[0] &= ~0x00001000u; +} +inline void LayerParameter::clear_loss_param() { + if (loss_param_ != NULL) loss_param_->::caffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::caffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ + : *::caffe::LossParameter::internal_default_instance(); +} +inline ::caffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::caffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.loss_param) + return loss_param_; +} +inline ::caffe::LossParameter* LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.loss_param) + clear_has_loss_param(); + ::caffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_loss_param(::caffe::LossParameter* loss_param) { + delete loss_param_; + loss_param_ = loss_param; + if (loss_param) { + set_has_loss_param(); + } else { + clear_has_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.loss_param) +} + +// optional .caffe.AccuracyParameter accuracy_param = 102; +inline bool LayerParameter::has_accuracy_param() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void LayerParameter::set_has_accuracy_param() { + _has_bits_[0] |= 0x00002000u; +} +inline void LayerParameter::clear_has_accuracy_param() { + _has_bits_[0] &= ~0x00002000u; +} +inline void LayerParameter::clear_accuracy_param() { + if (accuracy_param_ != NULL) accuracy_param_->::caffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::caffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ + : *::caffe::AccuracyParameter::internal_default_instance(); +} +inline ::caffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::caffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::caffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::caffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_accuracy_param(::caffe::AccuracyParameter* accuracy_param) { + delete accuracy_param_; + accuracy_param_ = accuracy_param; + if (accuracy_param) { + set_has_accuracy_param(); + } else { + clear_has_accuracy_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.accuracy_param) +} + +// optional .caffe.ArgMaxParameter argmax_param = 103; +inline bool LayerParameter::has_argmax_param() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void LayerParameter::set_has_argmax_param() { + _has_bits_[0] |= 0x00004000u; +} +inline void LayerParameter::clear_has_argmax_param() { + _has_bits_[0] &= ~0x00004000u; +} +inline void LayerParameter::clear_argmax_param() { + if (argmax_param_ != NULL) argmax_param_->::caffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::caffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ + : *::caffe::ArgMaxParameter::internal_default_instance(); +} +inline ::caffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::caffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.argmax_param) + return argmax_param_; +} +inline ::caffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.argmax_param) + clear_has_argmax_param(); + ::caffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_argmax_param(::caffe::ArgMaxParameter* argmax_param) { + delete argmax_param_; + argmax_param_ = argmax_param; + if (argmax_param) { + set_has_argmax_param(); + } else { + clear_has_argmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.argmax_param) +} + +// optional .caffe.BatchNormParameter batch_norm_param = 139; +inline bool LayerParameter::has_batch_norm_param() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void LayerParameter::set_has_batch_norm_param() { + _has_bits_[0] |= 0x00008000u; +} +inline void LayerParameter::clear_has_batch_norm_param() { + _has_bits_[0] &= ~0x00008000u; +} +inline void LayerParameter::clear_batch_norm_param() { + if (batch_norm_param_ != NULL) batch_norm_param_->::caffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +inline const ::caffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.batch_norm_param) + return batch_norm_param_ != NULL ? *batch_norm_param_ + : *::caffe::BatchNormParameter::internal_default_instance(); +} +inline ::caffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) { + batch_norm_param_ = new ::caffe::BatchNormParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +inline ::caffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.batch_norm_param) + clear_has_batch_norm_param(); + ::caffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_batch_norm_param(::caffe::BatchNormParameter* batch_norm_param) { + delete batch_norm_param_; + batch_norm_param_ = batch_norm_param; + if (batch_norm_param) { + set_has_batch_norm_param(); + } else { + clear_has_batch_norm_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.batch_norm_param) +} + +// optional .caffe.BiasParameter bias_param = 141; +inline bool LayerParameter::has_bias_param() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void LayerParameter::set_has_bias_param() { + _has_bits_[0] |= 0x00010000u; +} +inline void LayerParameter::clear_has_bias_param() { + _has_bits_[0] &= ~0x00010000u; +} +inline void LayerParameter::clear_bias_param() { + if (bias_param_ != NULL) bias_param_->::caffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +inline const ::caffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.bias_param) + return bias_param_ != NULL ? *bias_param_ + : *::caffe::BiasParameter::internal_default_instance(); +} +inline ::caffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) { + bias_param_ = new ::caffe::BiasParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.bias_param) + return bias_param_; +} +inline ::caffe::BiasParameter* LayerParameter::release_bias_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.bias_param) + clear_has_bias_param(); + ::caffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_bias_param(::caffe::BiasParameter* bias_param) { + delete bias_param_; + bias_param_ = bias_param; + if (bias_param) { + set_has_bias_param(); + } else { + clear_has_bias_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.bias_param) +} + +// optional .caffe.ConcatParameter concat_param = 104; +inline bool LayerParameter::has_concat_param() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void LayerParameter::set_has_concat_param() { + _has_bits_[0] |= 0x00020000u; +} +inline void LayerParameter::clear_has_concat_param() { + _has_bits_[0] &= ~0x00020000u; +} +inline void LayerParameter::clear_concat_param() { + if (concat_param_ != NULL) concat_param_->::caffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::caffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ + : *::caffe::ConcatParameter::internal_default_instance(); +} +inline ::caffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::caffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.concat_param) + return concat_param_; +} +inline ::caffe::ConcatParameter* LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.concat_param) + clear_has_concat_param(); + ::caffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_concat_param(::caffe::ConcatParameter* concat_param) { + delete concat_param_; + concat_param_ = concat_param; + if (concat_param) { + set_has_concat_param(); + } else { + clear_has_concat_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.concat_param) +} + +// optional .caffe.ContrastiveLossParameter contrastive_loss_param = 105; +inline bool LayerParameter::has_contrastive_loss_param() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void LayerParameter::set_has_contrastive_loss_param() { + _has_bits_[0] |= 0x00040000u; +} +inline void LayerParameter::clear_has_contrastive_loss_param() { + _has_bits_[0] &= ~0x00040000u; +} +inline void LayerParameter::clear_contrastive_loss_param() { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::caffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::caffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ + : *::caffe::ContrastiveLossParameter::internal_default_instance(); +} +inline ::caffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::caffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::caffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::caffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_contrastive_loss_param(::caffe::ContrastiveLossParameter* contrastive_loss_param) { + delete contrastive_loss_param_; + contrastive_loss_param_ = contrastive_loss_param; + if (contrastive_loss_param) { + set_has_contrastive_loss_param(); + } else { + clear_has_contrastive_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.contrastive_loss_param) +} + +// optional .caffe.ConvolutionParameter convolution_param = 106; +inline bool LayerParameter::has_convolution_param() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +inline void LayerParameter::set_has_convolution_param() { + _has_bits_[0] |= 0x00080000u; +} +inline void LayerParameter::clear_has_convolution_param() { + _has_bits_[0] &= ~0x00080000u; +} +inline void LayerParameter::clear_convolution_param() { + if (convolution_param_ != NULL) convolution_param_->::caffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::caffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ + : *::caffe::ConvolutionParameter::internal_default_instance(); +} +inline ::caffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::caffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.convolution_param) + return convolution_param_; +} +inline ::caffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.convolution_param) + clear_has_convolution_param(); + ::caffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_convolution_param(::caffe::ConvolutionParameter* convolution_param) { + delete convolution_param_; + convolution_param_ = convolution_param; + if (convolution_param) { + set_has_convolution_param(); + } else { + clear_has_convolution_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.convolution_param) +} + +// optional .caffe.CropParameter crop_param = 144; +inline bool LayerParameter::has_crop_param() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +inline void LayerParameter::set_has_crop_param() { + _has_bits_[0] |= 0x00100000u; +} +inline void LayerParameter::clear_has_crop_param() { + _has_bits_[0] &= ~0x00100000u; +} +inline void LayerParameter::clear_crop_param() { + if (crop_param_ != NULL) crop_param_->::caffe::CropParameter::Clear(); + clear_has_crop_param(); +} +inline const ::caffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.crop_param) + return crop_param_ != NULL ? *crop_param_ + : *::caffe::CropParameter::internal_default_instance(); +} +inline ::caffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) { + crop_param_ = new ::caffe::CropParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.crop_param) + return crop_param_; +} +inline ::caffe::CropParameter* LayerParameter::release_crop_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.crop_param) + clear_has_crop_param(); + ::caffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_crop_param(::caffe::CropParameter* crop_param) { + delete crop_param_; + crop_param_ = crop_param; + if (crop_param) { + set_has_crop_param(); + } else { + clear_has_crop_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.crop_param) +} + +// optional .caffe.DataParameter data_param = 107; +inline bool LayerParameter::has_data_param() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +inline void LayerParameter::set_has_data_param() { + _has_bits_[0] |= 0x00200000u; +} +inline void LayerParameter::clear_has_data_param() { + _has_bits_[0] &= ~0x00200000u; +} +inline void LayerParameter::clear_data_param() { + if (data_param_ != NULL) data_param_->::caffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::caffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ + : *::caffe::DataParameter::internal_default_instance(); +} +inline ::caffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::caffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.data_param) + return data_param_; +} +inline ::caffe::DataParameter* LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.data_param) + clear_has_data_param(); + ::caffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_data_param(::caffe::DataParameter* data_param) { + delete data_param_; + data_param_ = data_param; + if (data_param) { + set_has_data_param(); + } else { + clear_has_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.data_param) +} + +// optional .caffe.DetectionOutputParameter detection_output_param = 147; +inline bool LayerParameter::has_detection_output_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_detection_output_param() { + _has_bits_[0] |= 0x00400000u; +} +inline void LayerParameter::clear_has_detection_output_param() { + _has_bits_[0] &= ~0x00400000u; +} +inline void LayerParameter::clear_detection_output_param() { + if (detection_output_param_ != NULL) detection_output_param_->::caffe::DetectionOutputParameter::Clear(); + clear_has_detection_output_param(); +} +inline const ::caffe::DetectionOutputParameter& LayerParameter::detection_output_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.detection_output_param) + return detection_output_param_ != NULL ? *detection_output_param_ + : *::caffe::DetectionOutputParameter::internal_default_instance(); +} +inline ::caffe::DetectionOutputParameter* LayerParameter::mutable_detection_output_param() { + set_has_detection_output_param(); + if (detection_output_param_ == NULL) { + detection_output_param_ = new ::caffe::DetectionOutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.detection_output_param) + return detection_output_param_; +} +inline ::caffe::DetectionOutputParameter* LayerParameter::release_detection_output_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.detection_output_param) + clear_has_detection_output_param(); + ::caffe::DetectionOutputParameter* temp = detection_output_param_; + detection_output_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_detection_output_param(::caffe::DetectionOutputParameter* detection_output_param) { + delete detection_output_param_; + detection_output_param_ = detection_output_param; + if (detection_output_param) { + set_has_detection_output_param(); + } else { + clear_has_detection_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.detection_output_param) +} + +// optional .caffe.DropoutParameter dropout_param = 108; +inline bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00800000u; +} +inline void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00800000u; +} +inline void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::caffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::caffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ + : *::caffe::DropoutParameter::internal_default_instance(); +} +inline ::caffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::caffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.dropout_param) + return dropout_param_; +} +inline ::caffe::DropoutParameter* LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.dropout_param) + clear_has_dropout_param(); + ::caffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dropout_param(::caffe::DropoutParameter* dropout_param) { + delete dropout_param_; + dropout_param_ = dropout_param; + if (dropout_param) { + set_has_dropout_param(); + } else { + clear_has_dropout_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.dropout_param) +} + +// optional .caffe.DummyDataParameter dummy_data_param = 109; +inline bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x01000000u; +} +inline void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x01000000u; +} +inline void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::caffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::caffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ + : *::caffe::DummyDataParameter::internal_default_instance(); +} +inline ::caffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::caffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::caffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::caffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dummy_data_param(::caffe::DummyDataParameter* dummy_data_param) { + delete dummy_data_param_; + dummy_data_param_ = dummy_data_param; + if (dummy_data_param) { + set_has_dummy_data_param(); + } else { + clear_has_dummy_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.dummy_data_param) +} + +// optional .caffe.EltwiseParameter eltwise_param = 110; +inline bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x02000000u; +} +inline void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x02000000u; +} +inline void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::caffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::caffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ + : *::caffe::EltwiseParameter::internal_default_instance(); +} +inline ::caffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::caffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::caffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::caffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_eltwise_param(::caffe::EltwiseParameter* eltwise_param) { + delete eltwise_param_; + eltwise_param_ = eltwise_param; + if (eltwise_param) { + set_has_eltwise_param(); + } else { + clear_has_eltwise_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.eltwise_param) +} + +// optional .caffe.ELUParameter elu_param = 140; +inline bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x04000000u; +} +inline void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x04000000u; +} +inline void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::caffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +inline const ::caffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.elu_param) + return elu_param_ != NULL ? *elu_param_ + : *::caffe::ELUParameter::internal_default_instance(); +} +inline ::caffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) { + elu_param_ = new ::caffe::ELUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.elu_param) + return elu_param_; +} +inline ::caffe::ELUParameter* LayerParameter::release_elu_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.elu_param) + clear_has_elu_param(); + ::caffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_elu_param(::caffe::ELUParameter* elu_param) { + delete elu_param_; + elu_param_ = elu_param; + if (elu_param) { + set_has_elu_param(); + } else { + clear_has_elu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.elu_param) +} + +// optional .caffe.EmbedParameter embed_param = 137; +inline bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x08000000u; +} +inline void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x08000000u; +} +inline void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::caffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +inline const ::caffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.embed_param) + return embed_param_ != NULL ? *embed_param_ + : *::caffe::EmbedParameter::internal_default_instance(); +} +inline ::caffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) { + embed_param_ = new ::caffe::EmbedParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.embed_param) + return embed_param_; +} +inline ::caffe::EmbedParameter* LayerParameter::release_embed_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.embed_param) + clear_has_embed_param(); + ::caffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_embed_param(::caffe::EmbedParameter* embed_param) { + delete embed_param_; + embed_param_ = embed_param; + if (embed_param) { + set_has_embed_param(); + } else { + clear_has_embed_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.embed_param) +} + +// optional .caffe.ExpParameter exp_param = 111; +inline bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x10000000u; +} +inline void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x10000000u; +} +inline void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::caffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::caffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ + : *::caffe::ExpParameter::internal_default_instance(); +} +inline ::caffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::caffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.exp_param) + return exp_param_; +} +inline ::caffe::ExpParameter* LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.exp_param) + clear_has_exp_param(); + ::caffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_exp_param(::caffe::ExpParameter* exp_param) { + delete exp_param_; + exp_param_ = exp_param; + if (exp_param) { + set_has_exp_param(); + } else { + clear_has_exp_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.exp_param) +} + +// optional .caffe.FlattenParameter flatten_param = 135; +inline bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x20000000u; +} +inline void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x20000000u; +} +inline void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::caffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +inline const ::caffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.flatten_param) + return flatten_param_ != NULL ? *flatten_param_ + : *::caffe::FlattenParameter::internal_default_instance(); +} +inline ::caffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) { + flatten_param_ = new ::caffe::FlattenParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.flatten_param) + return flatten_param_; +} +inline ::caffe::FlattenParameter* LayerParameter::release_flatten_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.flatten_param) + clear_has_flatten_param(); + ::caffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_flatten_param(::caffe::FlattenParameter* flatten_param) { + delete flatten_param_; + flatten_param_ = flatten_param; + if (flatten_param) { + set_has_flatten_param(); + } else { + clear_has_flatten_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.flatten_param) +} + +// optional .caffe.HDF5DataParameter hdf5_data_param = 112; +inline bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x40000000u; +} +inline void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x40000000u; +} +inline void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::caffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::caffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ + : *::caffe::HDF5DataParameter::internal_default_instance(); +} +inline ::caffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::caffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::caffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::caffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_data_param(::caffe::HDF5DataParameter* hdf5_data_param) { + delete hdf5_data_param_; + hdf5_data_param_ = hdf5_data_param; + if (hdf5_data_param) { + set_has_hdf5_data_param(); + } else { + clear_has_hdf5_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.hdf5_data_param) +} + +// optional .caffe.HDF5OutputParameter hdf5_output_param = 113; +inline bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x80000000u; +} +inline void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x80000000u; +} +inline void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::caffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ + : *::caffe::HDF5OutputParameter::internal_default_instance(); +} +inline ::caffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::caffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::caffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::caffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param) { + delete hdf5_output_param_; + hdf5_output_param_ = hdf5_output_param; + if (hdf5_output_param) { + set_has_hdf5_output_param(); + } else { + clear_has_hdf5_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.hdf5_output_param) +} + +// optional .caffe.HingeLossParameter hinge_loss_param = 114; +inline bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[1] |= 0x00000001u; +} +inline void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[1] &= ~0x00000001u; +} +inline void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::caffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::caffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ + : *::caffe::HingeLossParameter::internal_default_instance(); +} +inline ::caffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::caffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::caffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::caffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hinge_loss_param(::caffe::HingeLossParameter* hinge_loss_param) { + delete hinge_loss_param_; + hinge_loss_param_ = hinge_loss_param; + if (hinge_loss_param) { + set_has_hinge_loss_param(); + } else { + clear_has_hinge_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.hinge_loss_param) +} + +// optional .caffe.ImageDataParameter image_data_param = 115; +inline bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::caffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::caffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ + : *::caffe::ImageDataParameter::internal_default_instance(); +} +inline ::caffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::caffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.image_data_param) + return image_data_param_; +} +inline ::caffe::ImageDataParameter* LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.image_data_param) + clear_has_image_data_param(); + ::caffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_image_data_param(::caffe::ImageDataParameter* image_data_param) { + delete image_data_param_; + image_data_param_ = image_data_param; + if (image_data_param) { + set_has_image_data_param(); + } else { + clear_has_image_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.image_data_param) +} + +// optional .caffe.InfogainLossParameter infogain_loss_param = 116; +inline bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000004u; +} +inline void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000004u; +} +inline void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::caffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::caffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ + : *::caffe::InfogainLossParameter::internal_default_instance(); +} +inline ::caffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::caffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::caffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::caffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_infogain_loss_param(::caffe::InfogainLossParameter* infogain_loss_param) { + delete infogain_loss_param_; + infogain_loss_param_ = infogain_loss_param; + if (infogain_loss_param) { + set_has_infogain_loss_param(); + } else { + clear_has_infogain_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.infogain_loss_param) +} + +// optional .caffe.InnerProductParameter inner_product_param = 117; +inline bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000008u; +} +inline void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000008u; +} +inline void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::caffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::caffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ + : *::caffe::InnerProductParameter::internal_default_instance(); +} +inline ::caffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::caffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::caffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::caffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_inner_product_param(::caffe::InnerProductParameter* inner_product_param) { + delete inner_product_param_; + inner_product_param_ = inner_product_param; + if (inner_product_param) { + set_has_inner_product_param(); + } else { + clear_has_inner_product_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.inner_product_param) +} + +// optional .caffe.InputParameter input_param = 143; +inline bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000010u; +} +inline void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000010u; +} +inline void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::caffe::InputParameter::Clear(); + clear_has_input_param(); +} +inline const ::caffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.input_param) + return input_param_ != NULL ? *input_param_ + : *::caffe::InputParameter::internal_default_instance(); +} +inline ::caffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) { + input_param_ = new ::caffe::InputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.input_param) + return input_param_; +} +inline ::caffe::InputParameter* LayerParameter::release_input_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.input_param) + clear_has_input_param(); + ::caffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_input_param(::caffe::InputParameter* input_param) { + delete input_param_; + input_param_ = input_param; + if (input_param) { + set_has_input_param(); + } else { + clear_has_input_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.input_param) +} + +// optional .caffe.LogParameter log_param = 134; +inline bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::caffe::LogParameter::Clear(); + clear_has_log_param(); +} +inline const ::caffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.log_param) + return log_param_ != NULL ? *log_param_ + : *::caffe::LogParameter::internal_default_instance(); +} +inline ::caffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) { + log_param_ = new ::caffe::LogParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.log_param) + return log_param_; +} +inline ::caffe::LogParameter* LayerParameter::release_log_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.log_param) + clear_has_log_param(); + ::caffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_log_param(::caffe::LogParameter* log_param) { + delete log_param_; + log_param_ = log_param; + if (log_param) { + set_has_log_param(); + } else { + clear_has_log_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.log_param) +} + +// optional .caffe.LRNParameter lrn_param = 118; +inline bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000040u; +} +inline void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000040u; +} +inline void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::caffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::caffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ + : *::caffe::LRNParameter::internal_default_instance(); +} +inline ::caffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::caffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.lrn_param) + return lrn_param_; +} +inline ::caffe::LRNParameter* LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.lrn_param) + clear_has_lrn_param(); + ::caffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_lrn_param(::caffe::LRNParameter* lrn_param) { + delete lrn_param_; + lrn_param_ = lrn_param; + if (lrn_param) { + set_has_lrn_param(); + } else { + clear_has_lrn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.lrn_param) +} + +// optional .caffe.MemoryDataParameter memory_data_param = 119; +inline bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000080u; +} +inline void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000080u; +} +inline void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::caffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::caffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ + : *::caffe::MemoryDataParameter::internal_default_instance(); +} +inline ::caffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::caffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::caffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::caffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_memory_data_param(::caffe::MemoryDataParameter* memory_data_param) { + delete memory_data_param_; + memory_data_param_ = memory_data_param; + if (memory_data_param) { + set_has_memory_data_param(); + } else { + clear_has_memory_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.memory_data_param) +} + +// optional .caffe.MVNParameter mvn_param = 120; +inline bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000100u; +} +inline void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000100u; +} +inline void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::caffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::caffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ + : *::caffe::MVNParameter::internal_default_instance(); +} +inline ::caffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::caffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.mvn_param) + return mvn_param_; +} +inline ::caffe::MVNParameter* LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.mvn_param) + clear_has_mvn_param(); + ::caffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_mvn_param(::caffe::MVNParameter* mvn_param) { + delete mvn_param_; + mvn_param_ = mvn_param; + if (mvn_param) { + set_has_mvn_param(); + } else { + clear_has_mvn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.mvn_param) +} + +// optional .caffe.NormalizeBBoxParameter norm_param = 149; +inline bool LayerParameter::has_norm_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void LayerParameter::set_has_norm_param() { + _has_bits_[1] |= 0x00000200u; +} +inline void LayerParameter::clear_has_norm_param() { + _has_bits_[1] &= ~0x00000200u; +} +inline void LayerParameter::clear_norm_param() { + if (norm_param_ != NULL) norm_param_->::caffe::NormalizeBBoxParameter::Clear(); + clear_has_norm_param(); +} +inline const ::caffe::NormalizeBBoxParameter& LayerParameter::norm_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.norm_param) + return norm_param_ != NULL ? *norm_param_ + : *::caffe::NormalizeBBoxParameter::internal_default_instance(); +} +inline ::caffe::NormalizeBBoxParameter* LayerParameter::mutable_norm_param() { + set_has_norm_param(); + if (norm_param_ == NULL) { + norm_param_ = new ::caffe::NormalizeBBoxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.norm_param) + return norm_param_; +} +inline ::caffe::NormalizeBBoxParameter* LayerParameter::release_norm_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.norm_param) + clear_has_norm_param(); + ::caffe::NormalizeBBoxParameter* temp = norm_param_; + norm_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_norm_param(::caffe::NormalizeBBoxParameter* norm_param) { + delete norm_param_; + norm_param_ = norm_param; + if (norm_param) { + set_has_norm_param(); + } else { + clear_has_norm_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.norm_param) +} + +// optional .caffe.PermuteParameter permute_param = 148; +inline bool LayerParameter::has_permute_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void LayerParameter::set_has_permute_param() { + _has_bits_[1] |= 0x00000400u; +} +inline void LayerParameter::clear_has_permute_param() { + _has_bits_[1] &= ~0x00000400u; +} +inline void LayerParameter::clear_permute_param() { + if (permute_param_ != NULL) permute_param_->::caffe::PermuteParameter::Clear(); + clear_has_permute_param(); +} +inline const ::caffe::PermuteParameter& LayerParameter::permute_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.permute_param) + return permute_param_ != NULL ? *permute_param_ + : *::caffe::PermuteParameter::internal_default_instance(); +} +inline ::caffe::PermuteParameter* LayerParameter::mutable_permute_param() { + set_has_permute_param(); + if (permute_param_ == NULL) { + permute_param_ = new ::caffe::PermuteParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.permute_param) + return permute_param_; +} +inline ::caffe::PermuteParameter* LayerParameter::release_permute_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.permute_param) + clear_has_permute_param(); + ::caffe::PermuteParameter* temp = permute_param_; + permute_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_permute_param(::caffe::PermuteParameter* permute_param) { + delete permute_param_; + permute_param_ = permute_param; + if (permute_param) { + set_has_permute_param(); + } else { + clear_has_permute_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.permute_param) +} + +// optional .caffe.ParameterParameter parameter_param = 145; +inline bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +inline void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000800u; +} +inline void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000800u; +} +inline void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::caffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +inline const ::caffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.parameter_param) + return parameter_param_ != NULL ? *parameter_param_ + : *::caffe::ParameterParameter::internal_default_instance(); +} +inline ::caffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) { + parameter_param_ = new ::caffe::ParameterParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.parameter_param) + return parameter_param_; +} +inline ::caffe::ParameterParameter* LayerParameter::release_parameter_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.parameter_param) + clear_has_parameter_param(); + ::caffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_parameter_param(::caffe::ParameterParameter* parameter_param) { + delete parameter_param_; + parameter_param_ = parameter_param; + if (parameter_param) { + set_has_parameter_param(); + } else { + clear_has_parameter_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.parameter_param) +} + +// optional .caffe.PoolingParameter pooling_param = 121; +inline bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +inline void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00001000u; +} +inline void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00001000u; +} +inline void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::caffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::caffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ + : *::caffe::PoolingParameter::internal_default_instance(); +} +inline ::caffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::caffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.pooling_param) + return pooling_param_; +} +inline ::caffe::PoolingParameter* LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.pooling_param) + clear_has_pooling_param(); + ::caffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_pooling_param(::caffe::PoolingParameter* pooling_param) { + delete pooling_param_; + pooling_param_ = pooling_param; + if (pooling_param) { + set_has_pooling_param(); + } else { + clear_has_pooling_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.pooling_param) +} + +// optional .caffe.PowerParameter power_param = 122; +inline bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +inline void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00002000u; +} +inline void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00002000u; +} +inline void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::caffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ + : *::caffe::PowerParameter::internal_default_instance(); +} +inline ::caffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::caffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.power_param) + return power_param_; +} +inline ::caffe::PowerParameter* LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.power_param) + clear_has_power_param(); + ::caffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_power_param(::caffe::PowerParameter* power_param) { + delete power_param_; + power_param_ = power_param; + if (power_param) { + set_has_power_param(); + } else { + clear_has_power_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.power_param) +} + +// optional .caffe.PReLUParameter prelu_param = 131; +inline bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +inline void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00004000u; +} +inline void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00004000u; +} +inline void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::caffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +inline const ::caffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.prelu_param) + return prelu_param_ != NULL ? *prelu_param_ + : *::caffe::PReLUParameter::internal_default_instance(); +} +inline ::caffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) { + prelu_param_ = new ::caffe::PReLUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.prelu_param) + return prelu_param_; +} +inline ::caffe::PReLUParameter* LayerParameter::release_prelu_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.prelu_param) + clear_has_prelu_param(); + ::caffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prelu_param(::caffe::PReLUParameter* prelu_param) { + delete prelu_param_; + prelu_param_ = prelu_param; + if (prelu_param) { + set_has_prelu_param(); + } else { + clear_has_prelu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.prelu_param) +} + +// optional .caffe.PriorBoxParameter prior_box_param = 150; +inline bool LayerParameter::has_prior_box_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +inline void LayerParameter::set_has_prior_box_param() { + _has_bits_[1] |= 0x00008000u; +} +inline void LayerParameter::clear_has_prior_box_param() { + _has_bits_[1] &= ~0x00008000u; +} +inline void LayerParameter::clear_prior_box_param() { + if (prior_box_param_ != NULL) prior_box_param_->::caffe::PriorBoxParameter::Clear(); + clear_has_prior_box_param(); +} +inline const ::caffe::PriorBoxParameter& LayerParameter::prior_box_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.prior_box_param) + return prior_box_param_ != NULL ? *prior_box_param_ + : *::caffe::PriorBoxParameter::internal_default_instance(); +} +inline ::caffe::PriorBoxParameter* LayerParameter::mutable_prior_box_param() { + set_has_prior_box_param(); + if (prior_box_param_ == NULL) { + prior_box_param_ = new ::caffe::PriorBoxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.prior_box_param) + return prior_box_param_; +} +inline ::caffe::PriorBoxParameter* LayerParameter::release_prior_box_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.prior_box_param) + clear_has_prior_box_param(); + ::caffe::PriorBoxParameter* temp = prior_box_param_; + prior_box_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prior_box_param(::caffe::PriorBoxParameter* prior_box_param) { + delete prior_box_param_; + prior_box_param_ = prior_box_param; + if (prior_box_param) { + set_has_prior_box_param(); + } else { + clear_has_prior_box_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.prior_box_param) +} + +// optional .caffe.PythonParameter python_param = 130; +inline bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +inline void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00010000u; +} +inline void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00010000u; +} +inline void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::caffe::PythonParameter::Clear(); + clear_has_python_param(); +} +inline const ::caffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.python_param) + return python_param_ != NULL ? *python_param_ + : *::caffe::PythonParameter::internal_default_instance(); +} +inline ::caffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) { + python_param_ = new ::caffe::PythonParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.python_param) + return python_param_; +} +inline ::caffe::PythonParameter* LayerParameter::release_python_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.python_param) + clear_has_python_param(); + ::caffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_python_param(::caffe::PythonParameter* python_param) { + delete python_param_; + python_param_ = python_param; + if (python_param) { + set_has_python_param(); + } else { + clear_has_python_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.python_param) +} + +// optional .caffe.RecurrentParameter recurrent_param = 146; +inline bool LayerParameter::has_recurrent_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +inline void LayerParameter::set_has_recurrent_param() { + _has_bits_[1] |= 0x00020000u; +} +inline void LayerParameter::clear_has_recurrent_param() { + _has_bits_[1] &= ~0x00020000u; +} +inline void LayerParameter::clear_recurrent_param() { + if (recurrent_param_ != NULL) recurrent_param_->::caffe::RecurrentParameter::Clear(); + clear_has_recurrent_param(); +} +inline const ::caffe::RecurrentParameter& LayerParameter::recurrent_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.recurrent_param) + return recurrent_param_ != NULL ? *recurrent_param_ + : *::caffe::RecurrentParameter::internal_default_instance(); +} +inline ::caffe::RecurrentParameter* LayerParameter::mutable_recurrent_param() { + set_has_recurrent_param(); + if (recurrent_param_ == NULL) { + recurrent_param_ = new ::caffe::RecurrentParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.recurrent_param) + return recurrent_param_; +} +inline ::caffe::RecurrentParameter* LayerParameter::release_recurrent_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.recurrent_param) + clear_has_recurrent_param(); + ::caffe::RecurrentParameter* temp = recurrent_param_; + recurrent_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_recurrent_param(::caffe::RecurrentParameter* recurrent_param) { + delete recurrent_param_; + recurrent_param_ = recurrent_param; + if (recurrent_param) { + set_has_recurrent_param(); + } else { + clear_has_recurrent_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.recurrent_param) +} + +// optional .caffe.ReductionParameter reduction_param = 136; +inline bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +inline void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00040000u; +} +inline void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00040000u; +} +inline void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::caffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +inline const ::caffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.reduction_param) + return reduction_param_ != NULL ? *reduction_param_ + : *::caffe::ReductionParameter::internal_default_instance(); +} +inline ::caffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) { + reduction_param_ = new ::caffe::ReductionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.reduction_param) + return reduction_param_; +} +inline ::caffe::ReductionParameter* LayerParameter::release_reduction_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.reduction_param) + clear_has_reduction_param(); + ::caffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reduction_param(::caffe::ReductionParameter* reduction_param) { + delete reduction_param_; + reduction_param_ = reduction_param; + if (reduction_param) { + set_has_reduction_param(); + } else { + clear_has_reduction_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.reduction_param) +} + +// optional .caffe.ReLUParameter relu_param = 123; +inline bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +inline void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00080000u; +} +inline void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00080000u; +} +inline void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::caffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ + : *::caffe::ReLUParameter::internal_default_instance(); +} +inline ::caffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::caffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.relu_param) + return relu_param_; +} +inline ::caffe::ReLUParameter* LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.relu_param) + clear_has_relu_param(); + ::caffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_relu_param(::caffe::ReLUParameter* relu_param) { + delete relu_param_; + relu_param_ = relu_param; + if (relu_param) { + set_has_relu_param(); + } else { + clear_has_relu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.relu_param) +} + +// optional .caffe.ReshapeParameter reshape_param = 133; +inline bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +inline void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00100000u; +} +inline void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00100000u; +} +inline void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::caffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +inline const ::caffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.reshape_param) + return reshape_param_ != NULL ? *reshape_param_ + : *::caffe::ReshapeParameter::internal_default_instance(); +} +inline ::caffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) { + reshape_param_ = new ::caffe::ReshapeParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.reshape_param) + return reshape_param_; +} +inline ::caffe::ReshapeParameter* LayerParameter::release_reshape_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.reshape_param) + clear_has_reshape_param(); + ::caffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reshape_param(::caffe::ReshapeParameter* reshape_param) { + delete reshape_param_; + reshape_param_ = reshape_param; + if (reshape_param) { + set_has_reshape_param(); + } else { + clear_has_reshape_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.reshape_param) +} + +// optional .caffe.ScaleParameter scale_param = 142; +inline bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +inline void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00200000u; +} +inline void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00200000u; +} +inline void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::caffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +inline const ::caffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.scale_param) + return scale_param_ != NULL ? *scale_param_ + : *::caffe::ScaleParameter::internal_default_instance(); +} +inline ::caffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) { + scale_param_ = new ::caffe::ScaleParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.scale_param) + return scale_param_; +} +inline ::caffe::ScaleParameter* LayerParameter::release_scale_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.scale_param) + clear_has_scale_param(); + ::caffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_scale_param(::caffe::ScaleParameter* scale_param) { + delete scale_param_; + scale_param_ = scale_param; + if (scale_param) { + set_has_scale_param(); + } else { + clear_has_scale_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.scale_param) +} + +// optional .caffe.SigmoidParameter sigmoid_param = 124; +inline bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00400000u; +} +inline void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00400000u; +} +inline void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::caffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ + : *::caffe::SigmoidParameter::internal_default_instance(); +} +inline ::caffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::caffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::caffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::caffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_sigmoid_param(::caffe::SigmoidParameter* sigmoid_param) { + delete sigmoid_param_; + sigmoid_param_ = sigmoid_param; + if (sigmoid_param) { + set_has_sigmoid_param(); + } else { + clear_has_sigmoid_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.sigmoid_param) +} + +// optional .caffe.SoftmaxParameter softmax_param = 125; +inline bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00800000u; +} +inline void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00800000u; +} +inline void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::caffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ + : *::caffe::SoftmaxParameter::internal_default_instance(); +} +inline ::caffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::caffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.softmax_param) + return softmax_param_; +} +inline ::caffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.softmax_param) + clear_has_softmax_param(); + ::caffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_softmax_param(::caffe::SoftmaxParameter* softmax_param) { + delete softmax_param_; + softmax_param_ = softmax_param; + if (softmax_param) { + set_has_softmax_param(); + } else { + clear_has_softmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.softmax_param) +} + +// optional .caffe.SPPParameter spp_param = 132; +inline bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x01000000u; +} +inline void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x01000000u; +} +inline void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::caffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +inline const ::caffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.spp_param) + return spp_param_ != NULL ? *spp_param_ + : *::caffe::SPPParameter::internal_default_instance(); +} +inline ::caffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) { + spp_param_ = new ::caffe::SPPParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.spp_param) + return spp_param_; +} +inline ::caffe::SPPParameter* LayerParameter::release_spp_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.spp_param) + clear_has_spp_param(); + ::caffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_spp_param(::caffe::SPPParameter* spp_param) { + delete spp_param_; + spp_param_ = spp_param; + if (spp_param) { + set_has_spp_param(); + } else { + clear_has_spp_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.spp_param) +} + +// optional .caffe.SliceParameter slice_param = 126; +inline bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x02000000u) != 0; +} +inline void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x02000000u; +} +inline void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x02000000u; +} +inline void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::caffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ + : *::caffe::SliceParameter::internal_default_instance(); +} +inline ::caffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::caffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.slice_param) + return slice_param_; +} +inline ::caffe::SliceParameter* LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.slice_param) + clear_has_slice_param(); + ::caffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_slice_param(::caffe::SliceParameter* slice_param) { + delete slice_param_; + slice_param_ = slice_param; + if (slice_param) { + set_has_slice_param(); + } else { + clear_has_slice_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.slice_param) +} + +// optional .caffe.TanHParameter tanh_param = 127; +inline bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x04000000u) != 0; +} +inline void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x04000000u; +} +inline void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x04000000u; +} +inline void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::caffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ + : *::caffe::TanHParameter::internal_default_instance(); +} +inline ::caffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::caffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.tanh_param) + return tanh_param_; +} +inline ::caffe::TanHParameter* LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.tanh_param) + clear_has_tanh_param(); + ::caffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tanh_param(::caffe::TanHParameter* tanh_param) { + delete tanh_param_; + tanh_param_ = tanh_param; + if (tanh_param) { + set_has_tanh_param(); + } else { + clear_has_tanh_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.tanh_param) +} + +// optional .caffe.ThresholdParameter threshold_param = 128; +inline bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x08000000u) != 0; +} +inline void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x08000000u; +} +inline void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x08000000u; +} +inline void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::caffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ + : *::caffe::ThresholdParameter::internal_default_instance(); +} +inline ::caffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::caffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.threshold_param) + return threshold_param_; +} +inline ::caffe::ThresholdParameter* LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.threshold_param) + clear_has_threshold_param(); + ::caffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_threshold_param(::caffe::ThresholdParameter* threshold_param) { + delete threshold_param_; + threshold_param_ = threshold_param; + if (threshold_param) { + set_has_threshold_param(); + } else { + clear_has_threshold_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.threshold_param) +} + +// optional .caffe.TileParameter tile_param = 138; +inline bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x10000000u) != 0; +} +inline void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x10000000u; +} +inline void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x10000000u; +} +inline void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::caffe::TileParameter::Clear(); + clear_has_tile_param(); +} +inline const ::caffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.tile_param) + return tile_param_ != NULL ? *tile_param_ + : *::caffe::TileParameter::internal_default_instance(); +} +inline ::caffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) { + tile_param_ = new ::caffe::TileParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.tile_param) + return tile_param_; +} +inline ::caffe::TileParameter* LayerParameter::release_tile_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.tile_param) + clear_has_tile_param(); + ::caffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tile_param(::caffe::TileParameter* tile_param) { + delete tile_param_; + tile_param_ = tile_param; + if (tile_param) { + set_has_tile_param(); + } else { + clear_has_tile_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.tile_param) +} + +// optional .caffe.WindowDataParameter window_data_param = 129; +inline bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x20000000u) != 0; +} +inline void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x20000000u; +} +inline void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x20000000u; +} +inline void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::caffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:caffe.LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ + : *::caffe::WindowDataParameter::internal_default_instance(); +} +inline ::caffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::caffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.LayerParameter.window_data_param) + return window_data_param_; +} +inline ::caffe::WindowDataParameter* LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:caffe.LayerParameter.window_data_param) + clear_has_window_data_param(); + ::caffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_window_data_param(::caffe::WindowDataParameter* window_data_param) { + delete window_data_param_; + window_data_param_ = window_data_param; + if (window_data_param) { + set_has_window_data_param(); + } else { + clear_has_window_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.LayerParameter.window_data_param) +} + +inline const LayerParameter* LayerParameter::internal_default_instance() { + return &LayerParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// TransformationParameter + +// optional float scale = 1 [default = 1]; +inline bool TransformationParameter::has_scale() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TransformationParameter::set_has_scale() { + _has_bits_[0] |= 0x00000001u; +} +inline void TransformationParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TransformationParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float TransformationParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.scale) + return scale_; +} +inline void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.scale) +} + +// optional bool mirror = 2 [default = false]; +inline bool TransformationParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void TransformationParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000002u; +} +inline void TransformationParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000002u; +} +inline void TransformationParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +inline bool TransformationParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.mirror) + return mirror_; +} +inline void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.mirror) +} + +// optional uint32 crop_size = 3 [default = 0]; +inline bool TransformationParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void TransformationParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000004u; +} +inline void TransformationParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000004u; +} +inline void TransformationParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +inline ::google::protobuf::uint32 TransformationParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.crop_size) + return crop_size_; +} +inline void TransformationParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.crop_size) +} + +// optional string mean_file = 4; +inline bool TransformationParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void TransformationParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000008u; +} +inline void TransformationParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000008u; +} +inline void TransformationParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +inline const ::std::string& TransformationParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TransformationParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.mean_file) +} +inline void TransformationParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.TransformationParameter.mean_file) +} +inline void TransformationParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.TransformationParameter.mean_file) +} +inline ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.TransformationParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TransformationParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.TransformationParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TransformationParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.TransformationParameter.mean_file) +} + +// repeated float mean_value = 5; +inline int TransformationParameter::mean_value_size() const { + return mean_value_.size(); +} +inline void TransformationParameter::clear_mean_value() { + mean_value_.Clear(); +} +inline float TransformationParameter::mean_value(int index) const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.mean_value) + return mean_value_.Get(index); +} +inline void TransformationParameter::set_mean_value(int index, float value) { + mean_value_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.mean_value) +} +inline void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:caffe.TransformationParameter.mean_value) +} +inline const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:caffe.TransformationParameter.mean_value) + return mean_value_; +} +inline ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:caffe.TransformationParameter.mean_value) + return &mean_value_; +} + +// optional bool force_color = 6 [default = false]; +inline bool TransformationParameter::has_force_color() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void TransformationParameter::set_has_force_color() { + _has_bits_[0] |= 0x00000020u; +} +inline void TransformationParameter::clear_has_force_color() { + _has_bits_[0] &= ~0x00000020u; +} +inline void TransformationParameter::clear_force_color() { + force_color_ = false; + clear_has_force_color(); +} +inline bool TransformationParameter::force_color() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.force_color) + return force_color_; +} +inline void TransformationParameter::set_force_color(bool value) { + set_has_force_color(); + force_color_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.force_color) +} + +// optional bool force_gray = 7 [default = false]; +inline bool TransformationParameter::has_force_gray() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void TransformationParameter::set_has_force_gray() { + _has_bits_[0] |= 0x00000040u; +} +inline void TransformationParameter::clear_has_force_gray() { + _has_bits_[0] &= ~0x00000040u; +} +inline void TransformationParameter::clear_force_gray() { + force_gray_ = false; + clear_has_force_gray(); +} +inline bool TransformationParameter::force_gray() const { + // @@protoc_insertion_point(field_get:caffe.TransformationParameter.force_gray) + return force_gray_; +} +inline void TransformationParameter::set_force_gray(bool value) { + set_has_force_gray(); + force_gray_ = value; + // @@protoc_insertion_point(field_set:caffe.TransformationParameter.force_gray) +} + +inline const TransformationParameter* TransformationParameter::internal_default_instance() { + return &TransformationParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// LossParameter + +// optional int32 ignore_label = 1; +inline bool LossParameter::has_ignore_label() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void LossParameter::set_has_ignore_label() { + _has_bits_[0] |= 0x00000001u; +} +inline void LossParameter::clear_has_ignore_label() { + _has_bits_[0] &= ~0x00000001u; +} +inline void LossParameter::clear_ignore_label() { + ignore_label_ = 0; + clear_has_ignore_label(); +} +inline ::google::protobuf::int32 LossParameter::ignore_label() const { + // @@protoc_insertion_point(field_get:caffe.LossParameter.ignore_label) + return ignore_label_; +} +inline void LossParameter::set_ignore_label(::google::protobuf::int32 value) { + set_has_ignore_label(); + ignore_label_ = value; + // @@protoc_insertion_point(field_set:caffe.LossParameter.ignore_label) +} + +// optional .caffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; +inline bool LossParameter::has_normalization() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void LossParameter::set_has_normalization() { + _has_bits_[0] |= 0x00000002u; +} +inline void LossParameter::clear_has_normalization() { + _has_bits_[0] &= ~0x00000002u; +} +inline void LossParameter::clear_normalization() { + normalization_ = 1; + clear_has_normalization(); +} +inline ::caffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:caffe.LossParameter.normalization) + return static_cast< ::caffe::LossParameter_NormalizationMode >(normalization_); +} +inline void LossParameter::set_normalization(::caffe::LossParameter_NormalizationMode value) { + assert(::caffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:caffe.LossParameter.normalization) +} + +// optional bool normalize = 2; +inline bool LossParameter::has_normalize() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void LossParameter::set_has_normalize() { + _has_bits_[0] |= 0x00000004u; +} +inline void LossParameter::clear_has_normalize() { + _has_bits_[0] &= ~0x00000004u; +} +inline void LossParameter::clear_normalize() { + normalize_ = false; + clear_has_normalize(); +} +inline bool LossParameter::normalize() const { + // @@protoc_insertion_point(field_get:caffe.LossParameter.normalize) + return normalize_; +} +inline void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:caffe.LossParameter.normalize) +} + +inline const LossParameter* LossParameter::internal_default_instance() { + return &LossParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// AccuracyParameter + +// optional uint32 top_k = 1 [default = 1]; +inline bool AccuracyParameter::has_top_k() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void AccuracyParameter::set_has_top_k() { + _has_bits_[0] |= 0x00000001u; +} +inline void AccuracyParameter::clear_has_top_k() { + _has_bits_[0] &= ~0x00000001u; +} +inline void AccuracyParameter::clear_top_k() { + top_k_ = 1u; + clear_has_top_k(); +} +inline ::google::protobuf::uint32 AccuracyParameter::top_k() const { + // @@protoc_insertion_point(field_get:caffe.AccuracyParameter.top_k) + return top_k_; +} +inline void AccuracyParameter::set_top_k(::google::protobuf::uint32 value) { + set_has_top_k(); + top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.AccuracyParameter.top_k) +} + +// optional int32 axis = 2 [default = 1]; +inline bool AccuracyParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void AccuracyParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +inline void AccuracyParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +inline void AccuracyParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 AccuracyParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.AccuracyParameter.axis) + return axis_; +} +inline void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.AccuracyParameter.axis) +} + +// optional int32 ignore_label = 3; +inline bool AccuracyParameter::has_ignore_label() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void AccuracyParameter::set_has_ignore_label() { + _has_bits_[0] |= 0x00000004u; +} +inline void AccuracyParameter::clear_has_ignore_label() { + _has_bits_[0] &= ~0x00000004u; +} +inline void AccuracyParameter::clear_ignore_label() { + ignore_label_ = 0; + clear_has_ignore_label(); +} +inline ::google::protobuf::int32 AccuracyParameter::ignore_label() const { + // @@protoc_insertion_point(field_get:caffe.AccuracyParameter.ignore_label) + return ignore_label_; +} +inline void AccuracyParameter::set_ignore_label(::google::protobuf::int32 value) { + set_has_ignore_label(); + ignore_label_ = value; + // @@protoc_insertion_point(field_set:caffe.AccuracyParameter.ignore_label) +} + +inline const AccuracyParameter* AccuracyParameter::internal_default_instance() { + return &AccuracyParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ArgMaxParameter + +// optional bool out_max_val = 1 [default = false]; +inline bool ArgMaxParameter::has_out_max_val() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ArgMaxParameter::set_has_out_max_val() { + _has_bits_[0] |= 0x00000001u; +} +inline void ArgMaxParameter::clear_has_out_max_val() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ArgMaxParameter::clear_out_max_val() { + out_max_val_ = false; + clear_has_out_max_val(); +} +inline bool ArgMaxParameter::out_max_val() const { + // @@protoc_insertion_point(field_get:caffe.ArgMaxParameter.out_max_val) + return out_max_val_; +} +inline void ArgMaxParameter::set_out_max_val(bool value) { + set_has_out_max_val(); + out_max_val_ = value; + // @@protoc_insertion_point(field_set:caffe.ArgMaxParameter.out_max_val) +} + +// optional uint32 top_k = 2 [default = 1]; +inline bool ArgMaxParameter::has_top_k() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ArgMaxParameter::set_has_top_k() { + _has_bits_[0] |= 0x00000002u; +} +inline void ArgMaxParameter::clear_has_top_k() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ArgMaxParameter::clear_top_k() { + top_k_ = 1u; + clear_has_top_k(); +} +inline ::google::protobuf::uint32 ArgMaxParameter::top_k() const { + // @@protoc_insertion_point(field_get:caffe.ArgMaxParameter.top_k) + return top_k_; +} +inline void ArgMaxParameter::set_top_k(::google::protobuf::uint32 value) { + set_has_top_k(); + top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.ArgMaxParameter.top_k) +} + +// optional int32 axis = 3; +inline bool ArgMaxParameter::has_axis() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ArgMaxParameter::set_has_axis() { + _has_bits_[0] |= 0x00000004u; +} +inline void ArgMaxParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ArgMaxParameter::clear_axis() { + axis_ = 0; + clear_has_axis(); +} +inline ::google::protobuf::int32 ArgMaxParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ArgMaxParameter.axis) + return axis_; +} +inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ArgMaxParameter.axis) +} + +inline const ArgMaxParameter* ArgMaxParameter::internal_default_instance() { + return &ArgMaxParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ConcatParameter + +// optional int32 axis = 2 [default = 1]; +inline bool ConcatParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ConcatParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void ConcatParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ConcatParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 ConcatParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ConcatParameter.axis) + return axis_; +} +inline void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ConcatParameter.axis) +} + +// optional uint32 concat_dim = 1 [default = 1]; +inline bool ConcatParameter::has_concat_dim() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ConcatParameter::set_has_concat_dim() { + _has_bits_[0] |= 0x00000002u; +} +inline void ConcatParameter::clear_has_concat_dim() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ConcatParameter::clear_concat_dim() { + concat_dim_ = 1u; + clear_has_concat_dim(); +} +inline ::google::protobuf::uint32 ConcatParameter::concat_dim() const { + // @@protoc_insertion_point(field_get:caffe.ConcatParameter.concat_dim) + return concat_dim_; +} +inline void ConcatParameter::set_concat_dim(::google::protobuf::uint32 value) { + set_has_concat_dim(); + concat_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.ConcatParameter.concat_dim) +} + +inline const ConcatParameter* ConcatParameter::internal_default_instance() { + return &ConcatParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// BatchNormParameter + +// optional bool use_global_stats = 1; +inline bool BatchNormParameter::has_use_global_stats() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void BatchNormParameter::set_has_use_global_stats() { + _has_bits_[0] |= 0x00000001u; +} +inline void BatchNormParameter::clear_has_use_global_stats() { + _has_bits_[0] &= ~0x00000001u; +} +inline void BatchNormParameter::clear_use_global_stats() { + use_global_stats_ = false; + clear_has_use_global_stats(); +} +inline bool BatchNormParameter::use_global_stats() const { + // @@protoc_insertion_point(field_get:caffe.BatchNormParameter.use_global_stats) + return use_global_stats_; +} +inline void BatchNormParameter::set_use_global_stats(bool value) { + set_has_use_global_stats(); + use_global_stats_ = value; + // @@protoc_insertion_point(field_set:caffe.BatchNormParameter.use_global_stats) +} + +// optional float moving_average_fraction = 2 [default = 0.999]; +inline bool BatchNormParameter::has_moving_average_fraction() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void BatchNormParameter::set_has_moving_average_fraction() { + _has_bits_[0] |= 0x00000002u; +} +inline void BatchNormParameter::clear_has_moving_average_fraction() { + _has_bits_[0] &= ~0x00000002u; +} +inline void BatchNormParameter::clear_moving_average_fraction() { + moving_average_fraction_ = 0.999f; + clear_has_moving_average_fraction(); +} +inline float BatchNormParameter::moving_average_fraction() const { + // @@protoc_insertion_point(field_get:caffe.BatchNormParameter.moving_average_fraction) + return moving_average_fraction_; +} +inline void BatchNormParameter::set_moving_average_fraction(float value) { + set_has_moving_average_fraction(); + moving_average_fraction_ = value; + // @@protoc_insertion_point(field_set:caffe.BatchNormParameter.moving_average_fraction) +} + +// optional float eps = 3 [default = 1e-05]; +inline bool BatchNormParameter::has_eps() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void BatchNormParameter::set_has_eps() { + _has_bits_[0] |= 0x00000004u; +} +inline void BatchNormParameter::clear_has_eps() { + _has_bits_[0] &= ~0x00000004u; +} +inline void BatchNormParameter::clear_eps() { + eps_ = 1e-05f; + clear_has_eps(); +} +inline float BatchNormParameter::eps() const { + // @@protoc_insertion_point(field_get:caffe.BatchNormParameter.eps) + return eps_; +} +inline void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:caffe.BatchNormParameter.eps) +} + +inline const BatchNormParameter* BatchNormParameter::internal_default_instance() { + return &BatchNormParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// BiasParameter + +// optional int32 axis = 1 [default = 1]; +inline bool BiasParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void BiasParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void BiasParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void BiasParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 BiasParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.BiasParameter.axis) + return axis_; +} +inline void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.BiasParameter.axis) +} + +// optional int32 num_axes = 2 [default = 1]; +inline bool BiasParameter::has_num_axes() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void BiasParameter::set_has_num_axes() { + _has_bits_[0] |= 0x00000002u; +} +inline void BiasParameter::clear_has_num_axes() { + _has_bits_[0] &= ~0x00000002u; +} +inline void BiasParameter::clear_num_axes() { + num_axes_ = 1; + clear_has_num_axes(); +} +inline ::google::protobuf::int32 BiasParameter::num_axes() const { + // @@protoc_insertion_point(field_get:caffe.BiasParameter.num_axes) + return num_axes_; +} +inline void BiasParameter::set_num_axes(::google::protobuf::int32 value) { + set_has_num_axes(); + num_axes_ = value; + // @@protoc_insertion_point(field_set:caffe.BiasParameter.num_axes) +} + +// optional .caffe.FillerParameter filler = 3; +inline bool BiasParameter::has_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void BiasParameter::set_has_filler() { + _has_bits_[0] |= 0x00000004u; +} +inline void BiasParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000004u; +} +inline void BiasParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::caffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:caffe.BiasParameter.filler) + return filler_ != NULL ? *filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.BiasParameter.filler) + return filler_; +} +inline ::caffe::FillerParameter* BiasParameter::release_filler() { + // @@protoc_insertion_point(field_release:caffe.BiasParameter.filler) + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void BiasParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.BiasParameter.filler) +} + +inline const BiasParameter* BiasParameter::internal_default_instance() { + return &BiasParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ContrastiveLossParameter + +// optional float margin = 1 [default = 1]; +inline bool ContrastiveLossParameter::has_margin() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ContrastiveLossParameter::set_has_margin() { + _has_bits_[0] |= 0x00000001u; +} +inline void ContrastiveLossParameter::clear_has_margin() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ContrastiveLossParameter::clear_margin() { + margin_ = 1; + clear_has_margin(); +} +inline float ContrastiveLossParameter::margin() const { + // @@protoc_insertion_point(field_get:caffe.ContrastiveLossParameter.margin) + return margin_; +} +inline void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:caffe.ContrastiveLossParameter.margin) +} + +// optional bool legacy_version = 2 [default = false]; +inline bool ContrastiveLossParameter::has_legacy_version() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ContrastiveLossParameter::set_has_legacy_version() { + _has_bits_[0] |= 0x00000002u; +} +inline void ContrastiveLossParameter::clear_has_legacy_version() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ContrastiveLossParameter::clear_legacy_version() { + legacy_version_ = false; + clear_has_legacy_version(); +} +inline bool ContrastiveLossParameter::legacy_version() const { + // @@protoc_insertion_point(field_get:caffe.ContrastiveLossParameter.legacy_version) + return legacy_version_; +} +inline void ContrastiveLossParameter::set_legacy_version(bool value) { + set_has_legacy_version(); + legacy_version_ = value; + // @@protoc_insertion_point(field_set:caffe.ContrastiveLossParameter.legacy_version) +} + +inline const ContrastiveLossParameter* ContrastiveLossParameter::internal_default_instance() { + return &ContrastiveLossParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ConvolutionParameter + +// optional uint32 num_output = 1; +inline bool ConvolutionParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ConvolutionParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +inline void ConvolutionParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ConvolutionParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.num_output) + return num_output_; +} +inline void ConvolutionParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.num_output) +} + +// optional bool bias_term = 2 [default = true]; +inline bool ConvolutionParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ConvolutionParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000002u; +} +inline void ConvolutionParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ConvolutionParameter::clear_bias_term() { + bias_term_ = true; + clear_has_bias_term(); +} +inline bool ConvolutionParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.bias_term) + return bias_term_; +} +inline void ConvolutionParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.bias_term) +} + +// repeated uint32 pad = 3; +inline int ConvolutionParameter::pad_size() const { + return pad_.size(); +} +inline void ConvolutionParameter::clear_pad() { + pad_.Clear(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::pad(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.pad) + return pad_.Get(index); +} +inline void ConvolutionParameter::set_pad(int index, ::google::protobuf::uint32 value) { + pad_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.pad) +} +inline void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.pad) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.pad) + return pad_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.pad) + return &pad_; +} + +// repeated uint32 kernel_size = 4; +inline int ConvolutionParameter::kernel_size_size() const { + return kernel_size_.size(); +} +inline void ConvolutionParameter::clear_kernel_size() { + kernel_size_.Clear(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::kernel_size(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.kernel_size) + return kernel_size_.Get(index); +} +inline void ConvolutionParameter::set_kernel_size(int index, ::google::protobuf::uint32 value) { + kernel_size_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.kernel_size) +} +inline void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.kernel_size) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.kernel_size) + return &kernel_size_; +} + +// repeated uint32 stride = 6; +inline int ConvolutionParameter::stride_size() const { + return stride_.size(); +} +inline void ConvolutionParameter::clear_stride() { + stride_.Clear(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::stride(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.stride) + return stride_.Get(index); +} +inline void ConvolutionParameter::set_stride(int index, ::google::protobuf::uint32 value) { + stride_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.stride) +} +inline void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.stride) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.stride) + return stride_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.stride) + return &stride_; +} + +// repeated uint32 dilation = 18; +inline int ConvolutionParameter::dilation_size() const { + return dilation_.size(); +} +inline void ConvolutionParameter::clear_dilation() { + dilation_.Clear(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::dilation(int index) const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.dilation) + return dilation_.Get(index); +} +inline void ConvolutionParameter::set_dilation(int index, ::google::protobuf::uint32 value) { + dilation_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.dilation) +} +inline void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:caffe.ConvolutionParameter.dilation) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:caffe.ConvolutionParameter.dilation) + return dilation_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:caffe.ConvolutionParameter.dilation) + return &dilation_; +} + +// optional uint32 pad_h = 9 [default = 0]; +inline bool ConvolutionParameter::has_pad_h() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ConvolutionParameter::set_has_pad_h() { + _has_bits_[0] |= 0x00000040u; +} +inline void ConvolutionParameter::clear_has_pad_h() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ConvolutionParameter::clear_pad_h() { + pad_h_ = 0u; + clear_has_pad_h(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::pad_h() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.pad_h) + return pad_h_; +} +inline void ConvolutionParameter::set_pad_h(::google::protobuf::uint32 value) { + set_has_pad_h(); + pad_h_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.pad_h) +} + +// optional uint32 pad_w = 10 [default = 0]; +inline bool ConvolutionParameter::has_pad_w() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ConvolutionParameter::set_has_pad_w() { + _has_bits_[0] |= 0x00000080u; +} +inline void ConvolutionParameter::clear_has_pad_w() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ConvolutionParameter::clear_pad_w() { + pad_w_ = 0u; + clear_has_pad_w(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::pad_w() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.pad_w) + return pad_w_; +} +inline void ConvolutionParameter::set_pad_w(::google::protobuf::uint32 value) { + set_has_pad_w(); + pad_w_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.pad_w) +} + +// optional uint32 kernel_h = 11; +inline bool ConvolutionParameter::has_kernel_h() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void ConvolutionParameter::set_has_kernel_h() { + _has_bits_[0] |= 0x00000100u; +} +inline void ConvolutionParameter::clear_has_kernel_h() { + _has_bits_[0] &= ~0x00000100u; +} +inline void ConvolutionParameter::clear_kernel_h() { + kernel_h_ = 0u; + clear_has_kernel_h(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::kernel_h() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.kernel_h) + return kernel_h_; +} +inline void ConvolutionParameter::set_kernel_h(::google::protobuf::uint32 value) { + set_has_kernel_h(); + kernel_h_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.kernel_h) +} + +// optional uint32 kernel_w = 12; +inline bool ConvolutionParameter::has_kernel_w() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void ConvolutionParameter::set_has_kernel_w() { + _has_bits_[0] |= 0x00000200u; +} +inline void ConvolutionParameter::clear_has_kernel_w() { + _has_bits_[0] &= ~0x00000200u; +} +inline void ConvolutionParameter::clear_kernel_w() { + kernel_w_ = 0u; + clear_has_kernel_w(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::kernel_w() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.kernel_w) + return kernel_w_; +} +inline void ConvolutionParameter::set_kernel_w(::google::protobuf::uint32 value) { + set_has_kernel_w(); + kernel_w_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.kernel_w) +} + +// optional uint32 stride_h = 13; +inline bool ConvolutionParameter::has_stride_h() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void ConvolutionParameter::set_has_stride_h() { + _has_bits_[0] |= 0x00000400u; +} +inline void ConvolutionParameter::clear_has_stride_h() { + _has_bits_[0] &= ~0x00000400u; +} +inline void ConvolutionParameter::clear_stride_h() { + stride_h_ = 0u; + clear_has_stride_h(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::stride_h() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.stride_h) + return stride_h_; +} +inline void ConvolutionParameter::set_stride_h(::google::protobuf::uint32 value) { + set_has_stride_h(); + stride_h_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.stride_h) +} + +// optional uint32 stride_w = 14; +inline bool ConvolutionParameter::has_stride_w() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void ConvolutionParameter::set_has_stride_w() { + _has_bits_[0] |= 0x00000800u; +} +inline void ConvolutionParameter::clear_has_stride_w() { + _has_bits_[0] &= ~0x00000800u; +} +inline void ConvolutionParameter::clear_stride_w() { + stride_w_ = 0u; + clear_has_stride_w(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::stride_w() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.stride_w) + return stride_w_; +} +inline void ConvolutionParameter::set_stride_w(::google::protobuf::uint32 value) { + set_has_stride_w(); + stride_w_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.stride_w) +} + +// optional uint32 group = 5 [default = 1]; +inline bool ConvolutionParameter::has_group() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void ConvolutionParameter::set_has_group() { + _has_bits_[0] |= 0x00001000u; +} +inline void ConvolutionParameter::clear_has_group() { + _has_bits_[0] &= ~0x00001000u; +} +inline void ConvolutionParameter::clear_group() { + group_ = 1u; + clear_has_group(); +} +inline ::google::protobuf::uint32 ConvolutionParameter::group() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.group) + return group_; +} +inline void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.group) +} + +// optional .caffe.FillerParameter weight_filler = 7; +inline bool ConvolutionParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void ConvolutionParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00002000u; +} +inline void ConvolutionParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00002000u; +} +inline void ConvolutionParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::caffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +inline ::caffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.ConvolutionParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ConvolutionParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 8; +inline bool ConvolutionParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void ConvolutionParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00004000u; +} +inline void ConvolutionParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00004000u; +} +inline void ConvolutionParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::caffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +inline ::caffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.ConvolutionParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ConvolutionParameter.bias_filler) +} + +// optional .caffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; +inline bool ConvolutionParameter::has_engine() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void ConvolutionParameter::set_has_engine() { + _has_bits_[0] |= 0x00008000u; +} +inline void ConvolutionParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00008000u; +} +inline void ConvolutionParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.engine) + return static_cast< ::caffe::ConvolutionParameter_Engine >(engine_); +} +inline void ConvolutionParameter::set_engine(::caffe::ConvolutionParameter_Engine value) { + assert(::caffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.engine) +} + +// optional int32 axis = 16 [default = 1]; +inline bool ConvolutionParameter::has_axis() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void ConvolutionParameter::set_has_axis() { + _has_bits_[0] |= 0x00010000u; +} +inline void ConvolutionParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00010000u; +} +inline void ConvolutionParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 ConvolutionParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.axis) + return axis_; +} +inline void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.axis) +} + +// optional bool force_nd_im2col = 17 [default = false]; +inline bool ConvolutionParameter::has_force_nd_im2col() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void ConvolutionParameter::set_has_force_nd_im2col() { + _has_bits_[0] |= 0x00020000u; +} +inline void ConvolutionParameter::clear_has_force_nd_im2col() { + _has_bits_[0] &= ~0x00020000u; +} +inline void ConvolutionParameter::clear_force_nd_im2col() { + force_nd_im2col_ = false; + clear_has_force_nd_im2col(); +} +inline bool ConvolutionParameter::force_nd_im2col() const { + // @@protoc_insertion_point(field_get:caffe.ConvolutionParameter.force_nd_im2col) + return force_nd_im2col_; +} +inline void ConvolutionParameter::set_force_nd_im2col(bool value) { + set_has_force_nd_im2col(); + force_nd_im2col_ = value; + // @@protoc_insertion_point(field_set:caffe.ConvolutionParameter.force_nd_im2col) +} + +inline const ConvolutionParameter* ConvolutionParameter::internal_default_instance() { + return &ConvolutionParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// CropParameter + +// optional int32 axis = 1 [default = 2]; +inline bool CropParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CropParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void CropParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CropParameter::clear_axis() { + axis_ = 2; + clear_has_axis(); +} +inline ::google::protobuf::int32 CropParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.CropParameter.axis) + return axis_; +} +inline void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.CropParameter.axis) +} + +// repeated uint32 offset = 2; +inline int CropParameter::offset_size() const { + return offset_.size(); +} +inline void CropParameter::clear_offset() { + offset_.Clear(); +} +inline ::google::protobuf::uint32 CropParameter::offset(int index) const { + // @@protoc_insertion_point(field_get:caffe.CropParameter.offset) + return offset_.Get(index); +} +inline void CropParameter::set_offset(int index, ::google::protobuf::uint32 value) { + offset_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.CropParameter.offset) +} +inline void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:caffe.CropParameter.offset) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:caffe.CropParameter.offset) + return offset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:caffe.CropParameter.offset) + return &offset_; +} + +inline const CropParameter* CropParameter::internal_default_instance() { + return &CropParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// DataParameter + +// optional string source = 1; +inline bool DataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +inline void DataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& DataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.DataParameter.source) +} +inline void DataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.DataParameter.source) +} +inline void DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.DataParameter.source) +} +inline ::std::string* DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.DataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.DataParameter.source) +} + +// optional uint32 batch_size = 4; +inline bool DataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000002u; +} +inline void DataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +inline ::google::protobuf::uint32 DataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.batch_size) + return batch_size_; +} +inline void DataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.batch_size) +} + +// optional uint32 rand_skip = 7 [default = 0]; +inline bool DataParameter::has_rand_skip() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void DataParameter::set_has_rand_skip() { + _has_bits_[0] |= 0x00000004u; +} +inline void DataParameter::clear_has_rand_skip() { + _has_bits_[0] &= ~0x00000004u; +} +inline void DataParameter::clear_rand_skip() { + rand_skip_ = 0u; + clear_has_rand_skip(); +} +inline ::google::protobuf::uint32 DataParameter::rand_skip() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.rand_skip) + return rand_skip_; +} +inline void DataParameter::set_rand_skip(::google::protobuf::uint32 value) { + set_has_rand_skip(); + rand_skip_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.rand_skip) +} + +// optional .caffe.DataParameter.DB backend = 8 [default = LEVELDB]; +inline bool DataParameter::has_backend() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void DataParameter::set_has_backend() { + _has_bits_[0] |= 0x00000008u; +} +inline void DataParameter::clear_has_backend() { + _has_bits_[0] &= ~0x00000008u; +} +inline void DataParameter::clear_backend() { + backend_ = 0; + clear_has_backend(); +} +inline ::caffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.backend) + return static_cast< ::caffe::DataParameter_DB >(backend_); +} +inline void DataParameter::set_backend(::caffe::DataParameter_DB value) { + assert(::caffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.backend) +} + +// optional float scale = 2 [default = 1]; +inline bool DataParameter::has_scale() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void DataParameter::set_has_scale() { + _has_bits_[0] |= 0x00000010u; +} +inline void DataParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000010u; +} +inline void DataParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float DataParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.scale) + return scale_; +} +inline void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.scale) +} + +// optional string mean_file = 3; +inline bool DataParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void DataParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000020u; +} +inline void DataParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000020u; +} +inline void DataParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +inline const ::std::string& DataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.DataParameter.mean_file) +} +inline void DataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.DataParameter.mean_file) +} +inline void DataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.DataParameter.mean_file) +} +inline ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.DataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.DataParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.DataParameter.mean_file) +} + +// optional uint32 crop_size = 5 [default = 0]; +inline bool DataParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void DataParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000040u; +} +inline void DataParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000040u; +} +inline void DataParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +inline ::google::protobuf::uint32 DataParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.crop_size) + return crop_size_; +} +inline void DataParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.crop_size) +} + +// optional bool mirror = 6 [default = false]; +inline bool DataParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void DataParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000080u; +} +inline void DataParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000080u; +} +inline void DataParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +inline bool DataParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.mirror) + return mirror_; +} +inline void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.mirror) +} + +// optional bool force_encoded_color = 9 [default = false]; +inline bool DataParameter::has_force_encoded_color() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void DataParameter::set_has_force_encoded_color() { + _has_bits_[0] |= 0x00000100u; +} +inline void DataParameter::clear_has_force_encoded_color() { + _has_bits_[0] &= ~0x00000100u; +} +inline void DataParameter::clear_force_encoded_color() { + force_encoded_color_ = false; + clear_has_force_encoded_color(); +} +inline bool DataParameter::force_encoded_color() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.force_encoded_color) + return force_encoded_color_; +} +inline void DataParameter::set_force_encoded_color(bool value) { + set_has_force_encoded_color(); + force_encoded_color_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.force_encoded_color) +} + +// optional uint32 prefetch = 10 [default = 4]; +inline bool DataParameter::has_prefetch() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void DataParameter::set_has_prefetch() { + _has_bits_[0] |= 0x00000200u; +} +inline void DataParameter::clear_has_prefetch() { + _has_bits_[0] &= ~0x00000200u; +} +inline void DataParameter::clear_prefetch() { + prefetch_ = 4u; + clear_has_prefetch(); +} +inline ::google::protobuf::uint32 DataParameter::prefetch() const { + // @@protoc_insertion_point(field_get:caffe.DataParameter.prefetch) + return prefetch_; +} +inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:caffe.DataParameter.prefetch) +} + +inline const DataParameter* DataParameter::internal_default_instance() { + return &DataParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NonMaximumSuppressionParameter + +// optional float nms_threshold = 1 [default = 0.3]; +inline bool NonMaximumSuppressionParameter::has_nms_threshold() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NonMaximumSuppressionParameter::set_has_nms_threshold() { + _has_bits_[0] |= 0x00000001u; +} +inline void NonMaximumSuppressionParameter::clear_has_nms_threshold() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NonMaximumSuppressionParameter::clear_nms_threshold() { + nms_threshold_ = 0.3f; + clear_has_nms_threshold(); +} +inline float NonMaximumSuppressionParameter::nms_threshold() const { + // @@protoc_insertion_point(field_get:caffe.NonMaximumSuppressionParameter.nms_threshold) + return nms_threshold_; +} +inline void NonMaximumSuppressionParameter::set_nms_threshold(float value) { + set_has_nms_threshold(); + nms_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.NonMaximumSuppressionParameter.nms_threshold) +} + +// optional int32 top_k = 2; +inline bool NonMaximumSuppressionParameter::has_top_k() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NonMaximumSuppressionParameter::set_has_top_k() { + _has_bits_[0] |= 0x00000002u; +} +inline void NonMaximumSuppressionParameter::clear_has_top_k() { + _has_bits_[0] &= ~0x00000002u; +} +inline void NonMaximumSuppressionParameter::clear_top_k() { + top_k_ = 0; + clear_has_top_k(); +} +inline ::google::protobuf::int32 NonMaximumSuppressionParameter::top_k() const { + // @@protoc_insertion_point(field_get:caffe.NonMaximumSuppressionParameter.top_k) + return top_k_; +} +inline void NonMaximumSuppressionParameter::set_top_k(::google::protobuf::int32 value) { + set_has_top_k(); + top_k_ = value; + // @@protoc_insertion_point(field_set:caffe.NonMaximumSuppressionParameter.top_k) +} + +// optional float eta = 3 [default = 1]; +inline bool NonMaximumSuppressionParameter::has_eta() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void NonMaximumSuppressionParameter::set_has_eta() { + _has_bits_[0] |= 0x00000004u; +} +inline void NonMaximumSuppressionParameter::clear_has_eta() { + _has_bits_[0] &= ~0x00000004u; +} +inline void NonMaximumSuppressionParameter::clear_eta() { + eta_ = 1; + clear_has_eta(); +} +inline float NonMaximumSuppressionParameter::eta() const { + // @@protoc_insertion_point(field_get:caffe.NonMaximumSuppressionParameter.eta) + return eta_; +} +inline void NonMaximumSuppressionParameter::set_eta(float value) { + set_has_eta(); + eta_ = value; + // @@protoc_insertion_point(field_set:caffe.NonMaximumSuppressionParameter.eta) +} + +inline const NonMaximumSuppressionParameter* NonMaximumSuppressionParameter::internal_default_instance() { + return &NonMaximumSuppressionParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SaveOutputParameter + +// optional string output_directory = 1; +inline bool SaveOutputParameter::has_output_directory() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SaveOutputParameter::set_has_output_directory() { + _has_bits_[0] |= 0x00000001u; +} +inline void SaveOutputParameter::clear_has_output_directory() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SaveOutputParameter::clear_output_directory() { + output_directory_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_directory(); +} +inline const ::std::string& SaveOutputParameter::output_directory() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.output_directory) + return output_directory_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_output_directory(const ::std::string& value) { + set_has_output_directory(); + output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.output_directory) +} +inline void SaveOutputParameter::set_output_directory(const char* value) { + set_has_output_directory(); + output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.output_directory) +} +inline void SaveOutputParameter::set_output_directory(const char* value, size_t size) { + set_has_output_directory(); + output_directory_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.output_directory) +} +inline ::std::string* SaveOutputParameter::mutable_output_directory() { + set_has_output_directory(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.output_directory) + return output_directory_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SaveOutputParameter::release_output_directory() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.output_directory) + clear_has_output_directory(); + return output_directory_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_allocated_output_directory(::std::string* output_directory) { + if (output_directory != NULL) { + set_has_output_directory(); + } else { + clear_has_output_directory(); + } + output_directory_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_directory); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.output_directory) +} + +// optional string output_name_prefix = 2; +inline bool SaveOutputParameter::has_output_name_prefix() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SaveOutputParameter::set_has_output_name_prefix() { + _has_bits_[0] |= 0x00000002u; +} +inline void SaveOutputParameter::clear_has_output_name_prefix() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SaveOutputParameter::clear_output_name_prefix() { + output_name_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_name_prefix(); +} +inline const ::std::string& SaveOutputParameter::output_name_prefix() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.output_name_prefix) + return output_name_prefix_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_output_name_prefix(const ::std::string& value) { + set_has_output_name_prefix(); + output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.output_name_prefix) +} +inline void SaveOutputParameter::set_output_name_prefix(const char* value) { + set_has_output_name_prefix(); + output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.output_name_prefix) +} +inline void SaveOutputParameter::set_output_name_prefix(const char* value, size_t size) { + set_has_output_name_prefix(); + output_name_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.output_name_prefix) +} +inline ::std::string* SaveOutputParameter::mutable_output_name_prefix() { + set_has_output_name_prefix(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.output_name_prefix) + return output_name_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SaveOutputParameter::release_output_name_prefix() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.output_name_prefix) + clear_has_output_name_prefix(); + return output_name_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_allocated_output_name_prefix(::std::string* output_name_prefix) { + if (output_name_prefix != NULL) { + set_has_output_name_prefix(); + } else { + clear_has_output_name_prefix(); + } + output_name_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_name_prefix); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.output_name_prefix) +} + +// optional string output_format = 3; +inline bool SaveOutputParameter::has_output_format() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SaveOutputParameter::set_has_output_format() { + _has_bits_[0] |= 0x00000004u; +} +inline void SaveOutputParameter::clear_has_output_format() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SaveOutputParameter::clear_output_format() { + output_format_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_format(); +} +inline const ::std::string& SaveOutputParameter::output_format() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.output_format) + return output_format_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_output_format(const ::std::string& value) { + set_has_output_format(); + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.output_format) +} +inline void SaveOutputParameter::set_output_format(const char* value) { + set_has_output_format(); + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.output_format) +} +inline void SaveOutputParameter::set_output_format(const char* value, size_t size) { + set_has_output_format(); + output_format_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.output_format) +} +inline ::std::string* SaveOutputParameter::mutable_output_format() { + set_has_output_format(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.output_format) + return output_format_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SaveOutputParameter::release_output_format() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.output_format) + clear_has_output_format(); + return output_format_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_allocated_output_format(::std::string* output_format) { + if (output_format != NULL) { + set_has_output_format(); + } else { + clear_has_output_format(); + } + output_format_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_format); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.output_format) +} + +// optional string label_map_file = 4; +inline bool SaveOutputParameter::has_label_map_file() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void SaveOutputParameter::set_has_label_map_file() { + _has_bits_[0] |= 0x00000008u; +} +inline void SaveOutputParameter::clear_has_label_map_file() { + _has_bits_[0] &= ~0x00000008u; +} +inline void SaveOutputParameter::clear_label_map_file() { + label_map_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_label_map_file(); +} +inline const ::std::string& SaveOutputParameter::label_map_file() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.label_map_file) + return label_map_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_label_map_file(const ::std::string& value) { + set_has_label_map_file(); + label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.label_map_file) +} +inline void SaveOutputParameter::set_label_map_file(const char* value) { + set_has_label_map_file(); + label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.label_map_file) +} +inline void SaveOutputParameter::set_label_map_file(const char* value, size_t size) { + set_has_label_map_file(); + label_map_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.label_map_file) +} +inline ::std::string* SaveOutputParameter::mutable_label_map_file() { + set_has_label_map_file(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.label_map_file) + return label_map_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SaveOutputParameter::release_label_map_file() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.label_map_file) + clear_has_label_map_file(); + return label_map_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_allocated_label_map_file(::std::string* label_map_file) { + if (label_map_file != NULL) { + set_has_label_map_file(); + } else { + clear_has_label_map_file(); + } + label_map_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), label_map_file); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.label_map_file) +} + +// optional string name_size_file = 5; +inline bool SaveOutputParameter::has_name_size_file() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void SaveOutputParameter::set_has_name_size_file() { + _has_bits_[0] |= 0x00000010u; +} +inline void SaveOutputParameter::clear_has_name_size_file() { + _has_bits_[0] &= ~0x00000010u; +} +inline void SaveOutputParameter::clear_name_size_file() { + name_size_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name_size_file(); +} +inline const ::std::string& SaveOutputParameter::name_size_file() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.name_size_file) + return name_size_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_name_size_file(const ::std::string& value) { + set_has_name_size_file(); + name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.name_size_file) +} +inline void SaveOutputParameter::set_name_size_file(const char* value) { + set_has_name_size_file(); + name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.SaveOutputParameter.name_size_file) +} +inline void SaveOutputParameter::set_name_size_file(const char* value, size_t size) { + set_has_name_size_file(); + name_size_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.SaveOutputParameter.name_size_file) +} +inline ::std::string* SaveOutputParameter::mutable_name_size_file() { + set_has_name_size_file(); + // @@protoc_insertion_point(field_mutable:caffe.SaveOutputParameter.name_size_file) + return name_size_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SaveOutputParameter::release_name_size_file() { + // @@protoc_insertion_point(field_release:caffe.SaveOutputParameter.name_size_file) + clear_has_name_size_file(); + return name_size_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SaveOutputParameter::set_allocated_name_size_file(::std::string* name_size_file) { + if (name_size_file != NULL) { + set_has_name_size_file(); + } else { + clear_has_name_size_file(); + } + name_size_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_size_file); + // @@protoc_insertion_point(field_set_allocated:caffe.SaveOutputParameter.name_size_file) +} + +// optional uint32 num_test_image = 6; +inline bool SaveOutputParameter::has_num_test_image() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void SaveOutputParameter::set_has_num_test_image() { + _has_bits_[0] |= 0x00000020u; +} +inline void SaveOutputParameter::clear_has_num_test_image() { + _has_bits_[0] &= ~0x00000020u; +} +inline void SaveOutputParameter::clear_num_test_image() { + num_test_image_ = 0u; + clear_has_num_test_image(); +} +inline ::google::protobuf::uint32 SaveOutputParameter::num_test_image() const { + // @@protoc_insertion_point(field_get:caffe.SaveOutputParameter.num_test_image) + return num_test_image_; +} +inline void SaveOutputParameter::set_num_test_image(::google::protobuf::uint32 value) { + set_has_num_test_image(); + num_test_image_ = value; + // @@protoc_insertion_point(field_set:caffe.SaveOutputParameter.num_test_image) +} + +inline const SaveOutputParameter* SaveOutputParameter::internal_default_instance() { + return &SaveOutputParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// DropoutParameter + +// optional float dropout_ratio = 1 [default = 0.5]; +inline bool DropoutParameter::has_dropout_ratio() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DropoutParameter::set_has_dropout_ratio() { + _has_bits_[0] |= 0x00000001u; +} +inline void DropoutParameter::clear_has_dropout_ratio() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DropoutParameter::clear_dropout_ratio() { + dropout_ratio_ = 0.5f; + clear_has_dropout_ratio(); +} +inline float DropoutParameter::dropout_ratio() const { + // @@protoc_insertion_point(field_get:caffe.DropoutParameter.dropout_ratio) + return dropout_ratio_; +} +inline void DropoutParameter::set_dropout_ratio(float value) { + set_has_dropout_ratio(); + dropout_ratio_ = value; + // @@protoc_insertion_point(field_set:caffe.DropoutParameter.dropout_ratio) +} + +inline const DropoutParameter* DropoutParameter::internal_default_instance() { + return &DropoutParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// DummyDataParameter + +// repeated .caffe.FillerParameter data_filler = 1; +inline int DummyDataParameter::data_filler_size() const { + return data_filler_.size(); +} +inline void DummyDataParameter::clear_data_filler() { + data_filler_.Clear(); +} +inline const ::caffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +inline ::caffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:caffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +inline ::caffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.data_filler) + return &data_filler_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.data_filler) + return data_filler_; +} + +// repeated .caffe.BlobShape shape = 6; +inline int DummyDataParameter::shape_size() const { + return shape_.size(); +} +inline void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +inline const ::caffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.shape) + return shape_.Get(index); +} +inline ::caffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:caffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +inline ::caffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.shape) + return shape_; +} + +// repeated uint32 num = 2; +inline int DummyDataParameter::num_size() const { + return num_.size(); +} +inline void DummyDataParameter::clear_num() { + num_.Clear(); +} +inline ::google::protobuf::uint32 DummyDataParameter::num(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.num) + return num_.Get(index); +} +inline void DummyDataParameter::set_num(int index, ::google::protobuf::uint32 value) { + num_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.num) +} +inline void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.num) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.num) + return num_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.num) + return &num_; +} + +// repeated uint32 channels = 3; +inline int DummyDataParameter::channels_size() const { + return channels_.size(); +} +inline void DummyDataParameter::clear_channels() { + channels_.Clear(); +} +inline ::google::protobuf::uint32 DummyDataParameter::channels(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.channels) + return channels_.Get(index); +} +inline void DummyDataParameter::set_channels(int index, ::google::protobuf::uint32 value) { + channels_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.channels) +} +inline void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.channels) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.channels) + return channels_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.channels) + return &channels_; +} + +// repeated uint32 height = 4; +inline int DummyDataParameter::height_size() const { + return height_.size(); +} +inline void DummyDataParameter::clear_height() { + height_.Clear(); +} +inline ::google::protobuf::uint32 DummyDataParameter::height(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.height) + return height_.Get(index); +} +inline void DummyDataParameter::set_height(int index, ::google::protobuf::uint32 value) { + height_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.height) +} +inline void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.height) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.height) + return height_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.height) + return &height_; +} + +// repeated uint32 width = 5; +inline int DummyDataParameter::width_size() const { + return width_.size(); +} +inline void DummyDataParameter::clear_width() { + width_.Clear(); +} +inline ::google::protobuf::uint32 DummyDataParameter::width(int index) const { + // @@protoc_insertion_point(field_get:caffe.DummyDataParameter.width) + return width_.Get(index); +} +inline void DummyDataParameter::set_width(int index, ::google::protobuf::uint32 value) { + width_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.DummyDataParameter.width) +} +inline void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:caffe.DummyDataParameter.width) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:caffe.DummyDataParameter.width) + return width_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:caffe.DummyDataParameter.width) + return &width_; +} + +inline const DummyDataParameter* DummyDataParameter::internal_default_instance() { + return &DummyDataParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// EltwiseParameter + +// optional .caffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; +inline bool EltwiseParameter::has_operation() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EltwiseParameter::set_has_operation() { + _has_bits_[0] |= 0x00000001u; +} +inline void EltwiseParameter::clear_has_operation() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EltwiseParameter::clear_operation() { + operation_ = 1; + clear_has_operation(); +} +inline ::caffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:caffe.EltwiseParameter.operation) + return static_cast< ::caffe::EltwiseParameter_EltwiseOp >(operation_); +} +inline void EltwiseParameter::set_operation(::caffe::EltwiseParameter_EltwiseOp value) { + assert(::caffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:caffe.EltwiseParameter.operation) +} + +// repeated float coeff = 2; +inline int EltwiseParameter::coeff_size() const { + return coeff_.size(); +} +inline void EltwiseParameter::clear_coeff() { + coeff_.Clear(); +} +inline float EltwiseParameter::coeff(int index) const { + // @@protoc_insertion_point(field_get:caffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} +inline void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.EltwiseParameter.coeff) +} +inline void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:caffe.EltwiseParameter.coeff) +} +inline const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:caffe.EltwiseParameter.coeff) + return coeff_; +} +inline ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:caffe.EltwiseParameter.coeff) + return &coeff_; +} + +// optional bool stable_prod_grad = 3 [default = true]; +inline bool EltwiseParameter::has_stable_prod_grad() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void EltwiseParameter::set_has_stable_prod_grad() { + _has_bits_[0] |= 0x00000004u; +} +inline void EltwiseParameter::clear_has_stable_prod_grad() { + _has_bits_[0] &= ~0x00000004u; +} +inline void EltwiseParameter::clear_stable_prod_grad() { + stable_prod_grad_ = true; + clear_has_stable_prod_grad(); +} +inline bool EltwiseParameter::stable_prod_grad() const { + // @@protoc_insertion_point(field_get:caffe.EltwiseParameter.stable_prod_grad) + return stable_prod_grad_; +} +inline void EltwiseParameter::set_stable_prod_grad(bool value) { + set_has_stable_prod_grad(); + stable_prod_grad_ = value; + // @@protoc_insertion_point(field_set:caffe.EltwiseParameter.stable_prod_grad) +} + +inline const EltwiseParameter* EltwiseParameter::internal_default_instance() { + return &EltwiseParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ELUParameter + +// optional float alpha = 1 [default = 1]; +inline bool ELUParameter::has_alpha() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ELUParameter::set_has_alpha() { + _has_bits_[0] |= 0x00000001u; +} +inline void ELUParameter::clear_has_alpha() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ELUParameter::clear_alpha() { + alpha_ = 1; + clear_has_alpha(); +} +inline float ELUParameter::alpha() const { + // @@protoc_insertion_point(field_get:caffe.ELUParameter.alpha) + return alpha_; +} +inline void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:caffe.ELUParameter.alpha) +} + +inline const ELUParameter* ELUParameter::internal_default_instance() { + return &ELUParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// EmbedParameter + +// optional uint32 num_output = 1; +inline bool EmbedParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EmbedParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +inline void EmbedParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EmbedParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +inline ::google::protobuf::uint32 EmbedParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.num_output) + return num_output_; +} +inline void EmbedParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.EmbedParameter.num_output) +} + +// optional uint32 input_dim = 2; +inline bool EmbedParameter::has_input_dim() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void EmbedParameter::set_has_input_dim() { + _has_bits_[0] |= 0x00000002u; +} +inline void EmbedParameter::clear_has_input_dim() { + _has_bits_[0] &= ~0x00000002u; +} +inline void EmbedParameter::clear_input_dim() { + input_dim_ = 0u; + clear_has_input_dim(); +} +inline ::google::protobuf::uint32 EmbedParameter::input_dim() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.input_dim) + return input_dim_; +} +inline void EmbedParameter::set_input_dim(::google::protobuf::uint32 value) { + set_has_input_dim(); + input_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.EmbedParameter.input_dim) +} + +// optional bool bias_term = 3 [default = true]; +inline bool EmbedParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void EmbedParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000004u; +} +inline void EmbedParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000004u; +} +inline void EmbedParameter::clear_bias_term() { + bias_term_ = true; + clear_has_bias_term(); +} +inline bool EmbedParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.bias_term) + return bias_term_; +} +inline void EmbedParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.EmbedParameter.bias_term) +} + +// optional .caffe.FillerParameter weight_filler = 4; +inline bool EmbedParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void EmbedParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000008u; +} +inline void EmbedParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000008u; +} +inline void EmbedParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::caffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.EmbedParameter.weight_filler) + return weight_filler_; +} +inline ::caffe::FillerParameter* EmbedParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.EmbedParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.EmbedParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 5; +inline bool EmbedParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void EmbedParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000010u; +} +inline void EmbedParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000010u; +} +inline void EmbedParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::caffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.EmbedParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.EmbedParameter.bias_filler) + return bias_filler_; +} +inline ::caffe::FillerParameter* EmbedParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.EmbedParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.EmbedParameter.bias_filler) +} + +inline const EmbedParameter* EmbedParameter::internal_default_instance() { + return &EmbedParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ExpParameter + +// optional float base = 1 [default = -1]; +inline bool ExpParameter::has_base() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ExpParameter::set_has_base() { + _has_bits_[0] |= 0x00000001u; +} +inline void ExpParameter::clear_has_base() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ExpParameter::clear_base() { + base_ = -1; + clear_has_base(); +} +inline float ExpParameter::base() const { + // @@protoc_insertion_point(field_get:caffe.ExpParameter.base) + return base_; +} +inline void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:caffe.ExpParameter.base) +} + +// optional float scale = 2 [default = 1]; +inline bool ExpParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ExpParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +inline void ExpParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ExpParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float ExpParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.ExpParameter.scale) + return scale_; +} +inline void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.ExpParameter.scale) +} + +// optional float shift = 3 [default = 0]; +inline bool ExpParameter::has_shift() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ExpParameter::set_has_shift() { + _has_bits_[0] |= 0x00000004u; +} +inline void ExpParameter::clear_has_shift() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ExpParameter::clear_shift() { + shift_ = 0; + clear_has_shift(); +} +inline float ExpParameter::shift() const { + // @@protoc_insertion_point(field_get:caffe.ExpParameter.shift) + return shift_; +} +inline void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:caffe.ExpParameter.shift) +} + +inline const ExpParameter* ExpParameter::internal_default_instance() { + return &ExpParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// FlattenParameter + +// optional int32 axis = 1 [default = 1]; +inline bool FlattenParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FlattenParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void FlattenParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FlattenParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 FlattenParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.FlattenParameter.axis) + return axis_; +} +inline void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.FlattenParameter.axis) +} + +// optional int32 end_axis = 2 [default = -1]; +inline bool FlattenParameter::has_end_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FlattenParameter::set_has_end_axis() { + _has_bits_[0] |= 0x00000002u; +} +inline void FlattenParameter::clear_has_end_axis() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FlattenParameter::clear_end_axis() { + end_axis_ = -1; + clear_has_end_axis(); +} +inline ::google::protobuf::int32 FlattenParameter::end_axis() const { + // @@protoc_insertion_point(field_get:caffe.FlattenParameter.end_axis) + return end_axis_; +} +inline void FlattenParameter::set_end_axis(::google::protobuf::int32 value) { + set_has_end_axis(); + end_axis_ = value; + // @@protoc_insertion_point(field_set:caffe.FlattenParameter.end_axis) +} + +inline const FlattenParameter* FlattenParameter::internal_default_instance() { + return &FlattenParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// HDF5DataParameter + +// optional string source = 1; +inline bool HDF5DataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void HDF5DataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +inline void HDF5DataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +inline void HDF5DataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& HDF5DataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.HDF5DataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void HDF5DataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.HDF5DataParameter.source) +} +inline void HDF5DataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.HDF5DataParameter.source) +} +inline void HDF5DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.HDF5DataParameter.source) +} +inline ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.HDF5DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* HDF5DataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.HDF5DataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void HDF5DataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.HDF5DataParameter.source) +} + +// optional uint32 batch_size = 2; +inline bool HDF5DataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void HDF5DataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000002u; +} +inline void HDF5DataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000002u; +} +inline void HDF5DataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +inline ::google::protobuf::uint32 HDF5DataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.HDF5DataParameter.batch_size) + return batch_size_; +} +inline void HDF5DataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.HDF5DataParameter.batch_size) +} + +// optional bool shuffle = 3 [default = false]; +inline bool HDF5DataParameter::has_shuffle() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void HDF5DataParameter::set_has_shuffle() { + _has_bits_[0] |= 0x00000004u; +} +inline void HDF5DataParameter::clear_has_shuffle() { + _has_bits_[0] &= ~0x00000004u; +} +inline void HDF5DataParameter::clear_shuffle() { + shuffle_ = false; + clear_has_shuffle(); +} +inline bool HDF5DataParameter::shuffle() const { + // @@protoc_insertion_point(field_get:caffe.HDF5DataParameter.shuffle) + return shuffle_; +} +inline void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:caffe.HDF5DataParameter.shuffle) +} + +inline const HDF5DataParameter* HDF5DataParameter::internal_default_instance() { + return &HDF5DataParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// HDF5OutputParameter + +// optional string file_name = 1; +inline bool HDF5OutputParameter::has_file_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void HDF5OutputParameter::set_has_file_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void HDF5OutputParameter::clear_has_file_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void HDF5OutputParameter::clear_file_name() { + file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_file_name(); +} +inline const ::std::string& HDF5OutputParameter::file_name() const { + // @@protoc_insertion_point(field_get:caffe.HDF5OutputParameter.file_name) + return file_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void HDF5OutputParameter::set_file_name(const ::std::string& value) { + set_has_file_name(); + file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.HDF5OutputParameter.file_name) +} +inline void HDF5OutputParameter::set_file_name(const char* value) { + set_has_file_name(); + file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.HDF5OutputParameter.file_name) +} +inline void HDF5OutputParameter::set_file_name(const char* value, size_t size) { + set_has_file_name(); + file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.HDF5OutputParameter.file_name) +} +inline ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + // @@protoc_insertion_point(field_mutable:caffe.HDF5OutputParameter.file_name) + return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* HDF5OutputParameter::release_file_name() { + // @@protoc_insertion_point(field_release:caffe.HDF5OutputParameter.file_name) + clear_has_file_name(); + return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void HDF5OutputParameter::set_allocated_file_name(::std::string* file_name) { + if (file_name != NULL) { + set_has_file_name(); + } else { + clear_has_file_name(); + } + file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name); + // @@protoc_insertion_point(field_set_allocated:caffe.HDF5OutputParameter.file_name) +} + +inline const HDF5OutputParameter* HDF5OutputParameter::internal_default_instance() { + return &HDF5OutputParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// HingeLossParameter + +// optional .caffe.HingeLossParameter.Norm norm = 1 [default = L1]; +inline bool HingeLossParameter::has_norm() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void HingeLossParameter::set_has_norm() { + _has_bits_[0] |= 0x00000001u; +} +inline void HingeLossParameter::clear_has_norm() { + _has_bits_[0] &= ~0x00000001u; +} +inline void HingeLossParameter::clear_norm() { + norm_ = 1; + clear_has_norm(); +} +inline ::caffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:caffe.HingeLossParameter.norm) + return static_cast< ::caffe::HingeLossParameter_Norm >(norm_); +} +inline void HingeLossParameter::set_norm(::caffe::HingeLossParameter_Norm value) { + assert(::caffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:caffe.HingeLossParameter.norm) +} + +inline const HingeLossParameter* HingeLossParameter::internal_default_instance() { + return &HingeLossParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ImageDataParameter + +// optional string source = 1; +inline bool ImageDataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ImageDataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +inline void ImageDataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ImageDataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& ImageDataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ImageDataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.source) +} +inline void ImageDataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ImageDataParameter.source) +} +inline void ImageDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ImageDataParameter.source) +} +inline ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.ImageDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.ImageDataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ImageDataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.ImageDataParameter.source) +} + +// optional uint32 batch_size = 4 [default = 1]; +inline bool ImageDataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ImageDataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000002u; +} +inline void ImageDataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ImageDataParameter::clear_batch_size() { + batch_size_ = 1u; + clear_has_batch_size(); +} +inline ::google::protobuf::uint32 ImageDataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.batch_size) + return batch_size_; +} +inline void ImageDataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.batch_size) +} + +// optional uint32 rand_skip = 7 [default = 0]; +inline bool ImageDataParameter::has_rand_skip() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ImageDataParameter::set_has_rand_skip() { + _has_bits_[0] |= 0x00000004u; +} +inline void ImageDataParameter::clear_has_rand_skip() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ImageDataParameter::clear_rand_skip() { + rand_skip_ = 0u; + clear_has_rand_skip(); +} +inline ::google::protobuf::uint32 ImageDataParameter::rand_skip() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.rand_skip) + return rand_skip_; +} +inline void ImageDataParameter::set_rand_skip(::google::protobuf::uint32 value) { + set_has_rand_skip(); + rand_skip_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.rand_skip) +} + +// optional bool shuffle = 8 [default = false]; +inline bool ImageDataParameter::has_shuffle() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ImageDataParameter::set_has_shuffle() { + _has_bits_[0] |= 0x00000008u; +} +inline void ImageDataParameter::clear_has_shuffle() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ImageDataParameter::clear_shuffle() { + shuffle_ = false; + clear_has_shuffle(); +} +inline bool ImageDataParameter::shuffle() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.shuffle) + return shuffle_; +} +inline void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.shuffle) +} + +// optional uint32 new_height = 9 [default = 0]; +inline bool ImageDataParameter::has_new_height() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ImageDataParameter::set_has_new_height() { + _has_bits_[0] |= 0x00000010u; +} +inline void ImageDataParameter::clear_has_new_height() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ImageDataParameter::clear_new_height() { + new_height_ = 0u; + clear_has_new_height(); +} +inline ::google::protobuf::uint32 ImageDataParameter::new_height() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.new_height) + return new_height_; +} +inline void ImageDataParameter::set_new_height(::google::protobuf::uint32 value) { + set_has_new_height(); + new_height_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.new_height) +} + +// optional uint32 new_width = 10 [default = 0]; +inline bool ImageDataParameter::has_new_width() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ImageDataParameter::set_has_new_width() { + _has_bits_[0] |= 0x00000020u; +} +inline void ImageDataParameter::clear_has_new_width() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ImageDataParameter::clear_new_width() { + new_width_ = 0u; + clear_has_new_width(); +} +inline ::google::protobuf::uint32 ImageDataParameter::new_width() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.new_width) + return new_width_; +} +inline void ImageDataParameter::set_new_width(::google::protobuf::uint32 value) { + set_has_new_width(); + new_width_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.new_width) +} + +// optional bool is_color = 11 [default = true]; +inline bool ImageDataParameter::has_is_color() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ImageDataParameter::set_has_is_color() { + _has_bits_[0] |= 0x00000040u; +} +inline void ImageDataParameter::clear_has_is_color() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ImageDataParameter::clear_is_color() { + is_color_ = true; + clear_has_is_color(); +} +inline bool ImageDataParameter::is_color() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.is_color) + return is_color_; +} +inline void ImageDataParameter::set_is_color(bool value) { + set_has_is_color(); + is_color_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.is_color) +} + +// optional float scale = 2 [default = 1]; +inline bool ImageDataParameter::has_scale() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ImageDataParameter::set_has_scale() { + _has_bits_[0] |= 0x00000080u; +} +inline void ImageDataParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ImageDataParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float ImageDataParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.scale) + return scale_; +} +inline void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.scale) +} + +// optional string mean_file = 3; +inline bool ImageDataParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void ImageDataParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000100u; +} +inline void ImageDataParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000100u; +} +inline void ImageDataParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +inline const ::std::string& ImageDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ImageDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.mean_file) +} +inline void ImageDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ImageDataParameter.mean_file) +} +inline void ImageDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ImageDataParameter.mean_file) +} +inline ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.ImageDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.ImageDataParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ImageDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.ImageDataParameter.mean_file) +} + +// optional uint32 crop_size = 5 [default = 0]; +inline bool ImageDataParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void ImageDataParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000200u; +} +inline void ImageDataParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000200u; +} +inline void ImageDataParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +inline ::google::protobuf::uint32 ImageDataParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.crop_size) + return crop_size_; +} +inline void ImageDataParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.crop_size) +} + +// optional bool mirror = 6 [default = false]; +inline bool ImageDataParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void ImageDataParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000400u; +} +inline void ImageDataParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000400u; +} +inline void ImageDataParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +inline bool ImageDataParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.mirror) + return mirror_; +} +inline void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.mirror) +} + +// optional string root_folder = 12 [default = ""]; +inline bool ImageDataParameter::has_root_folder() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void ImageDataParameter::set_has_root_folder() { + _has_bits_[0] |= 0x00000800u; +} +inline void ImageDataParameter::clear_has_root_folder() { + _has_bits_[0] &= ~0x00000800u; +} +inline void ImageDataParameter::clear_root_folder() { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_root_folder(); +} +inline const ::std::string& ImageDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:caffe.ImageDataParameter.root_folder) + return root_folder_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ImageDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.ImageDataParameter.root_folder) +} +inline void ImageDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.ImageDataParameter.root_folder) +} +inline void ImageDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.ImageDataParameter.root_folder) +} +inline ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:caffe.ImageDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:caffe.ImageDataParameter.root_folder) + clear_has_root_folder(); + return root_folder_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ImageDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder != NULL) { + set_has_root_folder(); + } else { + clear_has_root_folder(); + } + root_folder_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root_folder); + // @@protoc_insertion_point(field_set_allocated:caffe.ImageDataParameter.root_folder) +} + +inline const ImageDataParameter* ImageDataParameter::internal_default_instance() { + return &ImageDataParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// InfogainLossParameter + +// optional string source = 1; +inline bool InfogainLossParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void InfogainLossParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +inline void InfogainLossParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +inline void InfogainLossParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& InfogainLossParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.InfogainLossParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void InfogainLossParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.InfogainLossParameter.source) +} +inline void InfogainLossParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.InfogainLossParameter.source) +} +inline void InfogainLossParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.InfogainLossParameter.source) +} +inline ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.InfogainLossParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* InfogainLossParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.InfogainLossParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void InfogainLossParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.InfogainLossParameter.source) +} + +inline const InfogainLossParameter* InfogainLossParameter::internal_default_instance() { + return &InfogainLossParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// InnerProductParameter + +// optional uint32 num_output = 1; +inline bool InnerProductParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void InnerProductParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +inline void InnerProductParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +inline void InnerProductParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +inline ::google::protobuf::uint32 InnerProductParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.num_output) + return num_output_; +} +inline void InnerProductParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.num_output) +} + +// optional bool bias_term = 2 [default = true]; +inline bool InnerProductParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void InnerProductParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000002u; +} +inline void InnerProductParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000002u; +} +inline void InnerProductParameter::clear_bias_term() { + bias_term_ = true; + clear_has_bias_term(); +} +inline bool InnerProductParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.bias_term) + return bias_term_; +} +inline void InnerProductParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.bias_term) +} + +// optional .caffe.FillerParameter weight_filler = 3; +inline bool InnerProductParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void InnerProductParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000004u; +} +inline void InnerProductParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000004u; +} +inline void InnerProductParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::caffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +inline ::caffe::FillerParameter* InnerProductParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.InnerProductParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.InnerProductParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 4; +inline bool InnerProductParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void InnerProductParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000008u; +} +inline void InnerProductParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000008u; +} +inline void InnerProductParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::caffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +inline ::caffe::FillerParameter* InnerProductParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.InnerProductParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.InnerProductParameter.bias_filler) +} + +// optional int32 axis = 5 [default = 1]; +inline bool InnerProductParameter::has_axis() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void InnerProductParameter::set_has_axis() { + _has_bits_[0] |= 0x00000010u; +} +inline void InnerProductParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000010u; +} +inline void InnerProductParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 InnerProductParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.axis) + return axis_; +} +inline void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.axis) +} + +// optional bool transpose = 6 [default = false]; +inline bool InnerProductParameter::has_transpose() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void InnerProductParameter::set_has_transpose() { + _has_bits_[0] |= 0x00000020u; +} +inline void InnerProductParameter::clear_has_transpose() { + _has_bits_[0] &= ~0x00000020u; +} +inline void InnerProductParameter::clear_transpose() { + transpose_ = false; + clear_has_transpose(); +} +inline bool InnerProductParameter::transpose() const { + // @@protoc_insertion_point(field_get:caffe.InnerProductParameter.transpose) + return transpose_; +} +inline void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:caffe.InnerProductParameter.transpose) +} + +inline const InnerProductParameter* InnerProductParameter::internal_default_instance() { + return &InnerProductParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// InputParameter + +// repeated .caffe.BlobShape shape = 1; +inline int InputParameter::shape_size() const { + return shape_.size(); +} +inline void InputParameter::clear_shape() { + shape_.Clear(); +} +inline const ::caffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:caffe.InputParameter.shape) + return shape_.Get(index); +} +inline ::caffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:caffe.InputParameter.shape) + return shape_.Mutable(index); +} +inline ::caffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:caffe.InputParameter.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:caffe.InputParameter.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:caffe.InputParameter.shape) + return shape_; +} + +inline const InputParameter* InputParameter::internal_default_instance() { + return &InputParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// LogParameter + +// optional float base = 1 [default = -1]; +inline bool LogParameter::has_base() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void LogParameter::set_has_base() { + _has_bits_[0] |= 0x00000001u; +} +inline void LogParameter::clear_has_base() { + _has_bits_[0] &= ~0x00000001u; +} +inline void LogParameter::clear_base() { + base_ = -1; + clear_has_base(); +} +inline float LogParameter::base() const { + // @@protoc_insertion_point(field_get:caffe.LogParameter.base) + return base_; +} +inline void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:caffe.LogParameter.base) +} + +// optional float scale = 2 [default = 1]; +inline bool LogParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void LogParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +inline void LogParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +inline void LogParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float LogParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.LogParameter.scale) + return scale_; +} +inline void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.LogParameter.scale) +} + +// optional float shift = 3 [default = 0]; +inline bool LogParameter::has_shift() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void LogParameter::set_has_shift() { + _has_bits_[0] |= 0x00000004u; +} +inline void LogParameter::clear_has_shift() { + _has_bits_[0] &= ~0x00000004u; +} +inline void LogParameter::clear_shift() { + shift_ = 0; + clear_has_shift(); +} +inline float LogParameter::shift() const { + // @@protoc_insertion_point(field_get:caffe.LogParameter.shift) + return shift_; +} +inline void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:caffe.LogParameter.shift) +} + +inline const LogParameter* LogParameter::internal_default_instance() { + return &LogParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// LRNParameter + +// optional uint32 local_size = 1 [default = 5]; +inline bool LRNParameter::has_local_size() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void LRNParameter::set_has_local_size() { + _has_bits_[0] |= 0x00000001u; +} +inline void LRNParameter::clear_has_local_size() { + _has_bits_[0] &= ~0x00000001u; +} +inline void LRNParameter::clear_local_size() { + local_size_ = 5u; + clear_has_local_size(); +} +inline ::google::protobuf::uint32 LRNParameter::local_size() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.local_size) + return local_size_; +} +inline void LRNParameter::set_local_size(::google::protobuf::uint32 value) { + set_has_local_size(); + local_size_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.local_size) +} + +// optional float alpha = 2 [default = 1]; +inline bool LRNParameter::has_alpha() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void LRNParameter::set_has_alpha() { + _has_bits_[0] |= 0x00000002u; +} +inline void LRNParameter::clear_has_alpha() { + _has_bits_[0] &= ~0x00000002u; +} +inline void LRNParameter::clear_alpha() { + alpha_ = 1; + clear_has_alpha(); +} +inline float LRNParameter::alpha() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.alpha) + return alpha_; +} +inline void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.alpha) +} + +// optional float beta = 3 [default = 0.75]; +inline bool LRNParameter::has_beta() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void LRNParameter::set_has_beta() { + _has_bits_[0] |= 0x00000004u; +} +inline void LRNParameter::clear_has_beta() { + _has_bits_[0] &= ~0x00000004u; +} +inline void LRNParameter::clear_beta() { + beta_ = 0.75f; + clear_has_beta(); +} +inline float LRNParameter::beta() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.beta) + return beta_; +} +inline void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.beta) +} + +// optional .caffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; +inline bool LRNParameter::has_norm_region() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void LRNParameter::set_has_norm_region() { + _has_bits_[0] |= 0x00000008u; +} +inline void LRNParameter::clear_has_norm_region() { + _has_bits_[0] &= ~0x00000008u; +} +inline void LRNParameter::clear_norm_region() { + norm_region_ = 0; + clear_has_norm_region(); +} +inline ::caffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.norm_region) + return static_cast< ::caffe::LRNParameter_NormRegion >(norm_region_); +} +inline void LRNParameter::set_norm_region(::caffe::LRNParameter_NormRegion value) { + assert(::caffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.norm_region) +} + +// optional float k = 5 [default = 1]; +inline bool LRNParameter::has_k() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void LRNParameter::set_has_k() { + _has_bits_[0] |= 0x00000010u; +} +inline void LRNParameter::clear_has_k() { + _has_bits_[0] &= ~0x00000010u; +} +inline void LRNParameter::clear_k() { + k_ = 1; + clear_has_k(); +} +inline float LRNParameter::k() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.k) + return k_; +} +inline void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.k) +} + +// optional .caffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; +inline bool LRNParameter::has_engine() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void LRNParameter::set_has_engine() { + _has_bits_[0] |= 0x00000020u; +} +inline void LRNParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000020u; +} +inline void LRNParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.LRNParameter.engine) + return static_cast< ::caffe::LRNParameter_Engine >(engine_); +} +inline void LRNParameter::set_engine(::caffe::LRNParameter_Engine value) { + assert(::caffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.LRNParameter.engine) +} + +inline const LRNParameter* LRNParameter::internal_default_instance() { + return &LRNParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// MemoryDataParameter + +// optional uint32 batch_size = 1; +inline bool MemoryDataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MemoryDataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000001u; +} +inline void MemoryDataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MemoryDataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +inline ::google::protobuf::uint32 MemoryDataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.batch_size) + return batch_size_; +} +inline void MemoryDataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.batch_size) +} + +// optional uint32 channels = 2; +inline bool MemoryDataParameter::has_channels() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MemoryDataParameter::set_has_channels() { + _has_bits_[0] |= 0x00000002u; +} +inline void MemoryDataParameter::clear_has_channels() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MemoryDataParameter::clear_channels() { + channels_ = 0u; + clear_has_channels(); +} +inline ::google::protobuf::uint32 MemoryDataParameter::channels() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.channels) + return channels_; +} +inline void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.channels) +} + +// optional uint32 height = 3; +inline bool MemoryDataParameter::has_height() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MemoryDataParameter::set_has_height() { + _has_bits_[0] |= 0x00000004u; +} +inline void MemoryDataParameter::clear_has_height() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MemoryDataParameter::clear_height() { + height_ = 0u; + clear_has_height(); +} +inline ::google::protobuf::uint32 MemoryDataParameter::height() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.height) + return height_; +} +inline void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.height) +} + +// optional uint32 width = 4; +inline bool MemoryDataParameter::has_width() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void MemoryDataParameter::set_has_width() { + _has_bits_[0] |= 0x00000008u; +} +inline void MemoryDataParameter::clear_has_width() { + _has_bits_[0] &= ~0x00000008u; +} +inline void MemoryDataParameter::clear_width() { + width_ = 0u; + clear_has_width(); +} +inline ::google::protobuf::uint32 MemoryDataParameter::width() const { + // @@protoc_insertion_point(field_get:caffe.MemoryDataParameter.width) + return width_; +} +inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:caffe.MemoryDataParameter.width) +} + +inline const MemoryDataParameter* MemoryDataParameter::internal_default_instance() { + return &MemoryDataParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// MVNParameter + +// optional bool normalize_variance = 1 [default = true]; +inline bool MVNParameter::has_normalize_variance() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MVNParameter::set_has_normalize_variance() { + _has_bits_[0] |= 0x00000001u; +} +inline void MVNParameter::clear_has_normalize_variance() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MVNParameter::clear_normalize_variance() { + normalize_variance_ = true; + clear_has_normalize_variance(); +} +inline bool MVNParameter::normalize_variance() const { + // @@protoc_insertion_point(field_get:caffe.MVNParameter.normalize_variance) + return normalize_variance_; +} +inline void MVNParameter::set_normalize_variance(bool value) { + set_has_normalize_variance(); + normalize_variance_ = value; + // @@protoc_insertion_point(field_set:caffe.MVNParameter.normalize_variance) +} + +// optional bool across_channels = 2 [default = false]; +inline bool MVNParameter::has_across_channels() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MVNParameter::set_has_across_channels() { + _has_bits_[0] |= 0x00000002u; +} +inline void MVNParameter::clear_has_across_channels() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MVNParameter::clear_across_channels() { + across_channels_ = false; + clear_has_across_channels(); +} +inline bool MVNParameter::across_channels() const { + // @@protoc_insertion_point(field_get:caffe.MVNParameter.across_channels) + return across_channels_; +} +inline void MVNParameter::set_across_channels(bool value) { + set_has_across_channels(); + across_channels_ = value; + // @@protoc_insertion_point(field_set:caffe.MVNParameter.across_channels) +} + +// optional float eps = 3 [default = 1e-09]; +inline bool MVNParameter::has_eps() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MVNParameter::set_has_eps() { + _has_bits_[0] |= 0x00000004u; +} +inline void MVNParameter::clear_has_eps() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MVNParameter::clear_eps() { + eps_ = 1e-09f; + clear_has_eps(); +} +inline float MVNParameter::eps() const { + // @@protoc_insertion_point(field_get:caffe.MVNParameter.eps) + return eps_; +} +inline void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:caffe.MVNParameter.eps) +} + +inline const MVNParameter* MVNParameter::internal_default_instance() { + return &MVNParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ParameterParameter + +// optional .caffe.BlobShape shape = 1; +inline bool ParameterParameter::has_shape() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ParameterParameter::set_has_shape() { + _has_bits_[0] |= 0x00000001u; +} +inline void ParameterParameter::clear_has_shape() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ParameterParameter::clear_shape() { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::caffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:caffe.ParameterParameter.shape) + return shape_ != NULL ? *shape_ + : *::caffe::BlobShape::internal_default_instance(); +} +inline ::caffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::caffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:caffe.ParameterParameter.shape) + return shape_; +} +inline ::caffe::BlobShape* ParameterParameter::release_shape() { + // @@protoc_insertion_point(field_release:caffe.ParameterParameter.shape) + clear_has_shape(); + ::caffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ParameterParameter::set_allocated_shape(::caffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ParameterParameter.shape) +} + +inline const ParameterParameter* ParameterParameter::internal_default_instance() { + return &ParameterParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// PoolingParameter + +// optional .caffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; +inline bool PoolingParameter::has_pool() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PoolingParameter::set_has_pool() { + _has_bits_[0] |= 0x00000001u; +} +inline void PoolingParameter::clear_has_pool() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PoolingParameter::clear_pool() { + pool_ = 0; + clear_has_pool(); +} +inline ::caffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pool) + return static_cast< ::caffe::PoolingParameter_PoolMethod >(pool_); +} +inline void PoolingParameter::set_pool(::caffe::PoolingParameter_PoolMethod value) { + assert(::caffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pool) +} + +// optional uint32 pad = 4 [default = 0]; +inline bool PoolingParameter::has_pad() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PoolingParameter::set_has_pad() { + _has_bits_[0] |= 0x00000002u; +} +inline void PoolingParameter::clear_has_pad() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PoolingParameter::clear_pad() { + pad_ = 0u; + clear_has_pad(); +} +inline ::google::protobuf::uint32 PoolingParameter::pad() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pad) + return pad_; +} +inline void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pad) +} + +// optional uint32 pad_h = 9 [default = 0]; +inline bool PoolingParameter::has_pad_h() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void PoolingParameter::set_has_pad_h() { + _has_bits_[0] |= 0x00000004u; +} +inline void PoolingParameter::clear_has_pad_h() { + _has_bits_[0] &= ~0x00000004u; +} +inline void PoolingParameter::clear_pad_h() { + pad_h_ = 0u; + clear_has_pad_h(); +} +inline ::google::protobuf::uint32 PoolingParameter::pad_h() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pad_h) + return pad_h_; +} +inline void PoolingParameter::set_pad_h(::google::protobuf::uint32 value) { + set_has_pad_h(); + pad_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pad_h) +} + +// optional uint32 pad_w = 10 [default = 0]; +inline bool PoolingParameter::has_pad_w() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void PoolingParameter::set_has_pad_w() { + _has_bits_[0] |= 0x00000008u; +} +inline void PoolingParameter::clear_has_pad_w() { + _has_bits_[0] &= ~0x00000008u; +} +inline void PoolingParameter::clear_pad_w() { + pad_w_ = 0u; + clear_has_pad_w(); +} +inline ::google::protobuf::uint32 PoolingParameter::pad_w() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.pad_w) + return pad_w_; +} +inline void PoolingParameter::set_pad_w(::google::protobuf::uint32 value) { + set_has_pad_w(); + pad_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.pad_w) +} + +// optional uint32 kernel_size = 2; +inline bool PoolingParameter::has_kernel_size() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void PoolingParameter::set_has_kernel_size() { + _has_bits_[0] |= 0x00000010u; +} +inline void PoolingParameter::clear_has_kernel_size() { + _has_bits_[0] &= ~0x00000010u; +} +inline void PoolingParameter::clear_kernel_size() { + kernel_size_ = 0u; + clear_has_kernel_size(); +} +inline ::google::protobuf::uint32 PoolingParameter::kernel_size() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.kernel_size) + return kernel_size_; +} +inline void PoolingParameter::set_kernel_size(::google::protobuf::uint32 value) { + set_has_kernel_size(); + kernel_size_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.kernel_size) +} + +// optional uint32 kernel_h = 5; +inline bool PoolingParameter::has_kernel_h() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void PoolingParameter::set_has_kernel_h() { + _has_bits_[0] |= 0x00000020u; +} +inline void PoolingParameter::clear_has_kernel_h() { + _has_bits_[0] &= ~0x00000020u; +} +inline void PoolingParameter::clear_kernel_h() { + kernel_h_ = 0u; + clear_has_kernel_h(); +} +inline ::google::protobuf::uint32 PoolingParameter::kernel_h() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.kernel_h) + return kernel_h_; +} +inline void PoolingParameter::set_kernel_h(::google::protobuf::uint32 value) { + set_has_kernel_h(); + kernel_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.kernel_h) +} + +// optional uint32 kernel_w = 6; +inline bool PoolingParameter::has_kernel_w() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void PoolingParameter::set_has_kernel_w() { + _has_bits_[0] |= 0x00000040u; +} +inline void PoolingParameter::clear_has_kernel_w() { + _has_bits_[0] &= ~0x00000040u; +} +inline void PoolingParameter::clear_kernel_w() { + kernel_w_ = 0u; + clear_has_kernel_w(); +} +inline ::google::protobuf::uint32 PoolingParameter::kernel_w() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.kernel_w) + return kernel_w_; +} +inline void PoolingParameter::set_kernel_w(::google::protobuf::uint32 value) { + set_has_kernel_w(); + kernel_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.kernel_w) +} + +// optional uint32 stride = 3 [default = 1]; +inline bool PoolingParameter::has_stride() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void PoolingParameter::set_has_stride() { + _has_bits_[0] |= 0x00000080u; +} +inline void PoolingParameter::clear_has_stride() { + _has_bits_[0] &= ~0x00000080u; +} +inline void PoolingParameter::clear_stride() { + stride_ = 1u; + clear_has_stride(); +} +inline ::google::protobuf::uint32 PoolingParameter::stride() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.stride) + return stride_; +} +inline void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.stride) +} + +// optional uint32 stride_h = 7; +inline bool PoolingParameter::has_stride_h() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void PoolingParameter::set_has_stride_h() { + _has_bits_[0] |= 0x00000100u; +} +inline void PoolingParameter::clear_has_stride_h() { + _has_bits_[0] &= ~0x00000100u; +} +inline void PoolingParameter::clear_stride_h() { + stride_h_ = 0u; + clear_has_stride_h(); +} +inline ::google::protobuf::uint32 PoolingParameter::stride_h() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.stride_h) + return stride_h_; +} +inline void PoolingParameter::set_stride_h(::google::protobuf::uint32 value) { + set_has_stride_h(); + stride_h_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.stride_h) +} + +// optional uint32 stride_w = 8; +inline bool PoolingParameter::has_stride_w() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void PoolingParameter::set_has_stride_w() { + _has_bits_[0] |= 0x00000200u; +} +inline void PoolingParameter::clear_has_stride_w() { + _has_bits_[0] &= ~0x00000200u; +} +inline void PoolingParameter::clear_stride_w() { + stride_w_ = 0u; + clear_has_stride_w(); +} +inline ::google::protobuf::uint32 PoolingParameter::stride_w() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.stride_w) + return stride_w_; +} +inline void PoolingParameter::set_stride_w(::google::protobuf::uint32 value) { + set_has_stride_w(); + stride_w_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.stride_w) +} + +// optional .caffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; +inline bool PoolingParameter::has_engine() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void PoolingParameter::set_has_engine() { + _has_bits_[0] |= 0x00000400u; +} +inline void PoolingParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000400u; +} +inline void PoolingParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.engine) + return static_cast< ::caffe::PoolingParameter_Engine >(engine_); +} +inline void PoolingParameter::set_engine(::caffe::PoolingParameter_Engine value) { + assert(::caffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.engine) +} + +// optional bool global_pooling = 12 [default = false]; +inline bool PoolingParameter::has_global_pooling() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void PoolingParameter::set_has_global_pooling() { + _has_bits_[0] |= 0x00000800u; +} +inline void PoolingParameter::clear_has_global_pooling() { + _has_bits_[0] &= ~0x00000800u; +} +inline void PoolingParameter::clear_global_pooling() { + global_pooling_ = false; + clear_has_global_pooling(); +} +inline bool PoolingParameter::global_pooling() const { + // @@protoc_insertion_point(field_get:caffe.PoolingParameter.global_pooling) + return global_pooling_; +} +inline void PoolingParameter::set_global_pooling(bool value) { + set_has_global_pooling(); + global_pooling_ = value; + // @@protoc_insertion_point(field_set:caffe.PoolingParameter.global_pooling) +} + +inline const PoolingParameter* PoolingParameter::internal_default_instance() { + return &PoolingParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// PowerParameter + +// optional float power = 1 [default = 1]; +inline bool PowerParameter::has_power() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PowerParameter::set_has_power() { + _has_bits_[0] |= 0x00000001u; +} +inline void PowerParameter::clear_has_power() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PowerParameter::clear_power() { + power_ = 1; + clear_has_power(); +} +inline float PowerParameter::power() const { + // @@protoc_insertion_point(field_get:caffe.PowerParameter.power) + return power_; +} +inline void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:caffe.PowerParameter.power) +} + +// optional float scale = 2 [default = 1]; +inline bool PowerParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PowerParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +inline void PowerParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PowerParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float PowerParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.PowerParameter.scale) + return scale_; +} +inline void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.PowerParameter.scale) +} + +// optional float shift = 3 [default = 0]; +inline bool PowerParameter::has_shift() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void PowerParameter::set_has_shift() { + _has_bits_[0] |= 0x00000004u; +} +inline void PowerParameter::clear_has_shift() { + _has_bits_[0] &= ~0x00000004u; +} +inline void PowerParameter::clear_shift() { + shift_ = 0; + clear_has_shift(); +} +inline float PowerParameter::shift() const { + // @@protoc_insertion_point(field_get:caffe.PowerParameter.shift) + return shift_; +} +inline void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:caffe.PowerParameter.shift) +} + +inline const PowerParameter* PowerParameter::internal_default_instance() { + return &PowerParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// PythonParameter + +// optional string module = 1; +inline bool PythonParameter::has_module() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PythonParameter::set_has_module() { + _has_bits_[0] |= 0x00000001u; +} +inline void PythonParameter::clear_has_module() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PythonParameter::clear_module() { + module_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_module(); +} +inline const ::std::string& PythonParameter::module() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.module) + return module_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void PythonParameter::set_module(const ::std::string& value) { + set_has_module(); + module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.PythonParameter.module) +} +inline void PythonParameter::set_module(const char* value) { + set_has_module(); + module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.PythonParameter.module) +} +inline void PythonParameter::set_module(const char* value, size_t size) { + set_has_module(); + module_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.PythonParameter.module) +} +inline ::std::string* PythonParameter::mutable_module() { + set_has_module(); + // @@protoc_insertion_point(field_mutable:caffe.PythonParameter.module) + return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_module() { + // @@protoc_insertion_point(field_release:caffe.PythonParameter.module) + clear_has_module(); + return module_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void PythonParameter::set_allocated_module(::std::string* module) { + if (module != NULL) { + set_has_module(); + } else { + clear_has_module(); + } + module_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), module); + // @@protoc_insertion_point(field_set_allocated:caffe.PythonParameter.module) +} + +// optional string layer = 2; +inline bool PythonParameter::has_layer() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PythonParameter::set_has_layer() { + _has_bits_[0] |= 0x00000002u; +} +inline void PythonParameter::clear_has_layer() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PythonParameter::clear_layer() { + layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_layer(); +} +inline const ::std::string& PythonParameter::layer() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.layer) + return layer_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void PythonParameter::set_layer(const ::std::string& value) { + set_has_layer(); + layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.PythonParameter.layer) +} +inline void PythonParameter::set_layer(const char* value) { + set_has_layer(); + layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.PythonParameter.layer) +} +inline void PythonParameter::set_layer(const char* value, size_t size) { + set_has_layer(); + layer_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.PythonParameter.layer) +} +inline ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + // @@protoc_insertion_point(field_mutable:caffe.PythonParameter.layer) + return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_layer() { + // @@protoc_insertion_point(field_release:caffe.PythonParameter.layer) + clear_has_layer(); + return layer_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void PythonParameter::set_allocated_layer(::std::string* layer) { + if (layer != NULL) { + set_has_layer(); + } else { + clear_has_layer(); + } + layer_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), layer); + // @@protoc_insertion_point(field_set_allocated:caffe.PythonParameter.layer) +} + +// optional string param_str = 3 [default = ""]; +inline bool PythonParameter::has_param_str() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void PythonParameter::set_has_param_str() { + _has_bits_[0] |= 0x00000004u; +} +inline void PythonParameter::clear_has_param_str() { + _has_bits_[0] &= ~0x00000004u; +} +inline void PythonParameter::clear_param_str() { + param_str_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_param_str(); +} +inline const ::std::string& PythonParameter::param_str() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.param_str) + return param_str_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void PythonParameter::set_param_str(const ::std::string& value) { + set_has_param_str(); + param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.PythonParameter.param_str) +} +inline void PythonParameter::set_param_str(const char* value) { + set_has_param_str(); + param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.PythonParameter.param_str) +} +inline void PythonParameter::set_param_str(const char* value, size_t size) { + set_has_param_str(); + param_str_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.PythonParameter.param_str) +} +inline ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + // @@protoc_insertion_point(field_mutable:caffe.PythonParameter.param_str) + return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_param_str() { + // @@protoc_insertion_point(field_release:caffe.PythonParameter.param_str) + clear_has_param_str(); + return param_str_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void PythonParameter::set_allocated_param_str(::std::string* param_str) { + if (param_str != NULL) { + set_has_param_str(); + } else { + clear_has_param_str(); + } + param_str_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), param_str); + // @@protoc_insertion_point(field_set_allocated:caffe.PythonParameter.param_str) +} + +// optional bool share_in_parallel = 4 [default = false]; +inline bool PythonParameter::has_share_in_parallel() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void PythonParameter::set_has_share_in_parallel() { + _has_bits_[0] |= 0x00000008u; +} +inline void PythonParameter::clear_has_share_in_parallel() { + _has_bits_[0] &= ~0x00000008u; +} +inline void PythonParameter::clear_share_in_parallel() { + share_in_parallel_ = false; + clear_has_share_in_parallel(); +} +inline bool PythonParameter::share_in_parallel() const { + // @@protoc_insertion_point(field_get:caffe.PythonParameter.share_in_parallel) + return share_in_parallel_; +} +inline void PythonParameter::set_share_in_parallel(bool value) { + set_has_share_in_parallel(); + share_in_parallel_ = value; + // @@protoc_insertion_point(field_set:caffe.PythonParameter.share_in_parallel) +} + +inline const PythonParameter* PythonParameter::internal_default_instance() { + return &PythonParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// RecurrentParameter + +// optional uint32 num_output = 1 [default = 0]; +inline bool RecurrentParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void RecurrentParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000001u; +} +inline void RecurrentParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000001u; +} +inline void RecurrentParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +inline ::google::protobuf::uint32 RecurrentParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.num_output) + return num_output_; +} +inline void RecurrentParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.RecurrentParameter.num_output) +} + +// optional .caffe.FillerParameter weight_filler = 2; +inline bool RecurrentParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void RecurrentParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000002u; +} +inline void RecurrentParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000002u; +} +inline void RecurrentParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::caffe::FillerParameter& RecurrentParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* RecurrentParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.RecurrentParameter.weight_filler) + return weight_filler_; +} +inline ::caffe::FillerParameter* RecurrentParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.RecurrentParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void RecurrentParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.RecurrentParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 3; +inline bool RecurrentParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void RecurrentParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000004u; +} +inline void RecurrentParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000004u; +} +inline void RecurrentParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::caffe::FillerParameter& RecurrentParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* RecurrentParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.RecurrentParameter.bias_filler) + return bias_filler_; +} +inline ::caffe::FillerParameter* RecurrentParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.RecurrentParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void RecurrentParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.RecurrentParameter.bias_filler) +} + +// optional bool debug_info = 4 [default = false]; +inline bool RecurrentParameter::has_debug_info() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void RecurrentParameter::set_has_debug_info() { + _has_bits_[0] |= 0x00000008u; +} +inline void RecurrentParameter::clear_has_debug_info() { + _has_bits_[0] &= ~0x00000008u; +} +inline void RecurrentParameter::clear_debug_info() { + debug_info_ = false; + clear_has_debug_info(); +} +inline bool RecurrentParameter::debug_info() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.debug_info) + return debug_info_; +} +inline void RecurrentParameter::set_debug_info(bool value) { + set_has_debug_info(); + debug_info_ = value; + // @@protoc_insertion_point(field_set:caffe.RecurrentParameter.debug_info) +} + +// optional bool expose_hidden = 5 [default = false]; +inline bool RecurrentParameter::has_expose_hidden() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void RecurrentParameter::set_has_expose_hidden() { + _has_bits_[0] |= 0x00000010u; +} +inline void RecurrentParameter::clear_has_expose_hidden() { + _has_bits_[0] &= ~0x00000010u; +} +inline void RecurrentParameter::clear_expose_hidden() { + expose_hidden_ = false; + clear_has_expose_hidden(); +} +inline bool RecurrentParameter::expose_hidden() const { + // @@protoc_insertion_point(field_get:caffe.RecurrentParameter.expose_hidden) + return expose_hidden_; +} +inline void RecurrentParameter::set_expose_hidden(bool value) { + set_has_expose_hidden(); + expose_hidden_ = value; + // @@protoc_insertion_point(field_set:caffe.RecurrentParameter.expose_hidden) +} + +inline const RecurrentParameter* RecurrentParameter::internal_default_instance() { + return &RecurrentParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ReductionParameter + +// optional .caffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; +inline bool ReductionParameter::has_operation() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ReductionParameter::set_has_operation() { + _has_bits_[0] |= 0x00000001u; +} +inline void ReductionParameter::clear_has_operation() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ReductionParameter::clear_operation() { + operation_ = 1; + clear_has_operation(); +} +inline ::caffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:caffe.ReductionParameter.operation) + return static_cast< ::caffe::ReductionParameter_ReductionOp >(operation_); +} +inline void ReductionParameter::set_operation(::caffe::ReductionParameter_ReductionOp value) { + assert(::caffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:caffe.ReductionParameter.operation) +} + +// optional int32 axis = 2 [default = 0]; +inline bool ReductionParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ReductionParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +inline void ReductionParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ReductionParameter::clear_axis() { + axis_ = 0; + clear_has_axis(); +} +inline ::google::protobuf::int32 ReductionParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ReductionParameter.axis) + return axis_; +} +inline void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ReductionParameter.axis) +} + +// optional float coeff = 3 [default = 1]; +inline bool ReductionParameter::has_coeff() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ReductionParameter::set_has_coeff() { + _has_bits_[0] |= 0x00000004u; +} +inline void ReductionParameter::clear_has_coeff() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ReductionParameter::clear_coeff() { + coeff_ = 1; + clear_has_coeff(); +} +inline float ReductionParameter::coeff() const { + // @@protoc_insertion_point(field_get:caffe.ReductionParameter.coeff) + return coeff_; +} +inline void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:caffe.ReductionParameter.coeff) +} + +inline const ReductionParameter* ReductionParameter::internal_default_instance() { + return &ReductionParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ReLUParameter + +// optional float negative_slope = 1 [default = 0]; +inline bool ReLUParameter::has_negative_slope() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ReLUParameter::set_has_negative_slope() { + _has_bits_[0] |= 0x00000001u; +} +inline void ReLUParameter::clear_has_negative_slope() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ReLUParameter::clear_negative_slope() { + negative_slope_ = 0; + clear_has_negative_slope(); +} +inline float ReLUParameter::negative_slope() const { + // @@protoc_insertion_point(field_get:caffe.ReLUParameter.negative_slope) + return negative_slope_; +} +inline void ReLUParameter::set_negative_slope(float value) { + set_has_negative_slope(); + negative_slope_ = value; + // @@protoc_insertion_point(field_set:caffe.ReLUParameter.negative_slope) +} + +// optional .caffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; +inline bool ReLUParameter::has_engine() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ReLUParameter::set_has_engine() { + _has_bits_[0] |= 0x00000002u; +} +inline void ReLUParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ReLUParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.ReLUParameter.engine) + return static_cast< ::caffe::ReLUParameter_Engine >(engine_); +} +inline void ReLUParameter::set_engine(::caffe::ReLUParameter_Engine value) { + assert(::caffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.ReLUParameter.engine) +} + +inline const ReLUParameter* ReLUParameter::internal_default_instance() { + return &ReLUParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ReshapeParameter + +// optional .caffe.BlobShape shape = 1; +inline bool ReshapeParameter::has_shape() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ReshapeParameter::set_has_shape() { + _has_bits_[0] |= 0x00000001u; +} +inline void ReshapeParameter::clear_has_shape() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ReshapeParameter::clear_shape() { + if (shape_ != NULL) shape_->::caffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::caffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:caffe.ReshapeParameter.shape) + return shape_ != NULL ? *shape_ + : *::caffe::BlobShape::internal_default_instance(); +} +inline ::caffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::caffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:caffe.ReshapeParameter.shape) + return shape_; +} +inline ::caffe::BlobShape* ReshapeParameter::release_shape() { + // @@protoc_insertion_point(field_release:caffe.ReshapeParameter.shape) + clear_has_shape(); + ::caffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ReshapeParameter::set_allocated_shape(::caffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ReshapeParameter.shape) +} + +// optional int32 axis = 2 [default = 0]; +inline bool ReshapeParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ReshapeParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +inline void ReshapeParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ReshapeParameter::clear_axis() { + axis_ = 0; + clear_has_axis(); +} +inline ::google::protobuf::int32 ReshapeParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ReshapeParameter.axis) + return axis_; +} +inline void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ReshapeParameter.axis) +} + +// optional int32 num_axes = 3 [default = -1]; +inline bool ReshapeParameter::has_num_axes() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ReshapeParameter::set_has_num_axes() { + _has_bits_[0] |= 0x00000004u; +} +inline void ReshapeParameter::clear_has_num_axes() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ReshapeParameter::clear_num_axes() { + num_axes_ = -1; + clear_has_num_axes(); +} +inline ::google::protobuf::int32 ReshapeParameter::num_axes() const { + // @@protoc_insertion_point(field_get:caffe.ReshapeParameter.num_axes) + return num_axes_; +} +inline void ReshapeParameter::set_num_axes(::google::protobuf::int32 value) { + set_has_num_axes(); + num_axes_ = value; + // @@protoc_insertion_point(field_set:caffe.ReshapeParameter.num_axes) +} + +inline const ReshapeParameter* ReshapeParameter::internal_default_instance() { + return &ReshapeParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ScaleParameter + +// optional int32 axis = 1 [default = 1]; +inline bool ScaleParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ScaleParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void ScaleParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ScaleParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 ScaleParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.axis) + return axis_; +} +inline void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.ScaleParameter.axis) +} + +// optional int32 num_axes = 2 [default = 1]; +inline bool ScaleParameter::has_num_axes() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ScaleParameter::set_has_num_axes() { + _has_bits_[0] |= 0x00000002u; +} +inline void ScaleParameter::clear_has_num_axes() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ScaleParameter::clear_num_axes() { + num_axes_ = 1; + clear_has_num_axes(); +} +inline ::google::protobuf::int32 ScaleParameter::num_axes() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.num_axes) + return num_axes_; +} +inline void ScaleParameter::set_num_axes(::google::protobuf::int32 value) { + set_has_num_axes(); + num_axes_ = value; + // @@protoc_insertion_point(field_set:caffe.ScaleParameter.num_axes) +} + +// optional .caffe.FillerParameter filler = 3; +inline bool ScaleParameter::has_filler() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ScaleParameter::set_has_filler() { + _has_bits_[0] |= 0x00000004u; +} +inline void ScaleParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ScaleParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::caffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.filler) + return filler_ != NULL ? *filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ScaleParameter.filler) + return filler_; +} +inline ::caffe::FillerParameter* ScaleParameter::release_filler() { + // @@protoc_insertion_point(field_release:caffe.ScaleParameter.filler) + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ScaleParameter.filler) +} + +// optional bool bias_term = 4 [default = false]; +inline bool ScaleParameter::has_bias_term() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ScaleParameter::set_has_bias_term() { + _has_bits_[0] |= 0x00000008u; +} +inline void ScaleParameter::clear_has_bias_term() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ScaleParameter::clear_bias_term() { + bias_term_ = false; + clear_has_bias_term(); +} +inline bool ScaleParameter::bias_term() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.bias_term) + return bias_term_; +} +inline void ScaleParameter::set_bias_term(bool value) { + set_has_bias_term(); + bias_term_ = value; + // @@protoc_insertion_point(field_set:caffe.ScaleParameter.bias_term) +} + +// optional .caffe.FillerParameter bias_filler = 5; +inline bool ScaleParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ScaleParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000010u; +} +inline void ScaleParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ScaleParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::caffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.ScaleParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.ScaleParameter.bias_filler) + return bias_filler_; +} +inline ::caffe::FillerParameter* ScaleParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.ScaleParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.ScaleParameter.bias_filler) +} + +inline const ScaleParameter* ScaleParameter::internal_default_instance() { + return &ScaleParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SigmoidParameter + +// optional .caffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; +inline bool SigmoidParameter::has_engine() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SigmoidParameter::set_has_engine() { + _has_bits_[0] |= 0x00000001u; +} +inline void SigmoidParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SigmoidParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.SigmoidParameter.engine) + return static_cast< ::caffe::SigmoidParameter_Engine >(engine_); +} +inline void SigmoidParameter::set_engine(::caffe::SigmoidParameter_Engine value) { + assert(::caffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.SigmoidParameter.engine) +} + +inline const SigmoidParameter* SigmoidParameter::internal_default_instance() { + return &SigmoidParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SliceParameter + +// optional int32 axis = 3 [default = 1]; +inline bool SliceParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SliceParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void SliceParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SliceParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 SliceParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.SliceParameter.axis) + return axis_; +} +inline void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.SliceParameter.axis) +} + +// repeated uint32 slice_point = 2; +inline int SliceParameter::slice_point_size() const { + return slice_point_.size(); +} +inline void SliceParameter::clear_slice_point() { + slice_point_.Clear(); +} +inline ::google::protobuf::uint32 SliceParameter::slice_point(int index) const { + // @@protoc_insertion_point(field_get:caffe.SliceParameter.slice_point) + return slice_point_.Get(index); +} +inline void SliceParameter::set_slice_point(int index, ::google::protobuf::uint32 value) { + slice_point_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.SliceParameter.slice_point) +} +inline void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:caffe.SliceParameter.slice_point) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:caffe.SliceParameter.slice_point) + return slice_point_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:caffe.SliceParameter.slice_point) + return &slice_point_; +} + +// optional uint32 slice_dim = 1 [default = 1]; +inline bool SliceParameter::has_slice_dim() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SliceParameter::set_has_slice_dim() { + _has_bits_[0] |= 0x00000004u; +} +inline void SliceParameter::clear_has_slice_dim() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SliceParameter::clear_slice_dim() { + slice_dim_ = 1u; + clear_has_slice_dim(); +} +inline ::google::protobuf::uint32 SliceParameter::slice_dim() const { + // @@protoc_insertion_point(field_get:caffe.SliceParameter.slice_dim) + return slice_dim_; +} +inline void SliceParameter::set_slice_dim(::google::protobuf::uint32 value) { + set_has_slice_dim(); + slice_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.SliceParameter.slice_dim) +} + +inline const SliceParameter* SliceParameter::internal_default_instance() { + return &SliceParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SoftmaxParameter + +// optional .caffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; +inline bool SoftmaxParameter::has_engine() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SoftmaxParameter::set_has_engine() { + _has_bits_[0] |= 0x00000001u; +} +inline void SoftmaxParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SoftmaxParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.SoftmaxParameter.engine) + return static_cast< ::caffe::SoftmaxParameter_Engine >(engine_); +} +inline void SoftmaxParameter::set_engine(::caffe::SoftmaxParameter_Engine value) { + assert(::caffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.SoftmaxParameter.engine) +} + +// optional int32 axis = 2 [default = 1]; +inline bool SoftmaxParameter::has_axis() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SoftmaxParameter::set_has_axis() { + _has_bits_[0] |= 0x00000002u; +} +inline void SoftmaxParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SoftmaxParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 SoftmaxParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.SoftmaxParameter.axis) + return axis_; +} +inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.SoftmaxParameter.axis) +} + +inline const SoftmaxParameter* SoftmaxParameter::internal_default_instance() { + return &SoftmaxParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// TanHParameter + +// optional .caffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; +inline bool TanHParameter::has_engine() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TanHParameter::set_has_engine() { + _has_bits_[0] |= 0x00000001u; +} +inline void TanHParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TanHParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.TanHParameter.engine) + return static_cast< ::caffe::TanHParameter_Engine >(engine_); +} +inline void TanHParameter::set_engine(::caffe::TanHParameter_Engine value) { + assert(::caffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.TanHParameter.engine) +} + +inline const TanHParameter* TanHParameter::internal_default_instance() { + return &TanHParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// TileParameter + +// optional int32 axis = 1 [default = 1]; +inline bool TileParameter::has_axis() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TileParameter::set_has_axis() { + _has_bits_[0] |= 0x00000001u; +} +inline void TileParameter::clear_has_axis() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TileParameter::clear_axis() { + axis_ = 1; + clear_has_axis(); +} +inline ::google::protobuf::int32 TileParameter::axis() const { + // @@protoc_insertion_point(field_get:caffe.TileParameter.axis) + return axis_; +} +inline void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:caffe.TileParameter.axis) +} + +// optional int32 tiles = 2; +inline bool TileParameter::has_tiles() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void TileParameter::set_has_tiles() { + _has_bits_[0] |= 0x00000002u; +} +inline void TileParameter::clear_has_tiles() { + _has_bits_[0] &= ~0x00000002u; +} +inline void TileParameter::clear_tiles() { + tiles_ = 0; + clear_has_tiles(); +} +inline ::google::protobuf::int32 TileParameter::tiles() const { + // @@protoc_insertion_point(field_get:caffe.TileParameter.tiles) + return tiles_; +} +inline void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:caffe.TileParameter.tiles) +} + +inline const TileParameter* TileParameter::internal_default_instance() { + return &TileParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// ThresholdParameter + +// optional float threshold = 1 [default = 0]; +inline bool ThresholdParameter::has_threshold() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ThresholdParameter::set_has_threshold() { + _has_bits_[0] |= 0x00000001u; +} +inline void ThresholdParameter::clear_has_threshold() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ThresholdParameter::clear_threshold() { + threshold_ = 0; + clear_has_threshold(); +} +inline float ThresholdParameter::threshold() const { + // @@protoc_insertion_point(field_get:caffe.ThresholdParameter.threshold) + return threshold_; +} +inline void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.ThresholdParameter.threshold) +} + +inline const ThresholdParameter* ThresholdParameter::internal_default_instance() { + return &ThresholdParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// WindowDataParameter + +// optional string source = 1; +inline bool WindowDataParameter::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void WindowDataParameter::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +inline void WindowDataParameter::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +inline void WindowDataParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& WindowDataParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void WindowDataParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.source) +} +inline void WindowDataParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.source) +} +inline void WindowDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.source) +} +inline ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void WindowDataParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.source) +} + +// optional float scale = 2 [default = 1]; +inline bool WindowDataParameter::has_scale() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void WindowDataParameter::set_has_scale() { + _has_bits_[0] |= 0x00000002u; +} +inline void WindowDataParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00000002u; +} +inline void WindowDataParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float WindowDataParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.scale) + return scale_; +} +inline void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.scale) +} + +// optional string mean_file = 3; +inline bool WindowDataParameter::has_mean_file() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void WindowDataParameter::set_has_mean_file() { + _has_bits_[0] |= 0x00000004u; +} +inline void WindowDataParameter::clear_has_mean_file() { + _has_bits_[0] &= ~0x00000004u; +} +inline void WindowDataParameter::clear_mean_file() { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_mean_file(); +} +inline const ::std::string& WindowDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.mean_file) + return mean_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void WindowDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.mean_file) +} +inline void WindowDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.mean_file) +} +inline void WindowDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + mean_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.mean_file) +} +inline ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.mean_file) + clear_has_mean_file(); + return mean_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void WindowDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file != NULL) { + set_has_mean_file(); + } else { + clear_has_mean_file(); + } + mean_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), mean_file); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.mean_file) +} + +// optional uint32 batch_size = 4; +inline bool WindowDataParameter::has_batch_size() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void WindowDataParameter::set_has_batch_size() { + _has_bits_[0] |= 0x00000008u; +} +inline void WindowDataParameter::clear_has_batch_size() { + _has_bits_[0] &= ~0x00000008u; +} +inline void WindowDataParameter::clear_batch_size() { + batch_size_ = 0u; + clear_has_batch_size(); +} +inline ::google::protobuf::uint32 WindowDataParameter::batch_size() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.batch_size) + return batch_size_; +} +inline void WindowDataParameter::set_batch_size(::google::protobuf::uint32 value) { + set_has_batch_size(); + batch_size_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.batch_size) +} + +// optional uint32 crop_size = 5 [default = 0]; +inline bool WindowDataParameter::has_crop_size() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void WindowDataParameter::set_has_crop_size() { + _has_bits_[0] |= 0x00000010u; +} +inline void WindowDataParameter::clear_has_crop_size() { + _has_bits_[0] &= ~0x00000010u; +} +inline void WindowDataParameter::clear_crop_size() { + crop_size_ = 0u; + clear_has_crop_size(); +} +inline ::google::protobuf::uint32 WindowDataParameter::crop_size() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.crop_size) + return crop_size_; +} +inline void WindowDataParameter::set_crop_size(::google::protobuf::uint32 value) { + set_has_crop_size(); + crop_size_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.crop_size) +} + +// optional bool mirror = 6 [default = false]; +inline bool WindowDataParameter::has_mirror() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void WindowDataParameter::set_has_mirror() { + _has_bits_[0] |= 0x00000020u; +} +inline void WindowDataParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00000020u; +} +inline void WindowDataParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +inline bool WindowDataParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.mirror) + return mirror_; +} +inline void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.mirror) +} + +// optional float fg_threshold = 7 [default = 0.5]; +inline bool WindowDataParameter::has_fg_threshold() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void WindowDataParameter::set_has_fg_threshold() { + _has_bits_[0] |= 0x00000040u; +} +inline void WindowDataParameter::clear_has_fg_threshold() { + _has_bits_[0] &= ~0x00000040u; +} +inline void WindowDataParameter::clear_fg_threshold() { + fg_threshold_ = 0.5f; + clear_has_fg_threshold(); +} +inline float WindowDataParameter::fg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.fg_threshold) + return fg_threshold_; +} +inline void WindowDataParameter::set_fg_threshold(float value) { + set_has_fg_threshold(); + fg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.fg_threshold) +} + +// optional float bg_threshold = 8 [default = 0.5]; +inline bool WindowDataParameter::has_bg_threshold() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void WindowDataParameter::set_has_bg_threshold() { + _has_bits_[0] |= 0x00000080u; +} +inline void WindowDataParameter::clear_has_bg_threshold() { + _has_bits_[0] &= ~0x00000080u; +} +inline void WindowDataParameter::clear_bg_threshold() { + bg_threshold_ = 0.5f; + clear_has_bg_threshold(); +} +inline float WindowDataParameter::bg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.bg_threshold) + return bg_threshold_; +} +inline void WindowDataParameter::set_bg_threshold(float value) { + set_has_bg_threshold(); + bg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.bg_threshold) +} + +// optional float fg_fraction = 9 [default = 0.25]; +inline bool WindowDataParameter::has_fg_fraction() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void WindowDataParameter::set_has_fg_fraction() { + _has_bits_[0] |= 0x00000100u; +} +inline void WindowDataParameter::clear_has_fg_fraction() { + _has_bits_[0] &= ~0x00000100u; +} +inline void WindowDataParameter::clear_fg_fraction() { + fg_fraction_ = 0.25f; + clear_has_fg_fraction(); +} +inline float WindowDataParameter::fg_fraction() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.fg_fraction) + return fg_fraction_; +} +inline void WindowDataParameter::set_fg_fraction(float value) { + set_has_fg_fraction(); + fg_fraction_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.fg_fraction) +} + +// optional uint32 context_pad = 10 [default = 0]; +inline bool WindowDataParameter::has_context_pad() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void WindowDataParameter::set_has_context_pad() { + _has_bits_[0] |= 0x00000200u; +} +inline void WindowDataParameter::clear_has_context_pad() { + _has_bits_[0] &= ~0x00000200u; +} +inline void WindowDataParameter::clear_context_pad() { + context_pad_ = 0u; + clear_has_context_pad(); +} +inline ::google::protobuf::uint32 WindowDataParameter::context_pad() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.context_pad) + return context_pad_; +} +inline void WindowDataParameter::set_context_pad(::google::protobuf::uint32 value) { + set_has_context_pad(); + context_pad_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.context_pad) +} + +// optional string crop_mode = 11 [default = "warp"]; +inline bool WindowDataParameter::has_crop_mode() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void WindowDataParameter::set_has_crop_mode() { + _has_bits_[0] |= 0x00000400u; +} +inline void WindowDataParameter::clear_has_crop_mode() { + _has_bits_[0] &= ~0x00000400u; +} +inline void WindowDataParameter::clear_crop_mode() { + crop_mode_.ClearToDefaultNoArena(_default_crop_mode_); + clear_has_crop_mode(); +} +inline const ::std::string& WindowDataParameter::crop_mode() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.crop_mode) + return crop_mode_.GetNoArena(_default_crop_mode_); +} +inline void WindowDataParameter::set_crop_mode(const ::std::string& value) { + set_has_crop_mode(); + crop_mode_.SetNoArena(_default_crop_mode_, value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.crop_mode) +} +inline void WindowDataParameter::set_crop_mode(const char* value) { + set_has_crop_mode(); + crop_mode_.SetNoArena(_default_crop_mode_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.crop_mode) +} +inline void WindowDataParameter::set_crop_mode(const char* value, size_t size) { + set_has_crop_mode(); + crop_mode_.SetNoArena(_default_crop_mode_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.crop_mode) +} +inline ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.crop_mode) + return crop_mode_.MutableNoArena(_default_crop_mode_); +} +inline ::std::string* WindowDataParameter::release_crop_mode() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.crop_mode) + clear_has_crop_mode(); + return crop_mode_.ReleaseNoArena(_default_crop_mode_); +} +inline void WindowDataParameter::set_allocated_crop_mode(::std::string* crop_mode) { + if (crop_mode != NULL) { + set_has_crop_mode(); + } else { + clear_has_crop_mode(); + } + crop_mode_.SetAllocatedNoArena(_default_crop_mode_, crop_mode); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.crop_mode) +} + +// optional bool cache_images = 12 [default = false]; +inline bool WindowDataParameter::has_cache_images() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void WindowDataParameter::set_has_cache_images() { + _has_bits_[0] |= 0x00000800u; +} +inline void WindowDataParameter::clear_has_cache_images() { + _has_bits_[0] &= ~0x00000800u; +} +inline void WindowDataParameter::clear_cache_images() { + cache_images_ = false; + clear_has_cache_images(); +} +inline bool WindowDataParameter::cache_images() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.cache_images) + return cache_images_; +} +inline void WindowDataParameter::set_cache_images(bool value) { + set_has_cache_images(); + cache_images_ = value; + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.cache_images) +} + +// optional string root_folder = 13 [default = ""]; +inline bool WindowDataParameter::has_root_folder() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void WindowDataParameter::set_has_root_folder() { + _has_bits_[0] |= 0x00001000u; +} +inline void WindowDataParameter::clear_has_root_folder() { + _has_bits_[0] &= ~0x00001000u; +} +inline void WindowDataParameter::clear_root_folder() { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_root_folder(); +} +inline const ::std::string& WindowDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:caffe.WindowDataParameter.root_folder) + return root_folder_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void WindowDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.WindowDataParameter.root_folder) +} +inline void WindowDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.WindowDataParameter.root_folder) +} +inline void WindowDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + root_folder_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.WindowDataParameter.root_folder) +} +inline ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:caffe.WindowDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:caffe.WindowDataParameter.root_folder) + clear_has_root_folder(); + return root_folder_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void WindowDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder != NULL) { + set_has_root_folder(); + } else { + clear_has_root_folder(); + } + root_folder_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), root_folder); + // @@protoc_insertion_point(field_set_allocated:caffe.WindowDataParameter.root_folder) +} + +inline const WindowDataParameter* WindowDataParameter::internal_default_instance() { + return &WindowDataParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// SPPParameter + +// optional uint32 pyramid_height = 1; +inline bool SPPParameter::has_pyramid_height() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SPPParameter::set_has_pyramid_height() { + _has_bits_[0] |= 0x00000001u; +} +inline void SPPParameter::clear_has_pyramid_height() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SPPParameter::clear_pyramid_height() { + pyramid_height_ = 0u; + clear_has_pyramid_height(); +} +inline ::google::protobuf::uint32 SPPParameter::pyramid_height() const { + // @@protoc_insertion_point(field_get:caffe.SPPParameter.pyramid_height) + return pyramid_height_; +} +inline void SPPParameter::set_pyramid_height(::google::protobuf::uint32 value) { + set_has_pyramid_height(); + pyramid_height_ = value; + // @@protoc_insertion_point(field_set:caffe.SPPParameter.pyramid_height) +} + +// optional .caffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; +inline bool SPPParameter::has_pool() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SPPParameter::set_has_pool() { + _has_bits_[0] |= 0x00000002u; +} +inline void SPPParameter::clear_has_pool() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SPPParameter::clear_pool() { + pool_ = 0; + clear_has_pool(); +} +inline ::caffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:caffe.SPPParameter.pool) + return static_cast< ::caffe::SPPParameter_PoolMethod >(pool_); +} +inline void SPPParameter::set_pool(::caffe::SPPParameter_PoolMethod value) { + assert(::caffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:caffe.SPPParameter.pool) +} + +// optional .caffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; +inline bool SPPParameter::has_engine() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SPPParameter::set_has_engine() { + _has_bits_[0] |= 0x00000004u; +} +inline void SPPParameter::clear_has_engine() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SPPParameter::clear_engine() { + engine_ = 0; + clear_has_engine(); +} +inline ::caffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:caffe.SPPParameter.engine) + return static_cast< ::caffe::SPPParameter_Engine >(engine_); +} +inline void SPPParameter::set_engine(::caffe::SPPParameter_Engine value) { + assert(::caffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:caffe.SPPParameter.engine) +} + +inline const SPPParameter* SPPParameter::internal_default_instance() { + return &SPPParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// V1LayerParameter + +// repeated string bottom = 2; +inline int V1LayerParameter::bottom_size() const { + return bottom_.size(); +} +inline void V1LayerParameter::clear_bottom() { + bottom_.Clear(); +} +inline const ::std::string& V1LayerParameter::bottom(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.bottom) + bottom_.Mutable(index)->assign(value); +} +inline void V1LayerParameter::set_bottom(int index, const char* value) { + bottom_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::set_bottom(int index, const char* value, size_t size) { + bottom_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.bottom) +} +inline ::std::string* V1LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:caffe.V1LayerParameter.bottom) + return bottom_.Add(); +} +inline void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::add_bottom(const char* value, size_t size) { + bottom_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.V1LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.bottom) + return &bottom_; +} + +// repeated string top = 3; +inline int V1LayerParameter::top_size() const { + return top_.size(); +} +inline void V1LayerParameter::clear_top() { + top_.Clear(); +} +inline const ::std::string& V1LayerParameter::top(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.top) + return top_.Mutable(index); +} +inline void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.top) + top_.Mutable(index)->assign(value); +} +inline void V1LayerParameter::set_top(int index, const char* value) { + top_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.top) +} +inline void V1LayerParameter::set_top(int index, const char* value, size_t size) { + top_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.top) +} +inline ::std::string* V1LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:caffe.V1LayerParameter.top) + return top_.Add(); +} +inline void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.top) +} +inline void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.V1LayerParameter.top) +} +inline void V1LayerParameter::add_top(const char* value, size_t size) { + top_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.V1LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.top) + return &top_; +} + +// optional string name = 4; +inline bool V1LayerParameter::has_name() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void V1LayerParameter::set_has_name() { + _has_bits_[0] |= 0x00000004u; +} +inline void V1LayerParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000004u; +} +inline void V1LayerParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& V1LayerParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V1LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.name) +} +inline void V1LayerParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.name) +} +inline void V1LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.name) +} +inline ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V1LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V1LayerParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.name) +} + +// repeated .caffe.NetStateRule include = 32; +inline int V1LayerParameter::include_size() const { + return include_.size(); +} +inline void V1LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::caffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.include) + return include_.Get(index); +} +inline ::caffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.include) + return include_.Mutable(index); +} +inline ::caffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.include) + return include_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.include) + return &include_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.include) + return include_; +} + +// repeated .caffe.NetStateRule exclude = 33; +inline int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::caffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::caffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::caffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.exclude) + return &exclude_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.exclude) + return exclude_; +} + +// optional .caffe.V1LayerParameter.LayerType type = 5; +inline bool V1LayerParameter::has_type() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void V1LayerParameter::set_has_type() { + _has_bits_[0] |= 0x00000020u; +} +inline void V1LayerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000020u; +} +inline void V1LayerParameter::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::caffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.type) + return static_cast< ::caffe::V1LayerParameter_LayerType >(type_); +} +inline void V1LayerParameter::set_type(::caffe::V1LayerParameter_LayerType value) { + assert(::caffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.type) +} + +// repeated .caffe.BlobProto blobs = 6; +inline int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::caffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::caffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::caffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.blobs) + return blobs_; +} + +// repeated string param = 1001; +inline int V1LayerParameter::param_size() const { + return param_.size(); +} +inline void V1LayerParameter::clear_param() { + param_.Clear(); +} +inline const ::std::string& V1LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.param) + return param_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.param) + return param_.Mutable(index); +} +inline void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.param) + param_.Mutable(index)->assign(value); +} +inline void V1LayerParameter::set_param(int index, const char* value) { + param_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:caffe.V1LayerParameter.param) +} +inline void V1LayerParameter::set_param(int index, const char* value, size_t size) { + param_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:caffe.V1LayerParameter.param) +} +inline ::std::string* V1LayerParameter::add_param() { + // @@protoc_insertion_point(field_add_mutable:caffe.V1LayerParameter.param) + return param_.Add(); +} +inline void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.param) +} +inline void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:caffe.V1LayerParameter.param) +} +inline void V1LayerParameter::add_param(const char* value, size_t size) { + param_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:caffe.V1LayerParameter.param) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .caffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; +inline int V1LayerParameter::blob_share_mode_size() const { + return blob_share_mode_.size(); +} +inline void V1LayerParameter::clear_blob_share_mode() { + blob_share_mode_.Clear(); +} +inline ::caffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.blob_share_mode) + return static_cast< ::caffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} +inline void V1LayerParameter::set_blob_share_mode(int index, ::caffe::V1LayerParameter_DimCheckMode value) { + assert(::caffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.blob_share_mode) +} +inline void V1LayerParameter::add_blob_share_mode(::caffe::V1LayerParameter_DimCheckMode value) { + assert(::caffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.blob_share_mode) +} +inline const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} +inline ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.blob_share_mode) + return &blob_share_mode_; +} + +// repeated float blobs_lr = 7; +inline int V1LayerParameter::blobs_lr_size() const { + return blobs_lr_.size(); +} +inline void V1LayerParameter::clear_blobs_lr() { + blobs_lr_.Clear(); +} +inline float V1LayerParameter::blobs_lr(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.blobs_lr) + return blobs_lr_.Get(index); +} +inline void V1LayerParameter::set_blobs_lr(int index, float value) { + blobs_lr_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.blobs_lr) +} +inline void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.blobs_lr) + return &blobs_lr_; +} + +// repeated float weight_decay = 8; +inline int V1LayerParameter::weight_decay_size() const { + return weight_decay_.size(); +} +inline void V1LayerParameter::clear_weight_decay() { + weight_decay_.Clear(); +} +inline float V1LayerParameter::weight_decay(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.weight_decay) + return weight_decay_.Get(index); +} +inline void V1LayerParameter::set_weight_decay(int index, float value) { + weight_decay_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.weight_decay) +} +inline void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.weight_decay) + return &weight_decay_; +} + +// repeated float loss_weight = 35; +inline int V1LayerParameter::loss_weight_size() const { + return loss_weight_.size(); +} +inline void V1LayerParameter::clear_loss_weight() { + loss_weight_.Clear(); +} +inline float V1LayerParameter::loss_weight(int index) const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.loss_weight) + return loss_weight_.Get(index); +} +inline void V1LayerParameter::set_loss_weight(int index, float value) { + loss_weight_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V1LayerParameter.loss_weight) +} +inline void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V1LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:caffe.V1LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:caffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .caffe.AccuracyParameter accuracy_param = 27; +inline bool V1LayerParameter::has_accuracy_param() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void V1LayerParameter::set_has_accuracy_param() { + _has_bits_[0] |= 0x00001000u; +} +inline void V1LayerParameter::clear_has_accuracy_param() { + _has_bits_[0] &= ~0x00001000u; +} +inline void V1LayerParameter::clear_accuracy_param() { + if (accuracy_param_ != NULL) accuracy_param_->::caffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::caffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ + : *::caffe::AccuracyParameter::internal_default_instance(); +} +inline ::caffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::caffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::caffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::caffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_accuracy_param(::caffe::AccuracyParameter* accuracy_param) { + delete accuracy_param_; + accuracy_param_ = accuracy_param; + if (accuracy_param) { + set_has_accuracy_param(); + } else { + clear_has_accuracy_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.accuracy_param) +} + +// optional .caffe.ArgMaxParameter argmax_param = 23; +inline bool V1LayerParameter::has_argmax_param() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void V1LayerParameter::set_has_argmax_param() { + _has_bits_[0] |= 0x00002000u; +} +inline void V1LayerParameter::clear_has_argmax_param() { + _has_bits_[0] &= ~0x00002000u; +} +inline void V1LayerParameter::clear_argmax_param() { + if (argmax_param_ != NULL) argmax_param_->::caffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::caffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ + : *::caffe::ArgMaxParameter::internal_default_instance(); +} +inline ::caffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::caffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +inline ::caffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.argmax_param) + clear_has_argmax_param(); + ::caffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_argmax_param(::caffe::ArgMaxParameter* argmax_param) { + delete argmax_param_; + argmax_param_ = argmax_param; + if (argmax_param) { + set_has_argmax_param(); + } else { + clear_has_argmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.argmax_param) +} + +// optional .caffe.ConcatParameter concat_param = 9; +inline bool V1LayerParameter::has_concat_param() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void V1LayerParameter::set_has_concat_param() { + _has_bits_[0] |= 0x00004000u; +} +inline void V1LayerParameter::clear_has_concat_param() { + _has_bits_[0] &= ~0x00004000u; +} +inline void V1LayerParameter::clear_concat_param() { + if (concat_param_ != NULL) concat_param_->::caffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::caffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ + : *::caffe::ConcatParameter::internal_default_instance(); +} +inline ::caffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::caffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.concat_param) + return concat_param_; +} +inline ::caffe::ConcatParameter* V1LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.concat_param) + clear_has_concat_param(); + ::caffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_concat_param(::caffe::ConcatParameter* concat_param) { + delete concat_param_; + concat_param_ = concat_param; + if (concat_param) { + set_has_concat_param(); + } else { + clear_has_concat_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.concat_param) +} + +// optional .caffe.ContrastiveLossParameter contrastive_loss_param = 40; +inline bool V1LayerParameter::has_contrastive_loss_param() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void V1LayerParameter::set_has_contrastive_loss_param() { + _has_bits_[0] |= 0x00008000u; +} +inline void V1LayerParameter::clear_has_contrastive_loss_param() { + _has_bits_[0] &= ~0x00008000u; +} +inline void V1LayerParameter::clear_contrastive_loss_param() { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::caffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::caffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ + : *::caffe::ContrastiveLossParameter::internal_default_instance(); +} +inline ::caffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::caffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::caffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::caffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_contrastive_loss_param(::caffe::ContrastiveLossParameter* contrastive_loss_param) { + delete contrastive_loss_param_; + contrastive_loss_param_ = contrastive_loss_param; + if (contrastive_loss_param) { + set_has_contrastive_loss_param(); + } else { + clear_has_contrastive_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .caffe.ConvolutionParameter convolution_param = 10; +inline bool V1LayerParameter::has_convolution_param() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void V1LayerParameter::set_has_convolution_param() { + _has_bits_[0] |= 0x00010000u; +} +inline void V1LayerParameter::clear_has_convolution_param() { + _has_bits_[0] &= ~0x00010000u; +} +inline void V1LayerParameter::clear_convolution_param() { + if (convolution_param_ != NULL) convolution_param_->::caffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::caffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ + : *::caffe::ConvolutionParameter::internal_default_instance(); +} +inline ::caffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::caffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +inline ::caffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.convolution_param) + clear_has_convolution_param(); + ::caffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_convolution_param(::caffe::ConvolutionParameter* convolution_param) { + delete convolution_param_; + convolution_param_ = convolution_param; + if (convolution_param) { + set_has_convolution_param(); + } else { + clear_has_convolution_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.convolution_param) +} + +// optional .caffe.DataParameter data_param = 11; +inline bool V1LayerParameter::has_data_param() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void V1LayerParameter::set_has_data_param() { + _has_bits_[0] |= 0x00020000u; +} +inline void V1LayerParameter::clear_has_data_param() { + _has_bits_[0] &= ~0x00020000u; +} +inline void V1LayerParameter::clear_data_param() { + if (data_param_ != NULL) data_param_->::caffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::caffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ + : *::caffe::DataParameter::internal_default_instance(); +} +inline ::caffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::caffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.data_param) + return data_param_; +} +inline ::caffe::DataParameter* V1LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.data_param) + clear_has_data_param(); + ::caffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_data_param(::caffe::DataParameter* data_param) { + delete data_param_; + data_param_ = data_param; + if (data_param) { + set_has_data_param(); + } else { + clear_has_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.data_param) +} + +// optional .caffe.DropoutParameter dropout_param = 12; +inline bool V1LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void V1LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00040000u; +} +inline void V1LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00040000u; +} +inline void V1LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::caffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::caffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ + : *::caffe::DropoutParameter::internal_default_instance(); +} +inline ::caffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::caffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +inline ::caffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.dropout_param) + clear_has_dropout_param(); + ::caffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dropout_param(::caffe::DropoutParameter* dropout_param) { + delete dropout_param_; + dropout_param_ = dropout_param; + if (dropout_param) { + set_has_dropout_param(); + } else { + clear_has_dropout_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.dropout_param) +} + +// optional .caffe.DummyDataParameter dummy_data_param = 26; +inline bool V1LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +inline void V1LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00080000u; +} +inline void V1LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00080000u; +} +inline void V1LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::caffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::caffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ + : *::caffe::DummyDataParameter::internal_default_instance(); +} +inline ::caffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::caffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::caffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::caffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dummy_data_param(::caffe::DummyDataParameter* dummy_data_param) { + delete dummy_data_param_; + dummy_data_param_ = dummy_data_param; + if (dummy_data_param) { + set_has_dummy_data_param(); + } else { + clear_has_dummy_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.dummy_data_param) +} + +// optional .caffe.EltwiseParameter eltwise_param = 24; +inline bool V1LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +inline void V1LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x00100000u; +} +inline void V1LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x00100000u; +} +inline void V1LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::caffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::caffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ + : *::caffe::EltwiseParameter::internal_default_instance(); +} +inline ::caffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::caffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::caffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::caffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_eltwise_param(::caffe::EltwiseParameter* eltwise_param) { + delete eltwise_param_; + eltwise_param_ = eltwise_param; + if (eltwise_param) { + set_has_eltwise_param(); + } else { + clear_has_eltwise_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.eltwise_param) +} + +// optional .caffe.ExpParameter exp_param = 41; +inline bool V1LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +inline void V1LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x00200000u; +} +inline void V1LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x00200000u; +} +inline void V1LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::caffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::caffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ + : *::caffe::ExpParameter::internal_default_instance(); +} +inline ::caffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::caffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.exp_param) + return exp_param_; +} +inline ::caffe::ExpParameter* V1LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.exp_param) + clear_has_exp_param(); + ::caffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_exp_param(::caffe::ExpParameter* exp_param) { + delete exp_param_; + exp_param_ = exp_param; + if (exp_param) { + set_has_exp_param(); + } else { + clear_has_exp_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.exp_param) +} + +// optional .caffe.HDF5DataParameter hdf5_data_param = 13; +inline bool V1LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void V1LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x00400000u; +} +inline void V1LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x00400000u; +} +inline void V1LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::caffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::caffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ + : *::caffe::HDF5DataParameter::internal_default_instance(); +} +inline ::caffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::caffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::caffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::caffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_data_param(::caffe::HDF5DataParameter* hdf5_data_param) { + delete hdf5_data_param_; + hdf5_data_param_ = hdf5_data_param; + if (hdf5_data_param) { + set_has_hdf5_data_param(); + } else { + clear_has_hdf5_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.hdf5_data_param) +} + +// optional .caffe.HDF5OutputParameter hdf5_output_param = 14; +inline bool V1LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void V1LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x00800000u; +} +inline void V1LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x00800000u; +} +inline void V1LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::caffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ + : *::caffe::HDF5OutputParameter::internal_default_instance(); +} +inline ::caffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::caffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::caffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::caffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param) { + delete hdf5_output_param_; + hdf5_output_param_ = hdf5_output_param; + if (hdf5_output_param) { + set_has_hdf5_output_param(); + } else { + clear_has_hdf5_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.hdf5_output_param) +} + +// optional .caffe.HingeLossParameter hinge_loss_param = 29; +inline bool V1LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void V1LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x01000000u; +} +inline void V1LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x01000000u; +} +inline void V1LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::caffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::caffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ + : *::caffe::HingeLossParameter::internal_default_instance(); +} +inline ::caffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::caffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::caffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::caffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hinge_loss_param(::caffe::HingeLossParameter* hinge_loss_param) { + delete hinge_loss_param_; + hinge_loss_param_ = hinge_loss_param; + if (hinge_loss_param) { + set_has_hinge_loss_param(); + } else { + clear_has_hinge_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.hinge_loss_param) +} + +// optional .caffe.ImageDataParameter image_data_param = 15; +inline bool V1LayerParameter::has_image_data_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void V1LayerParameter::set_has_image_data_param() { + _has_bits_[0] |= 0x02000000u; +} +inline void V1LayerParameter::clear_has_image_data_param() { + _has_bits_[0] &= ~0x02000000u; +} +inline void V1LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::caffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::caffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ + : *::caffe::ImageDataParameter::internal_default_instance(); +} +inline ::caffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::caffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +inline ::caffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.image_data_param) + clear_has_image_data_param(); + ::caffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_image_data_param(::caffe::ImageDataParameter* image_data_param) { + delete image_data_param_; + image_data_param_ = image_data_param; + if (image_data_param) { + set_has_image_data_param(); + } else { + clear_has_image_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.image_data_param) +} + +// optional .caffe.InfogainLossParameter infogain_loss_param = 16; +inline bool V1LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void V1LayerParameter::set_has_infogain_loss_param() { + _has_bits_[0] |= 0x04000000u; +} +inline void V1LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[0] &= ~0x04000000u; +} +inline void V1LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::caffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::caffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ + : *::caffe::InfogainLossParameter::internal_default_instance(); +} +inline ::caffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::caffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::caffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::caffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_infogain_loss_param(::caffe::InfogainLossParameter* infogain_loss_param) { + delete infogain_loss_param_; + infogain_loss_param_ = infogain_loss_param; + if (infogain_loss_param) { + set_has_infogain_loss_param(); + } else { + clear_has_infogain_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.infogain_loss_param) +} + +// optional .caffe.InnerProductParameter inner_product_param = 17; +inline bool V1LayerParameter::has_inner_product_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void V1LayerParameter::set_has_inner_product_param() { + _has_bits_[0] |= 0x08000000u; +} +inline void V1LayerParameter::clear_has_inner_product_param() { + _has_bits_[0] &= ~0x08000000u; +} +inline void V1LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::caffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::caffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ + : *::caffe::InnerProductParameter::internal_default_instance(); +} +inline ::caffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::caffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::caffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::caffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_inner_product_param(::caffe::InnerProductParameter* inner_product_param) { + delete inner_product_param_; + inner_product_param_ = inner_product_param; + if (inner_product_param) { + set_has_inner_product_param(); + } else { + clear_has_inner_product_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.inner_product_param) +} + +// optional .caffe.LRNParameter lrn_param = 18; +inline bool V1LayerParameter::has_lrn_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void V1LayerParameter::set_has_lrn_param() { + _has_bits_[0] |= 0x10000000u; +} +inline void V1LayerParameter::clear_has_lrn_param() { + _has_bits_[0] &= ~0x10000000u; +} +inline void V1LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::caffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::caffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ + : *::caffe::LRNParameter::internal_default_instance(); +} +inline ::caffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::caffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +inline ::caffe::LRNParameter* V1LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.lrn_param) + clear_has_lrn_param(); + ::caffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_lrn_param(::caffe::LRNParameter* lrn_param) { + delete lrn_param_; + lrn_param_ = lrn_param; + if (lrn_param) { + set_has_lrn_param(); + } else { + clear_has_lrn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.lrn_param) +} + +// optional .caffe.MemoryDataParameter memory_data_param = 22; +inline bool V1LayerParameter::has_memory_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void V1LayerParameter::set_has_memory_data_param() { + _has_bits_[0] |= 0x20000000u; +} +inline void V1LayerParameter::clear_has_memory_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +inline void V1LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::caffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::caffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ + : *::caffe::MemoryDataParameter::internal_default_instance(); +} +inline ::caffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::caffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::caffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::caffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_memory_data_param(::caffe::MemoryDataParameter* memory_data_param) { + delete memory_data_param_; + memory_data_param_ = memory_data_param; + if (memory_data_param) { + set_has_memory_data_param(); + } else { + clear_has_memory_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.memory_data_param) +} + +// optional .caffe.MVNParameter mvn_param = 34; +inline bool V1LayerParameter::has_mvn_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void V1LayerParameter::set_has_mvn_param() { + _has_bits_[0] |= 0x40000000u; +} +inline void V1LayerParameter::clear_has_mvn_param() { + _has_bits_[0] &= ~0x40000000u; +} +inline void V1LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::caffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::caffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ + : *::caffe::MVNParameter::internal_default_instance(); +} +inline ::caffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::caffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +inline ::caffe::MVNParameter* V1LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.mvn_param) + clear_has_mvn_param(); + ::caffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_mvn_param(::caffe::MVNParameter* mvn_param) { + delete mvn_param_; + mvn_param_ = mvn_param; + if (mvn_param) { + set_has_mvn_param(); + } else { + clear_has_mvn_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.mvn_param) +} + +// optional .caffe.PoolingParameter pooling_param = 19; +inline bool V1LayerParameter::has_pooling_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void V1LayerParameter::set_has_pooling_param() { + _has_bits_[0] |= 0x80000000u; +} +inline void V1LayerParameter::clear_has_pooling_param() { + _has_bits_[0] &= ~0x80000000u; +} +inline void V1LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::caffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::caffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ + : *::caffe::PoolingParameter::internal_default_instance(); +} +inline ::caffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::caffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +inline ::caffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.pooling_param) + clear_has_pooling_param(); + ::caffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_pooling_param(::caffe::PoolingParameter* pooling_param) { + delete pooling_param_; + pooling_param_ = pooling_param; + if (pooling_param) { + set_has_pooling_param(); + } else { + clear_has_pooling_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.pooling_param) +} + +// optional .caffe.PowerParameter power_param = 21; +inline bool V1LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void V1LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000001u; +} +inline void V1LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000001u; +} +inline void V1LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::caffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ + : *::caffe::PowerParameter::internal_default_instance(); +} +inline ::caffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::caffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.power_param) + return power_param_; +} +inline ::caffe::PowerParameter* V1LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.power_param) + clear_has_power_param(); + ::caffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_power_param(::caffe::PowerParameter* power_param) { + delete power_param_; + power_param_ = power_param; + if (power_param) { + set_has_power_param(); + } else { + clear_has_power_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.power_param) +} + +// optional .caffe.ReLUParameter relu_param = 30; +inline bool V1LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void V1LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void V1LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void V1LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::caffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ + : *::caffe::ReLUParameter::internal_default_instance(); +} +inline ::caffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::caffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.relu_param) + return relu_param_; +} +inline ::caffe::ReLUParameter* V1LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.relu_param) + clear_has_relu_param(); + ::caffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_relu_param(::caffe::ReLUParameter* relu_param) { + delete relu_param_; + relu_param_ = relu_param; + if (relu_param) { + set_has_relu_param(); + } else { + clear_has_relu_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.relu_param) +} + +// optional .caffe.SigmoidParameter sigmoid_param = 38; +inline bool V1LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void V1LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00000004u; +} +inline void V1LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00000004u; +} +inline void V1LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::caffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ + : *::caffe::SigmoidParameter::internal_default_instance(); +} +inline ::caffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::caffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::caffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::caffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_sigmoid_param(::caffe::SigmoidParameter* sigmoid_param) { + delete sigmoid_param_; + sigmoid_param_ = sigmoid_param; + if (sigmoid_param) { + set_has_sigmoid_param(); + } else { + clear_has_sigmoid_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.sigmoid_param) +} + +// optional .caffe.SoftmaxParameter softmax_param = 39; +inline bool V1LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void V1LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00000008u; +} +inline void V1LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00000008u; +} +inline void V1LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::caffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ + : *::caffe::SoftmaxParameter::internal_default_instance(); +} +inline ::caffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::caffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +inline ::caffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.softmax_param) + clear_has_softmax_param(); + ::caffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_softmax_param(::caffe::SoftmaxParameter* softmax_param) { + delete softmax_param_; + softmax_param_ = softmax_param; + if (softmax_param) { + set_has_softmax_param(); + } else { + clear_has_softmax_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.softmax_param) +} + +// optional .caffe.SliceParameter slice_param = 31; +inline bool V1LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void V1LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00000010u; +} +inline void V1LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00000010u; +} +inline void V1LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::caffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ + : *::caffe::SliceParameter::internal_default_instance(); +} +inline ::caffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::caffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.slice_param) + return slice_param_; +} +inline ::caffe::SliceParameter* V1LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.slice_param) + clear_has_slice_param(); + ::caffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_slice_param(::caffe::SliceParameter* slice_param) { + delete slice_param_; + slice_param_ = slice_param; + if (slice_param) { + set_has_slice_param(); + } else { + clear_has_slice_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.slice_param) +} + +// optional .caffe.TanHParameter tanh_param = 37; +inline bool V1LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void V1LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void V1LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void V1LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::caffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ + : *::caffe::TanHParameter::internal_default_instance(); +} +inline ::caffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::caffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +inline ::caffe::TanHParameter* V1LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.tanh_param) + clear_has_tanh_param(); + ::caffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_tanh_param(::caffe::TanHParameter* tanh_param) { + delete tanh_param_; + tanh_param_ = tanh_param; + if (tanh_param) { + set_has_tanh_param(); + } else { + clear_has_tanh_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.tanh_param) +} + +// optional .caffe.ThresholdParameter threshold_param = 25; +inline bool V1LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void V1LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00000040u; +} +inline void V1LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00000040u; +} +inline void V1LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::caffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ + : *::caffe::ThresholdParameter::internal_default_instance(); +} +inline ::caffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::caffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +inline ::caffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.threshold_param) + clear_has_threshold_param(); + ::caffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_threshold_param(::caffe::ThresholdParameter* threshold_param) { + delete threshold_param_; + threshold_param_ = threshold_param; + if (threshold_param) { + set_has_threshold_param(); + } else { + clear_has_threshold_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.threshold_param) +} + +// optional .caffe.WindowDataParameter window_data_param = 20; +inline bool V1LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void V1LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x00000080u; +} +inline void V1LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x00000080u; +} +inline void V1LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::caffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ + : *::caffe::WindowDataParameter::internal_default_instance(); +} +inline ::caffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::caffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +inline ::caffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.window_data_param) + clear_has_window_data_param(); + ::caffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_window_data_param(::caffe::WindowDataParameter* window_data_param) { + delete window_data_param_; + window_data_param_ = window_data_param; + if (window_data_param) { + set_has_window_data_param(); + } else { + clear_has_window_data_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.window_data_param) +} + +// optional .caffe.TransformationParameter transform_param = 36; +inline bool V1LayerParameter::has_transform_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void V1LayerParameter::set_has_transform_param() { + _has_bits_[1] |= 0x00000100u; +} +inline void V1LayerParameter::clear_has_transform_param() { + _has_bits_[1] &= ~0x00000100u; +} +inline void V1LayerParameter::clear_transform_param() { + if (transform_param_ != NULL) transform_param_->::caffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::caffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ + : *::caffe::TransformationParameter::internal_default_instance(); +} +inline ::caffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::caffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.transform_param) + return transform_param_; +} +inline ::caffe::TransformationParameter* V1LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.transform_param) + clear_has_transform_param(); + ::caffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_transform_param(::caffe::TransformationParameter* transform_param) { + delete transform_param_; + transform_param_ = transform_param; + if (transform_param) { + set_has_transform_param(); + } else { + clear_has_transform_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.transform_param) +} + +// optional .caffe.LossParameter loss_param = 42; +inline bool V1LayerParameter::has_loss_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void V1LayerParameter::set_has_loss_param() { + _has_bits_[1] |= 0x00000200u; +} +inline void V1LayerParameter::clear_has_loss_param() { + _has_bits_[1] &= ~0x00000200u; +} +inline void V1LayerParameter::clear_loss_param() { + if (loss_param_ != NULL) loss_param_->::caffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::caffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ + : *::caffe::LossParameter::internal_default_instance(); +} +inline ::caffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::caffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.loss_param) + return loss_param_; +} +inline ::caffe::LossParameter* V1LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.loss_param) + clear_has_loss_param(); + ::caffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_loss_param(::caffe::LossParameter* loss_param) { + delete loss_param_; + loss_param_ = loss_param; + if (loss_param) { + set_has_loss_param(); + } else { + clear_has_loss_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.loss_param) +} + +// optional .caffe.V0LayerParameter layer = 1; +inline bool V1LayerParameter::has_layer() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void V1LayerParameter::set_has_layer() { + _has_bits_[1] |= 0x00000400u; +} +inline void V1LayerParameter::clear_has_layer() { + _has_bits_[1] &= ~0x00000400u; +} +inline void V1LayerParameter::clear_layer() { + if (layer_ != NULL) layer_->::caffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +inline const ::caffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:caffe.V1LayerParameter.layer) + return layer_ != NULL ? *layer_ + : *::caffe::V0LayerParameter::internal_default_instance(); +} +inline ::caffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) { + layer_ = new ::caffe::V0LayerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V1LayerParameter.layer) + return layer_; +} +inline ::caffe::V0LayerParameter* V1LayerParameter::release_layer() { + // @@protoc_insertion_point(field_release:caffe.V1LayerParameter.layer) + clear_has_layer(); + ::caffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_layer(::caffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V1LayerParameter.layer) +} + +inline const V1LayerParameter* V1LayerParameter::internal_default_instance() { + return &V1LayerParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// V0LayerParameter + +// optional string name = 1; +inline bool V0LayerParameter::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void V0LayerParameter::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void V0LayerParameter::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void V0LayerParameter::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& V0LayerParameter::name() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.name) +} +inline void V0LayerParameter::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.name) +} +inline void V0LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.name) +} +inline ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.name) +} + +// optional string type = 2; +inline bool V0LayerParameter::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void V0LayerParameter::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void V0LayerParameter::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void V0LayerParameter::clear_type() { + type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); +} +inline const ::std::string& V0LayerParameter::type() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.type) + return type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.type) +} +inline void V0LayerParameter::set_type(const char* value) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.type) +} +inline void V0LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.type) +} +inline ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.type) + clear_has_type(); + return type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_allocated_type(::std::string* type) { + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.type) +} + +// optional uint32 num_output = 3; +inline bool V0LayerParameter::has_num_output() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void V0LayerParameter::set_has_num_output() { + _has_bits_[0] |= 0x00000004u; +} +inline void V0LayerParameter::clear_has_num_output() { + _has_bits_[0] &= ~0x00000004u; +} +inline void V0LayerParameter::clear_num_output() { + num_output_ = 0u; + clear_has_num_output(); +} +inline ::google::protobuf::uint32 V0LayerParameter::num_output() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.num_output) + return num_output_; +} +inline void V0LayerParameter::set_num_output(::google::protobuf::uint32 value) { + set_has_num_output(); + num_output_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.num_output) +} + +// optional bool biasterm = 4 [default = true]; +inline bool V0LayerParameter::has_biasterm() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void V0LayerParameter::set_has_biasterm() { + _has_bits_[0] |= 0x00000008u; +} +inline void V0LayerParameter::clear_has_biasterm() { + _has_bits_[0] &= ~0x00000008u; +} +inline void V0LayerParameter::clear_biasterm() { + biasterm_ = true; + clear_has_biasterm(); +} +inline bool V0LayerParameter::biasterm() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.biasterm) + return biasterm_; +} +inline void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.biasterm) +} + +// optional .caffe.FillerParameter weight_filler = 5; +inline bool V0LayerParameter::has_weight_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void V0LayerParameter::set_has_weight_filler() { + _has_bits_[0] |= 0x00000010u; +} +inline void V0LayerParameter::clear_has_weight_filler() { + _has_bits_[0] &= ~0x00000010u; +} +inline void V0LayerParameter::clear_weight_filler() { + if (weight_filler_ != NULL) weight_filler_->::caffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::caffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +inline ::caffe::FillerParameter* V0LayerParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.weight_filler) + clear_has_weight_filler(); + ::caffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_weight_filler(::caffe::FillerParameter* weight_filler) { + delete weight_filler_; + weight_filler_ = weight_filler; + if (weight_filler) { + set_has_weight_filler(); + } else { + clear_has_weight_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.weight_filler) +} + +// optional .caffe.FillerParameter bias_filler = 6; +inline bool V0LayerParameter::has_bias_filler() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void V0LayerParameter::set_has_bias_filler() { + _has_bits_[0] |= 0x00000020u; +} +inline void V0LayerParameter::clear_has_bias_filler() { + _has_bits_[0] &= ~0x00000020u; +} +inline void V0LayerParameter::clear_bias_filler() { + if (bias_filler_ != NULL) bias_filler_->::caffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::caffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +inline ::caffe::FillerParameter* V0LayerParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.bias_filler) + clear_has_bias_filler(); + ::caffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_bias_filler(::caffe::FillerParameter* bias_filler) { + delete bias_filler_; + bias_filler_ = bias_filler; + if (bias_filler) { + set_has_bias_filler(); + } else { + clear_has_bias_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.bias_filler) +} + +// optional uint32 pad = 7 [default = 0]; +inline bool V0LayerParameter::has_pad() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void V0LayerParameter::set_has_pad() { + _has_bits_[0] |= 0x00000040u; +} +inline void V0LayerParameter::clear_has_pad() { + _has_bits_[0] &= ~0x00000040u; +} +inline void V0LayerParameter::clear_pad() { + pad_ = 0u; + clear_has_pad(); +} +inline ::google::protobuf::uint32 V0LayerParameter::pad() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.pad) + return pad_; +} +inline void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.pad) +} + +// optional uint32 kernelsize = 8; +inline bool V0LayerParameter::has_kernelsize() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void V0LayerParameter::set_has_kernelsize() { + _has_bits_[0] |= 0x00000080u; +} +inline void V0LayerParameter::clear_has_kernelsize() { + _has_bits_[0] &= ~0x00000080u; +} +inline void V0LayerParameter::clear_kernelsize() { + kernelsize_ = 0u; + clear_has_kernelsize(); +} +inline ::google::protobuf::uint32 V0LayerParameter::kernelsize() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.kernelsize) + return kernelsize_; +} +inline void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.kernelsize) +} + +// optional uint32 group = 9 [default = 1]; +inline bool V0LayerParameter::has_group() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void V0LayerParameter::set_has_group() { + _has_bits_[0] |= 0x00000100u; +} +inline void V0LayerParameter::clear_has_group() { + _has_bits_[0] &= ~0x00000100u; +} +inline void V0LayerParameter::clear_group() { + group_ = 1u; + clear_has_group(); +} +inline ::google::protobuf::uint32 V0LayerParameter::group() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.group) + return group_; +} +inline void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.group) +} + +// optional uint32 stride = 10 [default = 1]; +inline bool V0LayerParameter::has_stride() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void V0LayerParameter::set_has_stride() { + _has_bits_[0] |= 0x00000200u; +} +inline void V0LayerParameter::clear_has_stride() { + _has_bits_[0] &= ~0x00000200u; +} +inline void V0LayerParameter::clear_stride() { + stride_ = 1u; + clear_has_stride(); +} +inline ::google::protobuf::uint32 V0LayerParameter::stride() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.stride) + return stride_; +} +inline void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.stride) +} + +// optional .caffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; +inline bool V0LayerParameter::has_pool() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void V0LayerParameter::set_has_pool() { + _has_bits_[0] |= 0x00000400u; +} +inline void V0LayerParameter::clear_has_pool() { + _has_bits_[0] &= ~0x00000400u; +} +inline void V0LayerParameter::clear_pool() { + pool_ = 0; + clear_has_pool(); +} +inline ::caffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.pool) + return static_cast< ::caffe::V0LayerParameter_PoolMethod >(pool_); +} +inline void V0LayerParameter::set_pool(::caffe::V0LayerParameter_PoolMethod value) { + assert(::caffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.pool) +} + +// optional float dropout_ratio = 12 [default = 0.5]; +inline bool V0LayerParameter::has_dropout_ratio() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void V0LayerParameter::set_has_dropout_ratio() { + _has_bits_[0] |= 0x00000800u; +} +inline void V0LayerParameter::clear_has_dropout_ratio() { + _has_bits_[0] &= ~0x00000800u; +} +inline void V0LayerParameter::clear_dropout_ratio() { + dropout_ratio_ = 0.5f; + clear_has_dropout_ratio(); +} +inline float V0LayerParameter::dropout_ratio() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.dropout_ratio) + return dropout_ratio_; +} +inline void V0LayerParameter::set_dropout_ratio(float value) { + set_has_dropout_ratio(); + dropout_ratio_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.dropout_ratio) +} + +// optional uint32 local_size = 13 [default = 5]; +inline bool V0LayerParameter::has_local_size() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void V0LayerParameter::set_has_local_size() { + _has_bits_[0] |= 0x00001000u; +} +inline void V0LayerParameter::clear_has_local_size() { + _has_bits_[0] &= ~0x00001000u; +} +inline void V0LayerParameter::clear_local_size() { + local_size_ = 5u; + clear_has_local_size(); +} +inline ::google::protobuf::uint32 V0LayerParameter::local_size() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.local_size) + return local_size_; +} +inline void V0LayerParameter::set_local_size(::google::protobuf::uint32 value) { + set_has_local_size(); + local_size_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.local_size) +} + +// optional float alpha = 14 [default = 1]; +inline bool V0LayerParameter::has_alpha() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void V0LayerParameter::set_has_alpha() { + _has_bits_[0] |= 0x00002000u; +} +inline void V0LayerParameter::clear_has_alpha() { + _has_bits_[0] &= ~0x00002000u; +} +inline void V0LayerParameter::clear_alpha() { + alpha_ = 1; + clear_has_alpha(); +} +inline float V0LayerParameter::alpha() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.alpha) + return alpha_; +} +inline void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.alpha) +} + +// optional float beta = 15 [default = 0.75]; +inline bool V0LayerParameter::has_beta() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void V0LayerParameter::set_has_beta() { + _has_bits_[0] |= 0x00004000u; +} +inline void V0LayerParameter::clear_has_beta() { + _has_bits_[0] &= ~0x00004000u; +} +inline void V0LayerParameter::clear_beta() { + beta_ = 0.75f; + clear_has_beta(); +} +inline float V0LayerParameter::beta() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.beta) + return beta_; +} +inline void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.beta) +} + +// optional float k = 22 [default = 1]; +inline bool V0LayerParameter::has_k() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void V0LayerParameter::set_has_k() { + _has_bits_[0] |= 0x00008000u; +} +inline void V0LayerParameter::clear_has_k() { + _has_bits_[0] &= ~0x00008000u; +} +inline void V0LayerParameter::clear_k() { + k_ = 1; + clear_has_k(); +} +inline float V0LayerParameter::k() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.k) + return k_; +} +inline void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.k) +} + +// optional string source = 16; +inline bool V0LayerParameter::has_source() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void V0LayerParameter::set_has_source() { + _has_bits_[0] |= 0x00010000u; +} +inline void V0LayerParameter::clear_has_source() { + _has_bits_[0] &= ~0x00010000u; +} +inline void V0LayerParameter::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& V0LayerParameter::source() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.source) + return source_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.source) +} +inline void V0LayerParameter::set_source(const char* value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.source) +} +inline void V0LayerParameter::set_source(const char* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.source) +} +inline ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_source() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.source) + clear_has_source(); + return source_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.source) +} + +// optional float scale = 17 [default = 1]; +inline bool V0LayerParameter::has_scale() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void V0LayerParameter::set_has_scale() { + _has_bits_[0] |= 0x00020000u; +} +inline void V0LayerParameter::clear_has_scale() { + _has_bits_[0] &= ~0x00020000u; +} +inline void V0LayerParameter::clear_scale() { + scale_ = 1; + clear_has_scale(); +} +inline float V0LayerParameter::scale() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.scale) + return scale_; +} +inline void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.scale) +} + +// optional string meanfile = 18; +inline bool V0LayerParameter::has_meanfile() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void V0LayerParameter::set_has_meanfile() { + _has_bits_[0] |= 0x00040000u; +} +inline void V0LayerParameter::clear_has_meanfile() { + _has_bits_[0] &= ~0x00040000u; +} +inline void V0LayerParameter::clear_meanfile() { + meanfile_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_meanfile(); +} +inline const ::std::string& V0LayerParameter::meanfile() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.meanfile) + return meanfile_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_meanfile(const ::std::string& value) { + set_has_meanfile(); + meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.meanfile) +} +inline void V0LayerParameter::set_meanfile(const char* value) { + set_has_meanfile(); + meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.meanfile) +} +inline void V0LayerParameter::set_meanfile(const char* value, size_t size) { + set_has_meanfile(); + meanfile_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.meanfile) +} +inline ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.meanfile) + return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_meanfile() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.meanfile) + clear_has_meanfile(); + return meanfile_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void V0LayerParameter::set_allocated_meanfile(::std::string* meanfile) { + if (meanfile != NULL) { + set_has_meanfile(); + } else { + clear_has_meanfile(); + } + meanfile_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), meanfile); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.meanfile) +} + +// optional uint32 batchsize = 19; +inline bool V0LayerParameter::has_batchsize() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +inline void V0LayerParameter::set_has_batchsize() { + _has_bits_[0] |= 0x00080000u; +} +inline void V0LayerParameter::clear_has_batchsize() { + _has_bits_[0] &= ~0x00080000u; +} +inline void V0LayerParameter::clear_batchsize() { + batchsize_ = 0u; + clear_has_batchsize(); +} +inline ::google::protobuf::uint32 V0LayerParameter::batchsize() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.batchsize) + return batchsize_; +} +inline void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.batchsize) +} + +// optional uint32 cropsize = 20 [default = 0]; +inline bool V0LayerParameter::has_cropsize() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +inline void V0LayerParameter::set_has_cropsize() { + _has_bits_[0] |= 0x00100000u; +} +inline void V0LayerParameter::clear_has_cropsize() { + _has_bits_[0] &= ~0x00100000u; +} +inline void V0LayerParameter::clear_cropsize() { + cropsize_ = 0u; + clear_has_cropsize(); +} +inline ::google::protobuf::uint32 V0LayerParameter::cropsize() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.cropsize) + return cropsize_; +} +inline void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.cropsize) +} + +// optional bool mirror = 21 [default = false]; +inline bool V0LayerParameter::has_mirror() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +inline void V0LayerParameter::set_has_mirror() { + _has_bits_[0] |= 0x00200000u; +} +inline void V0LayerParameter::clear_has_mirror() { + _has_bits_[0] &= ~0x00200000u; +} +inline void V0LayerParameter::clear_mirror() { + mirror_ = false; + clear_has_mirror(); +} +inline bool V0LayerParameter::mirror() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.mirror) + return mirror_; +} +inline void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.mirror) +} + +// repeated .caffe.BlobProto blobs = 50; +inline int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::caffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::caffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::caffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:caffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:caffe.V0LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::caffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:caffe.V0LayerParameter.blobs) + return blobs_; +} + +// repeated float blobs_lr = 51; +inline int V0LayerParameter::blobs_lr_size() const { + return blobs_lr_.size(); +} +inline void V0LayerParameter::clear_blobs_lr() { + blobs_lr_.Clear(); +} +inline float V0LayerParameter::blobs_lr(int index) const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.blobs_lr) + return blobs_lr_.Get(index); +} +inline void V0LayerParameter::set_blobs_lr(int index, float value) { + blobs_lr_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.blobs_lr) +} +inline void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V0LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:caffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:caffe.V0LayerParameter.blobs_lr) + return &blobs_lr_; +} + +// repeated float weight_decay = 52; +inline int V0LayerParameter::weight_decay_size() const { + return weight_decay_.size(); +} +inline void V0LayerParameter::clear_weight_decay() { + weight_decay_.Clear(); +} +inline float V0LayerParameter::weight_decay(int index) const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.weight_decay) + return weight_decay_.Get(index); +} +inline void V0LayerParameter::set_weight_decay(int index, float value) { + weight_decay_.Set(index, value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.weight_decay) +} +inline void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:caffe.V0LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:caffe.V0LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:caffe.V0LayerParameter.weight_decay) + return &weight_decay_; +} + +// optional uint32 rand_skip = 53 [default = 0]; +inline bool V0LayerParameter::has_rand_skip() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void V0LayerParameter::set_has_rand_skip() { + _has_bits_[0] |= 0x02000000u; +} +inline void V0LayerParameter::clear_has_rand_skip() { + _has_bits_[0] &= ~0x02000000u; +} +inline void V0LayerParameter::clear_rand_skip() { + rand_skip_ = 0u; + clear_has_rand_skip(); +} +inline ::google::protobuf::uint32 V0LayerParameter::rand_skip() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.rand_skip) + return rand_skip_; +} +inline void V0LayerParameter::set_rand_skip(::google::protobuf::uint32 value) { + set_has_rand_skip(); + rand_skip_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.rand_skip) +} + +// optional float det_fg_threshold = 54 [default = 0.5]; +inline bool V0LayerParameter::has_det_fg_threshold() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void V0LayerParameter::set_has_det_fg_threshold() { + _has_bits_[0] |= 0x04000000u; +} +inline void V0LayerParameter::clear_has_det_fg_threshold() { + _has_bits_[0] &= ~0x04000000u; +} +inline void V0LayerParameter::clear_det_fg_threshold() { + det_fg_threshold_ = 0.5f; + clear_has_det_fg_threshold(); +} +inline float V0LayerParameter::det_fg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_fg_threshold) + return det_fg_threshold_; +} +inline void V0LayerParameter::set_det_fg_threshold(float value) { + set_has_det_fg_threshold(); + det_fg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_fg_threshold) +} + +// optional float det_bg_threshold = 55 [default = 0.5]; +inline bool V0LayerParameter::has_det_bg_threshold() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void V0LayerParameter::set_has_det_bg_threshold() { + _has_bits_[0] |= 0x08000000u; +} +inline void V0LayerParameter::clear_has_det_bg_threshold() { + _has_bits_[0] &= ~0x08000000u; +} +inline void V0LayerParameter::clear_det_bg_threshold() { + det_bg_threshold_ = 0.5f; + clear_has_det_bg_threshold(); +} +inline float V0LayerParameter::det_bg_threshold() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_bg_threshold) + return det_bg_threshold_; +} +inline void V0LayerParameter::set_det_bg_threshold(float value) { + set_has_det_bg_threshold(); + det_bg_threshold_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_bg_threshold) +} + +// optional float det_fg_fraction = 56 [default = 0.25]; +inline bool V0LayerParameter::has_det_fg_fraction() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void V0LayerParameter::set_has_det_fg_fraction() { + _has_bits_[0] |= 0x10000000u; +} +inline void V0LayerParameter::clear_has_det_fg_fraction() { + _has_bits_[0] &= ~0x10000000u; +} +inline void V0LayerParameter::clear_det_fg_fraction() { + det_fg_fraction_ = 0.25f; + clear_has_det_fg_fraction(); +} +inline float V0LayerParameter::det_fg_fraction() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_fg_fraction) + return det_fg_fraction_; +} +inline void V0LayerParameter::set_det_fg_fraction(float value) { + set_has_det_fg_fraction(); + det_fg_fraction_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_fg_fraction) +} + +// optional uint32 det_context_pad = 58 [default = 0]; +inline bool V0LayerParameter::has_det_context_pad() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void V0LayerParameter::set_has_det_context_pad() { + _has_bits_[0] |= 0x20000000u; +} +inline void V0LayerParameter::clear_has_det_context_pad() { + _has_bits_[0] &= ~0x20000000u; +} +inline void V0LayerParameter::clear_det_context_pad() { + det_context_pad_ = 0u; + clear_has_det_context_pad(); +} +inline ::google::protobuf::uint32 V0LayerParameter::det_context_pad() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_context_pad) + return det_context_pad_; +} +inline void V0LayerParameter::set_det_context_pad(::google::protobuf::uint32 value) { + set_has_det_context_pad(); + det_context_pad_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_context_pad) +} + +// optional string det_crop_mode = 59 [default = "warp"]; +inline bool V0LayerParameter::has_det_crop_mode() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void V0LayerParameter::set_has_det_crop_mode() { + _has_bits_[0] |= 0x40000000u; +} +inline void V0LayerParameter::clear_has_det_crop_mode() { + _has_bits_[0] &= ~0x40000000u; +} +inline void V0LayerParameter::clear_det_crop_mode() { + det_crop_mode_.ClearToDefaultNoArena(_default_det_crop_mode_); + clear_has_det_crop_mode(); +} +inline const ::std::string& V0LayerParameter::det_crop_mode() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.det_crop_mode) + return det_crop_mode_.GetNoArena(_default_det_crop_mode_); +} +inline void V0LayerParameter::set_det_crop_mode(const ::std::string& value) { + set_has_det_crop_mode(); + det_crop_mode_.SetNoArena(_default_det_crop_mode_, value); + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.det_crop_mode) +} +inline void V0LayerParameter::set_det_crop_mode(const char* value) { + set_has_det_crop_mode(); + det_crop_mode_.SetNoArena(_default_det_crop_mode_, ::std::string(value)); + // @@protoc_insertion_point(field_set_char:caffe.V0LayerParameter.det_crop_mode) +} +inline void V0LayerParameter::set_det_crop_mode(const char* value, size_t size) { + set_has_det_crop_mode(); + det_crop_mode_.SetNoArena(_default_det_crop_mode_, + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:caffe.V0LayerParameter.det_crop_mode) +} +inline ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.det_crop_mode) + return det_crop_mode_.MutableNoArena(_default_det_crop_mode_); +} +inline ::std::string* V0LayerParameter::release_det_crop_mode() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.det_crop_mode) + clear_has_det_crop_mode(); + return det_crop_mode_.ReleaseNoArena(_default_det_crop_mode_); +} +inline void V0LayerParameter::set_allocated_det_crop_mode(::std::string* det_crop_mode) { + if (det_crop_mode != NULL) { + set_has_det_crop_mode(); + } else { + clear_has_det_crop_mode(); + } + det_crop_mode_.SetAllocatedNoArena(_default_det_crop_mode_, det_crop_mode); + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.det_crop_mode) +} + +// optional int32 new_num = 60 [default = 0]; +inline bool V0LayerParameter::has_new_num() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void V0LayerParameter::set_has_new_num() { + _has_bits_[0] |= 0x80000000u; +} +inline void V0LayerParameter::clear_has_new_num() { + _has_bits_[0] &= ~0x80000000u; +} +inline void V0LayerParameter::clear_new_num() { + new_num_ = 0; + clear_has_new_num(); +} +inline ::google::protobuf::int32 V0LayerParameter::new_num() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_num) + return new_num_; +} +inline void V0LayerParameter::set_new_num(::google::protobuf::int32 value) { + set_has_new_num(); + new_num_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_num) +} + +// optional int32 new_channels = 61 [default = 0]; +inline bool V0LayerParameter::has_new_channels() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void V0LayerParameter::set_has_new_channels() { + _has_bits_[1] |= 0x00000001u; +} +inline void V0LayerParameter::clear_has_new_channels() { + _has_bits_[1] &= ~0x00000001u; +} +inline void V0LayerParameter::clear_new_channels() { + new_channels_ = 0; + clear_has_new_channels(); +} +inline ::google::protobuf::int32 V0LayerParameter::new_channels() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_channels) + return new_channels_; +} +inline void V0LayerParameter::set_new_channels(::google::protobuf::int32 value) { + set_has_new_channels(); + new_channels_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_channels) +} + +// optional int32 new_height = 62 [default = 0]; +inline bool V0LayerParameter::has_new_height() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void V0LayerParameter::set_has_new_height() { + _has_bits_[1] |= 0x00000002u; +} +inline void V0LayerParameter::clear_has_new_height() { + _has_bits_[1] &= ~0x00000002u; +} +inline void V0LayerParameter::clear_new_height() { + new_height_ = 0; + clear_has_new_height(); +} +inline ::google::protobuf::int32 V0LayerParameter::new_height() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_height) + return new_height_; +} +inline void V0LayerParameter::set_new_height(::google::protobuf::int32 value) { + set_has_new_height(); + new_height_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_height) +} + +// optional int32 new_width = 63 [default = 0]; +inline bool V0LayerParameter::has_new_width() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void V0LayerParameter::set_has_new_width() { + _has_bits_[1] |= 0x00000004u; +} +inline void V0LayerParameter::clear_has_new_width() { + _has_bits_[1] &= ~0x00000004u; +} +inline void V0LayerParameter::clear_new_width() { + new_width_ = 0; + clear_has_new_width(); +} +inline ::google::protobuf::int32 V0LayerParameter::new_width() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.new_width) + return new_width_; +} +inline void V0LayerParameter::set_new_width(::google::protobuf::int32 value) { + set_has_new_width(); + new_width_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.new_width) +} + +// optional bool shuffle_images = 64 [default = false]; +inline bool V0LayerParameter::has_shuffle_images() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void V0LayerParameter::set_has_shuffle_images() { + _has_bits_[1] |= 0x00000008u; +} +inline void V0LayerParameter::clear_has_shuffle_images() { + _has_bits_[1] &= ~0x00000008u; +} +inline void V0LayerParameter::clear_shuffle_images() { + shuffle_images_ = false; + clear_has_shuffle_images(); +} +inline bool V0LayerParameter::shuffle_images() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.shuffle_images) + return shuffle_images_; +} +inline void V0LayerParameter::set_shuffle_images(bool value) { + set_has_shuffle_images(); + shuffle_images_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.shuffle_images) +} + +// optional uint32 concat_dim = 65 [default = 1]; +inline bool V0LayerParameter::has_concat_dim() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void V0LayerParameter::set_has_concat_dim() { + _has_bits_[1] |= 0x00000010u; +} +inline void V0LayerParameter::clear_has_concat_dim() { + _has_bits_[1] &= ~0x00000010u; +} +inline void V0LayerParameter::clear_concat_dim() { + concat_dim_ = 1u; + clear_has_concat_dim(); +} +inline ::google::protobuf::uint32 V0LayerParameter::concat_dim() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.concat_dim) + return concat_dim_; +} +inline void V0LayerParameter::set_concat_dim(::google::protobuf::uint32 value) { + set_has_concat_dim(); + concat_dim_ = value; + // @@protoc_insertion_point(field_set:caffe.V0LayerParameter.concat_dim) +} + +// optional .caffe.HDF5OutputParameter hdf5_output_param = 1001; +inline bool V0LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void V0LayerParameter::set_has_hdf5_output_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void V0LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void V0LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::caffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::caffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:caffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ + : *::caffe::HDF5OutputParameter::internal_default_instance(); +} +inline ::caffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::caffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::caffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:caffe.V0LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::caffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5OutputParameter* hdf5_output_param) { + delete hdf5_output_param_; + hdf5_output_param_ = hdf5_output_param; + if (hdf5_output_param) { + set_has_hdf5_output_param(); + } else { + clear_has_hdf5_output_param(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.V0LayerParameter.hdf5_output_param) +} + +inline const V0LayerParameter* V0LayerParameter::internal_default_instance() { + return &V0LayerParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// PReLUParameter + +// optional .caffe.FillerParameter filler = 1; +inline bool PReLUParameter::has_filler() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PReLUParameter::set_has_filler() { + _has_bits_[0] |= 0x00000001u; +} +inline void PReLUParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PReLUParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::caffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:caffe.PReLUParameter.filler) + return filler_ != NULL ? *filler_ + : *::caffe::FillerParameter::internal_default_instance(); +} +inline ::caffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::caffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:caffe.PReLUParameter.filler) + return filler_; +} +inline ::caffe::FillerParameter* PReLUParameter::release_filler() { + // @@protoc_insertion_point(field_release:caffe.PReLUParameter.filler) + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void PReLUParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:caffe.PReLUParameter.filler) +} + +// optional bool channel_shared = 2 [default = false]; +inline bool PReLUParameter::has_channel_shared() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PReLUParameter::set_has_channel_shared() { + _has_bits_[0] |= 0x00000002u; +} +inline void PReLUParameter::clear_has_channel_shared() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PReLUParameter::clear_channel_shared() { + channel_shared_ = false; + clear_has_channel_shared(); +} +inline bool PReLUParameter::channel_shared() const { + // @@protoc_insertion_point(field_get:caffe.PReLUParameter.channel_shared) + return channel_shared_; +} +inline void PReLUParameter::set_channel_shared(bool value) { + set_has_channel_shared(); + channel_shared_ = value; + // @@protoc_insertion_point(field_set:caffe.PReLUParameter.channel_shared) +} + +inline const PReLUParameter* PReLUParameter::internal_default_instance() { + return &PReLUParameter_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NormalizedBBox + +// optional float xmin = 1; +inline bool NormalizedBBox::has_xmin() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NormalizedBBox::set_has_xmin() { + _has_bits_[0] |= 0x00000001u; +} +inline void NormalizedBBox::clear_has_xmin() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NormalizedBBox::clear_xmin() { + xmin_ = 0; + clear_has_xmin(); +} +inline float NormalizedBBox::xmin() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.xmin) + return xmin_; +} +inline void NormalizedBBox::set_xmin(float value) { + set_has_xmin(); + xmin_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.xmin) +} + +// optional float ymin = 2; +inline bool NormalizedBBox::has_ymin() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NormalizedBBox::set_has_ymin() { + _has_bits_[0] |= 0x00000002u; +} +inline void NormalizedBBox::clear_has_ymin() { + _has_bits_[0] &= ~0x00000002u; +} +inline void NormalizedBBox::clear_ymin() { + ymin_ = 0; + clear_has_ymin(); +} +inline float NormalizedBBox::ymin() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.ymin) + return ymin_; +} +inline void NormalizedBBox::set_ymin(float value) { + set_has_ymin(); + ymin_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.ymin) +} + +// optional float xmax = 3; +inline bool NormalizedBBox::has_xmax() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void NormalizedBBox::set_has_xmax() { + _has_bits_[0] |= 0x00000004u; +} +inline void NormalizedBBox::clear_has_xmax() { + _has_bits_[0] &= ~0x00000004u; +} +inline void NormalizedBBox::clear_xmax() { + xmax_ = 0; + clear_has_xmax(); +} +inline float NormalizedBBox::xmax() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.xmax) + return xmax_; +} +inline void NormalizedBBox::set_xmax(float value) { + set_has_xmax(); + xmax_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.xmax) +} + +// optional float ymax = 4; +inline bool NormalizedBBox::has_ymax() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void NormalizedBBox::set_has_ymax() { + _has_bits_[0] |= 0x00000008u; +} +inline void NormalizedBBox::clear_has_ymax() { + _has_bits_[0] &= ~0x00000008u; +} +inline void NormalizedBBox::clear_ymax() { + ymax_ = 0; + clear_has_ymax(); +} +inline float NormalizedBBox::ymax() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.ymax) + return ymax_; +} +inline void NormalizedBBox::set_ymax(float value) { + set_has_ymax(); + ymax_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.ymax) +} + +// optional int32 label = 5; +inline bool NormalizedBBox::has_label() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void NormalizedBBox::set_has_label() { + _has_bits_[0] |= 0x00000010u; +} +inline void NormalizedBBox::clear_has_label() { + _has_bits_[0] &= ~0x00000010u; +} +inline void NormalizedBBox::clear_label() { + label_ = 0; + clear_has_label(); +} +inline ::google::protobuf::int32 NormalizedBBox::label() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.label) + return label_; +} +inline void NormalizedBBox::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.label) +} + +// optional bool difficult = 6; +inline bool NormalizedBBox::has_difficult() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void NormalizedBBox::set_has_difficult() { + _has_bits_[0] |= 0x00000020u; +} +inline void NormalizedBBox::clear_has_difficult() { + _has_bits_[0] &= ~0x00000020u; +} +inline void NormalizedBBox::clear_difficult() { + difficult_ = false; + clear_has_difficult(); +} +inline bool NormalizedBBox::difficult() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.difficult) + return difficult_; +} +inline void NormalizedBBox::set_difficult(bool value) { + set_has_difficult(); + difficult_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.difficult) +} + +// optional float score = 7; +inline bool NormalizedBBox::has_score() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void NormalizedBBox::set_has_score() { + _has_bits_[0] |= 0x00000040u; +} +inline void NormalizedBBox::clear_has_score() { + _has_bits_[0] &= ~0x00000040u; +} +inline void NormalizedBBox::clear_score() { + score_ = 0; + clear_has_score(); +} +inline float NormalizedBBox::score() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.score) + return score_; +} +inline void NormalizedBBox::set_score(float value) { + set_has_score(); + score_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.score) +} + +// optional float size = 8; +inline bool NormalizedBBox::has_size() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void NormalizedBBox::set_has_size() { + _has_bits_[0] |= 0x00000080u; +} +inline void NormalizedBBox::clear_has_size() { + _has_bits_[0] &= ~0x00000080u; +} +inline void NormalizedBBox::clear_size() { + size_ = 0; + clear_has_size(); +} +inline float NormalizedBBox::size() const { + // @@protoc_insertion_point(field_get:caffe.NormalizedBBox.size) + return size_; +} +inline void NormalizedBBox::set_size(float value) { + set_has_size(); + size_ = value; + // @@protoc_insertion_point(field_set:caffe.NormalizedBBox.size) +} + +inline const NormalizedBBox* NormalizedBBox::internal_default_instance() { + return &NormalizedBBox_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace caffe + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::caffe::PriorBoxParameter_CodeType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::PriorBoxParameter_CodeType>() { + return ::caffe::PriorBoxParameter_CodeType_descriptor(); +} +template <> struct is_proto_enum< ::caffe::FillerParameter_VarianceNorm> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::FillerParameter_VarianceNorm>() { + return ::caffe::FillerParameter_VarianceNorm_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SolverParameter_SnapshotFormat> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SolverParameter_SnapshotFormat>() { + return ::caffe::SolverParameter_SnapshotFormat_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SolverParameter_SolverMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SolverParameter_SolverMode>() { + return ::caffe::SolverParameter_SolverMode_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SolverParameter_SolverType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SolverParameter_SolverType>() { + return ::caffe::SolverParameter_SolverType_descriptor(); +} +template <> struct is_proto_enum< ::caffe::ParamSpec_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::ParamSpec_DimCheckMode>() { + return ::caffe::ParamSpec_DimCheckMode_descriptor(); +} +template <> struct is_proto_enum< ::caffe::LossParameter_NormalizationMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::LossParameter_NormalizationMode>() { + return ::caffe::LossParameter_NormalizationMode_descriptor(); +} +template <> struct is_proto_enum< ::caffe::ConvolutionParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::ConvolutionParameter_Engine>() { + return ::caffe::ConvolutionParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::DataParameter_DB> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::DataParameter_DB>() { + return ::caffe::DataParameter_DB_descriptor(); +} +template <> struct is_proto_enum< ::caffe::EltwiseParameter_EltwiseOp> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::EltwiseParameter_EltwiseOp>() { + return ::caffe::EltwiseParameter_EltwiseOp_descriptor(); +} +template <> struct is_proto_enum< ::caffe::HingeLossParameter_Norm> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::HingeLossParameter_Norm>() { + return ::caffe::HingeLossParameter_Norm_descriptor(); +} +template <> struct is_proto_enum< ::caffe::LRNParameter_NormRegion> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::LRNParameter_NormRegion>() { + return ::caffe::LRNParameter_NormRegion_descriptor(); +} +template <> struct is_proto_enum< ::caffe::LRNParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::LRNParameter_Engine>() { + return ::caffe::LRNParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::PoolingParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::PoolingParameter_PoolMethod>() { + return ::caffe::PoolingParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::caffe::PoolingParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::PoolingParameter_Engine>() { + return ::caffe::PoolingParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::ReductionParameter_ReductionOp> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::ReductionParameter_ReductionOp>() { + return ::caffe::ReductionParameter_ReductionOp_descriptor(); +} +template <> struct is_proto_enum< ::caffe::ReLUParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::ReLUParameter_Engine>() { + return ::caffe::ReLUParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SigmoidParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SigmoidParameter_Engine>() { + return ::caffe::SigmoidParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SoftmaxParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SoftmaxParameter_Engine>() { + return ::caffe::SoftmaxParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::TanHParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::TanHParameter_Engine>() { + return ::caffe::TanHParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SPPParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SPPParameter_PoolMethod>() { + return ::caffe::SPPParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::caffe::SPPParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::SPPParameter_Engine>() { + return ::caffe::SPPParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::caffe::V1LayerParameter_LayerType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::V1LayerParameter_LayerType>() { + return ::caffe::V1LayerParameter_LayerType_descriptor(); +} +template <> struct is_proto_enum< ::caffe::V1LayerParameter_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::V1LayerParameter_DimCheckMode>() { + return ::caffe::V1LayerParameter_DimCheckMode_descriptor(); +} +template <> struct is_proto_enum< ::caffe::V0LayerParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::V0LayerParameter_PoolMethod>() { + return ::caffe::V0LayerParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::caffe::Phase> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::caffe::Phase>() { + return ::caffe::Phase_descriptor(); +} + +} // namespace protobuf +} // namespace google +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_caffe_2eproto__INCLUDED diff --git a/modules/dnn/misc/python/pyopencv_dnn.hpp b/modules/dnn/misc/python/pyopencv_dnn.hpp new file mode 100644 index 0000000000..312e5fcc56 --- /dev/null +++ b/modules/dnn/misc/python/pyopencv_dnn.hpp @@ -0,0 +1,39 @@ +#ifdef HAVE_OPENCV_DNN +typedef dnn::DictValue LayerId; +typedef std::vector vector_MatShape; +typedef std::vector > vector_vector_MatShape; +typedef std::vector vector_size_t; +typedef std::vector > vector_vector_Mat; + +template<> +bool pyopencv_to(PyObject *o, dnn::DictValue &dv, const char *name) +{ + (void)name; + if (!o || o == Py_None) + return true; //Current state will be used + else if (PyLong_Check(o)) + { + dv = dnn::DictValue((int64)PyLong_AsLongLong(o)); + return true; + } + else if (PyFloat_Check(o)) + { + dv = dnn::DictValue(PyFloat_AS_DOUBLE(o)); + return true; + } + else if (PyString_Check(o)) + { + dv = dnn::DictValue(String(PyString_AsString(o))); + return true; + } + else + return false; +} + +template<> +bool pyopencv_to(PyObject *o, std::vector &blobs, const char *name) //required for Layer::blobs RW +{ + return pyopencvVecConverter::to(o, blobs, ArgInfo(name, false)); +} + +#endif diff --git a/modules/dnn/misc/tensorflow/attr_value.pb.cc b/modules/dnn/misc/tensorflow/attr_value.pb.cc new file mode 100644 index 0000000000..deb3320e14 --- /dev/null +++ b/modules/dnn/misc/tensorflow/attr_value.pb.cc @@ -0,0 +1,3014 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: attr_value.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "attr_value.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* AttrValue_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + AttrValue_reflection_ = NULL; +struct AttrValueOneofInstance { + ::google::protobuf::internal::ArenaStringPtr s_; + ::google::protobuf::int64 i_; + float f_; + bool b_; + int type_; + const ::tensorflow::TensorShapeProto* shape_; + const ::tensorflow::TensorProto* tensor_; + const ::tensorflow::AttrValue_ListValue* list_; + const ::tensorflow::NameAttrList* func_; + ::google::protobuf::internal::ArenaStringPtr placeholder_; +}* AttrValue_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* AttrValue_ListValue_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + AttrValue_ListValue_reflection_ = NULL; +const ::google::protobuf::Descriptor* NameAttrList_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NameAttrList_reflection_ = NULL; +const ::google::protobuf::Descriptor* NameAttrList_AttrEntry_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_attr_5fvalue_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_attr_5fvalue_2eproto() { + protobuf_AddDesc_attr_5fvalue_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "attr_value.proto"); + GOOGLE_CHECK(file != NULL); + AttrValue_descriptor_ = file->message_type(0); + static const int AttrValue_offsets_[11] = { + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, s_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, i_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, f_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, b_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, type_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, shape_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, tensor_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, list_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, func_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(AttrValue_default_oneof_instance_, placeholder_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue, value_), + }; + AttrValue_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + AttrValue_descriptor_, + AttrValue::internal_default_instance(), + AttrValue_offsets_, + -1, + -1, + -1, + AttrValue_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue, _oneof_case_[0]), + sizeof(AttrValue), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue, _internal_metadata_)); + AttrValue_ListValue_descriptor_ = AttrValue_descriptor_->nested_type(0); + static const int AttrValue_ListValue_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, s_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, i_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, f_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, b_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, tensor_), + }; + AttrValue_ListValue_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + AttrValue_ListValue_descriptor_, + AttrValue_ListValue::internal_default_instance(), + AttrValue_ListValue_offsets_, + -1, + -1, + -1, + sizeof(AttrValue_ListValue), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AttrValue_ListValue, _internal_metadata_)); + NameAttrList_descriptor_ = file->message_type(1); + static const int NameAttrList_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NameAttrList, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NameAttrList, attr_), + }; + NameAttrList_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NameAttrList_descriptor_, + NameAttrList::internal_default_instance(), + NameAttrList_offsets_, + -1, + -1, + -1, + sizeof(NameAttrList), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NameAttrList, _internal_metadata_)); + NameAttrList_AttrEntry_descriptor_ = NameAttrList_descriptor_->nested_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_attr_5fvalue_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + AttrValue_descriptor_, AttrValue::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + AttrValue_ListValue_descriptor_, AttrValue_ListValue::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NameAttrList_descriptor_, NameAttrList::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NameAttrList_AttrEntry_descriptor_, + ::google::protobuf::internal::MapEntry< + ::std::string, + ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0>::CreateDefaultInstance( + NameAttrList_AttrEntry_descriptor_)); +} + +} // namespace + +void protobuf_ShutdownFile_attr_5fvalue_2eproto() { + AttrValue_default_instance_.Shutdown(); + delete AttrValue_default_oneof_instance_; + delete AttrValue_reflection_; + AttrValue_ListValue_default_instance_.Shutdown(); + delete AttrValue_ListValue_reflection_; + NameAttrList_default_instance_.Shutdown(); + delete NameAttrList_reflection_; +} + +void protobuf_InitDefaults_attr_5fvalue_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::tensorflow::protobuf_InitDefaults_tensor_2eproto(); + ::tensorflow::protobuf_InitDefaults_tensor_5fshape_2eproto(); + ::tensorflow::protobuf_InitDefaults_types_2eproto(); + ::google::protobuf::internal::GetEmptyString(); + AttrValue_default_instance_.DefaultConstruct(); + AttrValue_default_oneof_instance_ = new AttrValueOneofInstance(); + ::google::protobuf::internal::GetEmptyString(); + AttrValue_ListValue_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + NameAttrList_default_instance_.DefaultConstruct(); + AttrValue_default_instance_.get_mutable()->InitAsDefaultInstance(); + AttrValue_ListValue_default_instance_.get_mutable()->InitAsDefaultInstance(); + NameAttrList_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_attr_5fvalue_2eproto_once_); +void protobuf_InitDefaults_attr_5fvalue_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_attr_5fvalue_2eproto_once_, + &protobuf_InitDefaults_attr_5fvalue_2eproto_impl); +} +void protobuf_AddDesc_attr_5fvalue_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_attr_5fvalue_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\020attr_value.proto\022\ntensorflow\032\014tensor.p" + "roto\032\022tensor_shape.proto\032\013types.proto\"\376\003" + "\n\tAttrValue\022\013\n\001s\030\002 \001(\014H\000\022\013\n\001i\030\003 \001(\003H\000\022\013\n" + "\001f\030\004 \001(\002H\000\022\013\n\001b\030\005 \001(\010H\000\022$\n\004type\030\006 \001(\0162\024." + "tensorflow.DataTypeH\000\022-\n\005shape\030\007 \001(\0132\034.t" + "ensorflow.TensorShapeProtoH\000\022)\n\006tensor\030\010" + " \001(\0132\027.tensorflow.TensorProtoH\000\022/\n\004list\030" + "\001 \001(\0132\037.tensorflow.AttrValue.ListValueH\000" + "\022(\n\004func\030\n \001(\0132\030.tensorflow.NameAttrList" + "H\000\022\025\n\013placeholder\030\t \001(\tH\000\032\301\001\n\tListValue\022" + "\t\n\001s\030\002 \003(\014\022\r\n\001i\030\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002\020\001" + "\022\r\n\001b\030\005 \003(\010B\002\020\001\022&\n\004type\030\006 \003(\0162\024.tensorfl" + "ow.DataTypeB\002\020\001\022+\n\005shape\030\007 \003(\0132\034.tensorf" + "low.TensorShapeProto\022\'\n\006tensor\030\010 \003(\0132\027.t" + "ensorflow.TensorProtoB\007\n\005value\"\222\001\n\014NameA" + "ttrList\022\014\n\004name\030\001 \001(\t\0220\n\004attr\030\002 \003(\0132\".te" + "nsorflow.NameAttrList.AttrEntry\032B\n\tAttrE" + "ntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tenso" + "rflow.AttrValue:\0028\001B0\n\030org.tensorflow.fr" + "ameworkB\017AttrValueProtosP\001\370\001\001b\006proto3", 797); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "attr_value.proto", &protobuf_RegisterTypes); + ::tensorflow::protobuf_AddDesc_tensor_2eproto(); + ::tensorflow::protobuf_AddDesc_tensor_5fshape_2eproto(); + ::tensorflow::protobuf_AddDesc_types_2eproto(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_attr_5fvalue_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_attr_5fvalue_2eproto_once_); +void protobuf_AddDesc_attr_5fvalue_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_attr_5fvalue_2eproto_once_, + &protobuf_AddDesc_attr_5fvalue_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_attr_5fvalue_2eproto { + StaticDescriptorInitializer_attr_5fvalue_2eproto() { + protobuf_AddDesc_attr_5fvalue_2eproto(); + } +} static_descriptor_initializer_attr_5fvalue_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AttrValue_ListValue::kSFieldNumber; +const int AttrValue_ListValue::kIFieldNumber; +const int AttrValue_ListValue::kFFieldNumber; +const int AttrValue_ListValue::kBFieldNumber; +const int AttrValue_ListValue::kTypeFieldNumber; +const int AttrValue_ListValue::kShapeFieldNumber; +const int AttrValue_ListValue::kTensorFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AttrValue_ListValue::AttrValue_ListValue() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_attr_5fvalue_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.AttrValue.ListValue) +} +AttrValue_ListValue::AttrValue_ListValue(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + s_(arena), + i_(arena), + f_(arena), + b_(arena), + type_(arena), + shape_(arena), + tensor_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_attr_5fvalue_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.AttrValue.ListValue) +} + +void AttrValue_ListValue::InitAsDefaultInstance() { +} + +AttrValue_ListValue::AttrValue_ListValue(const AttrValue_ListValue& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.AttrValue.ListValue) +} + +void AttrValue_ListValue::SharedCtor() { + _cached_size_ = 0; +} + +AttrValue_ListValue::~AttrValue_ListValue() { + // @@protoc_insertion_point(destructor:tensorflow.AttrValue.ListValue) + SharedDtor(); +} + +void AttrValue_ListValue::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + +} + +void AttrValue_ListValue::ArenaDtor(void* object) { + AttrValue_ListValue* _this = reinterpret_cast< AttrValue_ListValue* >(object); + (void)_this; +} +void AttrValue_ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AttrValue_ListValue::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* AttrValue_ListValue::descriptor() { + protobuf_AssignDescriptorsOnce(); + return AttrValue_ListValue_descriptor_; +} + +const AttrValue_ListValue& AttrValue_ListValue::default_instance() { + protobuf_InitDefaults_attr_5fvalue_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed AttrValue_ListValue_default_instance_; + +AttrValue_ListValue* AttrValue_ListValue::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void AttrValue_ListValue::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.AttrValue.ListValue) + s_.Clear(); + i_.Clear(); + f_.Clear(); + b_.Clear(); + type_.Clear(); + shape_.Clear(); + tensor_.Clear(); +} + +bool AttrValue_ListValue::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.AttrValue.ListValue) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bytes s = 2; + case 2: { + if (tag == 18) { + parse_s: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_s())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_s; + if (input->ExpectTag(26)) goto parse_i; + break; + } + + // repeated int64 i = 3 [packed = true]; + case 3: { + if (tag == 26) { + parse_i: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_i()))); + } else if (tag == 24) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 26, input, this->mutable_i()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_f; + break; + } + + // repeated float f = 4 [packed = true]; + case 4: { + if (tag == 34) { + parse_f: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_f()))); + } else if (tag == 37) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 34, input, this->mutable_f()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_b; + break; + } + + // repeated bool b = 5 [packed = true]; + case 5: { + if (tag == 42) { + parse_b: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_b()))); + } else if (tag == 40) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 42, input, this->mutable_b()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_type; + break; + } + + // repeated .tensorflow.DataType type = 6 [packed = true]; + case 6: { + if (tag == 50) { + parse_type: + ::google::protobuf::uint32 length; + DO_(input->ReadVarint32(&length)); + ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(length); + while (input->BytesUntilLimit() > 0) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_type(static_cast< ::tensorflow::DataType >(value)); + } + input->PopLimit(limit); + } else if (tag == 48) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_type(static_cast< ::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_shape; + break; + } + + // repeated .tensorflow.TensorShapeProto shape = 7; + case 7: { + if (tag == 58) { + parse_shape: + DO_(input->IncrementRecursionDepth()); + parse_loop_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_loop_shape; + if (input->ExpectTag(66)) goto parse_loop_tensor; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .tensorflow.TensorProto tensor = 8; + case 8: { + if (tag == 66) { + DO_(input->IncrementRecursionDepth()); + parse_loop_tensor: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_tensor())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_loop_tensor; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.AttrValue.ListValue) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.AttrValue.ListValue) + return false; +#undef DO_ +} + +void AttrValue_ListValue::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.AttrValue.ListValue) + // repeated bytes s = 2; + for (int i = 0; i < this->s_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 2, this->s(i), output); + } + + // repeated int64 i = 3 [packed = true]; + if (this->i_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_i_cached_byte_size_); + } + for (int i = 0; i < this->i_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->i(i), output); + } + + // repeated float f = 4 [packed = true]; + if (this->f_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_f_cached_byte_size_); + } + for (int i = 0; i < this->f_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloatNoTag( + this->f(i), output); + } + + // repeated bool b = 5 [packed = true]; + if (this->b_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_b_cached_byte_size_); + } + for (int i = 0; i < this->b_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBoolNoTag( + this->b(i), output); + } + + // repeated .tensorflow.DataType type = 6 [packed = true]; + if (this->type_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + output); + output->WriteVarint32(_type_cached_byte_size_); + } + for (int i = 0; i < this->type_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag( + this->type(i), output); + } + + // repeated .tensorflow.TensorShapeProto shape = 7; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->shape(i), output); + } + + // repeated .tensorflow.TensorProto tensor = 8; + for (unsigned int i = 0, n = this->tensor_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->tensor(i), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.AttrValue.ListValue) +} + +::google::protobuf::uint8* AttrValue_ListValue::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AttrValue.ListValue) + // repeated bytes s = 2; + for (int i = 0; i < this->s_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(2, this->s(i), target); + } + + // repeated int64 i = 3 [packed = true]; + if (this->i_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _i_cached_byte_size_, target); + } + for (int i = 0; i < this->i_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->i(i), target); + } + + // repeated float f = 4 [packed = true]; + if (this->f_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _f_cached_byte_size_, target); + } + for (int i = 0; i < this->f_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->f(i), target); + } + + // repeated bool b = 5 [packed = true]; + if (this->b_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _b_cached_byte_size_, target); + } + for (int i = 0; i < this->b_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolNoTagToArray(this->b(i), target); + } + + // repeated .tensorflow.DataType type = 6 [packed = true]; + if (this->type_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _type_cached_byte_size_, target); + } + for (int i = 0; i < this->type_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray( + this->type(i), target); + } + + // repeated .tensorflow.TensorShapeProto shape = 7; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, this->shape(i), false, target); + } + + // repeated .tensorflow.TensorProto tensor = 8; + for (unsigned int i = 0, n = this->tensor_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, this->tensor(i), false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AttrValue.ListValue) + return target; +} + +size_t AttrValue_ListValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.AttrValue.ListValue) + size_t total_size = 0; + + // repeated bytes s = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->s_size()); + for (int i = 0; i < this->s_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s(i)); + } + + // repeated int64 i = 3 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->i_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->i(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _i_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float f = 4 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->f_size(); + data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _f_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated bool b = 5 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->b_size(); + data_size = 1UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _b_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .tensorflow.DataType type = 6 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->type_size();for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _type_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .tensorflow.TensorShapeProto shape = 7; + { + unsigned int count = this->shape_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + } + + // repeated .tensorflow.TensorProto tensor = 8; + { + unsigned int count = this->tensor_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tensor(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AttrValue_ListValue::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AttrValue.ListValue) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const AttrValue_ListValue* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AttrValue.ListValue) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AttrValue.ListValue) + UnsafeMergeFrom(*source); + } +} + +void AttrValue_ListValue::MergeFrom(const AttrValue_ListValue& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AttrValue.ListValue) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void AttrValue_ListValue::UnsafeMergeFrom(const AttrValue_ListValue& from) { + GOOGLE_DCHECK(&from != this); + s_.UnsafeMergeFrom(from.s_); + i_.UnsafeMergeFrom(from.i_); + f_.UnsafeMergeFrom(from.f_); + b_.UnsafeMergeFrom(from.b_); + type_.UnsafeMergeFrom(from.type_); + shape_.MergeFrom(from.shape_); + tensor_.MergeFrom(from.tensor_); +} + +void AttrValue_ListValue::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AttrValue.ListValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AttrValue_ListValue::CopyFrom(const AttrValue_ListValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AttrValue.ListValue) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool AttrValue_ListValue::IsInitialized() const { + + return true; +} + +void AttrValue_ListValue::Swap(AttrValue_ListValue* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AttrValue_ListValue temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void AttrValue_ListValue::UnsafeArenaSwap(AttrValue_ListValue* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AttrValue_ListValue::InternalSwap(AttrValue_ListValue* other) { + s_.UnsafeArenaSwap(&other->s_); + i_.UnsafeArenaSwap(&other->i_); + f_.UnsafeArenaSwap(&other->f_); + b_.UnsafeArenaSwap(&other->b_); + type_.UnsafeArenaSwap(&other->type_); + shape_.UnsafeArenaSwap(&other->shape_); + tensor_.UnsafeArenaSwap(&other->tensor_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata AttrValue_ListValue::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = AttrValue_ListValue_descriptor_; + metadata.reflection = AttrValue_ListValue_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int AttrValue::kSFieldNumber; +const int AttrValue::kIFieldNumber; +const int AttrValue::kFFieldNumber; +const int AttrValue::kBFieldNumber; +const int AttrValue::kTypeFieldNumber; +const int AttrValue::kShapeFieldNumber; +const int AttrValue::kTensorFieldNumber; +const int AttrValue::kListFieldNumber; +const int AttrValue::kFuncFieldNumber; +const int AttrValue::kPlaceholderFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +AttrValue::AttrValue() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_attr_5fvalue_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.AttrValue) +} +AttrValue::AttrValue(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_attr_5fvalue_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.AttrValue) +} + +void AttrValue::InitAsDefaultInstance() { + AttrValue_default_oneof_instance_->s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + AttrValue_default_oneof_instance_->i_ = GOOGLE_LONGLONG(0); + AttrValue_default_oneof_instance_->f_ = 0; + AttrValue_default_oneof_instance_->b_ = false; + AttrValue_default_oneof_instance_->type_ = 0; + AttrValue_default_oneof_instance_->shape_ = const_cast< ::tensorflow::TensorShapeProto*>( + ::tensorflow::TensorShapeProto::internal_default_instance()); + AttrValue_default_oneof_instance_->tensor_ = const_cast< ::tensorflow::TensorProto*>( + ::tensorflow::TensorProto::internal_default_instance()); + AttrValue_default_oneof_instance_->list_ = const_cast< ::tensorflow::AttrValue_ListValue*>( + ::tensorflow::AttrValue_ListValue::internal_default_instance()); + AttrValue_default_oneof_instance_->func_ = const_cast< ::tensorflow::NameAttrList*>( + ::tensorflow::NameAttrList::internal_default_instance()); + AttrValue_default_oneof_instance_->placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +AttrValue::AttrValue(const AttrValue& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.AttrValue) +} + +void AttrValue::SharedCtor() { + clear_has_value(); + _cached_size_ = 0; +} + +AttrValue::~AttrValue() { + // @@protoc_insertion_point(destructor:tensorflow.AttrValue) + SharedDtor(); +} + +void AttrValue::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + if (has_value()) { + clear_value(); + } +} + +void AttrValue::ArenaDtor(void* object) { + AttrValue* _this = reinterpret_cast< AttrValue* >(object); + (void)_this; +} +void AttrValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void AttrValue::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* AttrValue::descriptor() { + protobuf_AssignDescriptorsOnce(); + return AttrValue_descriptor_; +} + +const AttrValue& AttrValue::default_instance() { + protobuf_InitDefaults_attr_5fvalue_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed AttrValue_default_instance_; + +AttrValue* AttrValue::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void AttrValue::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:tensorflow.AttrValue) + switch (value_case()) { + case kS: { + value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + break; + } + case kI: { + // No need to clear + break; + } + case kF: { + // No need to clear + break; + } + case kB: { + // No need to clear + break; + } + case kType: { + // No need to clear + break; + } + case kShape: { + if (GetArenaNoVirtual() == NULL) { + delete value_.shape_; + } + break; + } + case kTensor: { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + break; + } + case kList: { + if (GetArenaNoVirtual() == NULL) { + delete value_.list_; + } + break; + } + case kFunc: { + if (GetArenaNoVirtual() == NULL) { + delete value_.func_; + } + break; + } + case kPlaceholder: { + value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + _oneof_case_[0] = VALUE_NOT_SET; +} + + +void AttrValue::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.AttrValue) + clear_value(); +} + +bool AttrValue::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.AttrValue) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .tensorflow.AttrValue.ListValue list = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_list())); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional bytes s = 2; + case 2: { + if (tag == 18) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_s())); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional int64 i = 3; + case 3: { + if (tag == 24) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &value_.i_))); + set_has_i(); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional float f = 4; + case 4: { + if (tag == 37) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_.f_))); + set_has_f(); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional bool b = 5; + case 5: { + if (tag == 40) { + clear_value(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &value_.b_))); + set_has_b(); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional .tensorflow.DataType type = 6; + case 6: { + if (tag == 48) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional .tensorflow.TensorShapeProto shape = 7; + case 7: { + if (tag == 58) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_shape())); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional .tensorflow.TensorProto tensor = 8; + case 8: { + if (tag == 66) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + goto after_func; + break; + } + + // optional string placeholder = 9; + case 9: { + if (tag == 74) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_placeholder())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->placeholder().data(), this->placeholder().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.AttrValue.placeholder")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_func; + break; + } + + // optional .tensorflow.NameAttrList func = 10; + case 10: { + if (tag == 82) { + parse_func: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_func())); + } else { + goto handle_unusual; + } + after_func: + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.AttrValue) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.AttrValue) + return false; +#undef DO_ +} + +void AttrValue::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.AttrValue) + // optional .tensorflow.AttrValue.ListValue list = 1; + if (has_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *value_.list_, output); + } + + // optional bytes s = 2; + if (has_s()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->s(), output); + } + + // optional int64 i = 3; + if (has_i()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->i(), output); + } + + // optional float f = 4; + if (has_f()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->f(), output); + } + + // optional bool b = 5; + if (has_b()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->b(), output); + } + + // optional .tensorflow.DataType type = 6; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->type(), output); + } + + // optional .tensorflow.TensorShapeProto shape = 7; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *value_.shape_, output); + } + + // optional .tensorflow.TensorProto tensor = 8; + if (has_tensor()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *value_.tensor_, output); + } + + // optional string placeholder = 9; + if (has_placeholder()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->placeholder().data(), this->placeholder().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.AttrValue.placeholder"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 9, this->placeholder(), output); + } + + // optional .tensorflow.NameAttrList func = 10; + if (has_func()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *value_.func_, output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.AttrValue) +} + +::google::protobuf::uint8* AttrValue::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AttrValue) + // optional .tensorflow.AttrValue.ListValue list = 1; + if (has_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *value_.list_, false, target); + } + + // optional bytes s = 2; + if (has_s()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 2, this->s(), target); + } + + // optional int64 i = 3; + if (has_i()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target); + } + + // optional float f = 4; + if (has_f()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->f(), target); + } + + // optional bool b = 5; + if (has_b()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->b(), target); + } + + // optional .tensorflow.DataType type = 6; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->type(), target); + } + + // optional .tensorflow.TensorShapeProto shape = 7; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *value_.shape_, false, target); + } + + // optional .tensorflow.TensorProto tensor = 8; + if (has_tensor()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *value_.tensor_, false, target); + } + + // optional string placeholder = 9; + if (has_placeholder()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->placeholder().data(), this->placeholder().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.AttrValue.placeholder"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 9, this->placeholder(), target); + } + + // optional .tensorflow.NameAttrList func = 10; + if (has_func()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 10, *value_.func_, false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AttrValue) + return target; +} + +size_t AttrValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.AttrValue) + size_t total_size = 0; + + switch (value_case()) { + // optional bytes s = 2; + case kS: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s()); + break; + } + // optional int64 i = 3; + case kI: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->i()); + break; + } + // optional float f = 4; + case kF: { + total_size += 1 + 4; + break; + } + // optional bool b = 5; + case kB: { + total_size += 1 + 1; + break; + } + // optional .tensorflow.DataType type = 6; + case kType: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + break; + } + // optional .tensorflow.TensorShapeProto shape = 7; + case kShape: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *value_.shape_); + break; + } + // optional .tensorflow.TensorProto tensor = 8; + case kTensor: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *value_.tensor_); + break; + } + // optional .tensorflow.AttrValue.ListValue list = 1; + case kList: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *value_.list_); + break; + } + // optional .tensorflow.NameAttrList func = 10; + case kFunc: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *value_.func_); + break; + } + // optional string placeholder = 9; + case kPlaceholder: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->placeholder()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AttrValue::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AttrValue) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const AttrValue* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AttrValue) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AttrValue) + UnsafeMergeFrom(*source); + } +} + +void AttrValue::MergeFrom(const AttrValue& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AttrValue) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void AttrValue::UnsafeMergeFrom(const AttrValue& from) { + GOOGLE_DCHECK(&from != this); + switch (from.value_case()) { + case kS: { + set_s(from.s()); + break; + } + case kI: { + set_i(from.i()); + break; + } + case kF: { + set_f(from.f()); + break; + } + case kB: { + set_b(from.b()); + break; + } + case kType: { + set_type(from.type()); + break; + } + case kShape: { + mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.shape()); + break; + } + case kTensor: { + mutable_tensor()->::tensorflow::TensorProto::MergeFrom(from.tensor()); + break; + } + case kList: { + mutable_list()->::tensorflow::AttrValue_ListValue::MergeFrom(from.list()); + break; + } + case kFunc: { + mutable_func()->::tensorflow::NameAttrList::MergeFrom(from.func()); + break; + } + case kPlaceholder: { + set_placeholder(from.placeholder()); + break; + } + case VALUE_NOT_SET: { + break; + } + } +} + +void AttrValue::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AttrValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AttrValue::CopyFrom(const AttrValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AttrValue) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool AttrValue::IsInitialized() const { + + return true; +} + +void AttrValue::Swap(AttrValue* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + AttrValue temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void AttrValue::UnsafeArenaSwap(AttrValue* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void AttrValue::InternalSwap(AttrValue* other) { + std::swap(value_, other->value_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata AttrValue::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = AttrValue_descriptor_; + metadata.reflection = AttrValue_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// AttrValue_ListValue + +// repeated bytes s = 2; +int AttrValue_ListValue::s_size() const { + return s_.size(); +} +void AttrValue_ListValue::clear_s() { + s_.Clear(); +} +const ::std::string& AttrValue_ListValue::s(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.s) + return s_.Get(index); +} +::std::string* AttrValue_ListValue::mutable_s(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.ListValue.s) + return s_.Mutable(index); +} +void AttrValue_ListValue::set_s(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.s) + s_.Mutable(index)->assign(value); +} +void AttrValue_ListValue::set_s(int index, const char* value) { + s_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.AttrValue.ListValue.s) +} +void AttrValue_ListValue::set_s(int index, const void* value, size_t size) { + s_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.AttrValue.ListValue.s) +} +::std::string* AttrValue_ListValue::add_s() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.AttrValue.ListValue.s) + return s_.Add(); +} +void AttrValue_ListValue::add_s(const ::std::string& value) { + s_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.s) +} +void AttrValue_ListValue::add_s(const char* value) { + s_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.AttrValue.ListValue.s) +} +void AttrValue_ListValue::add_s(const void* value, size_t size) { + s_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.AttrValue.ListValue.s) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +AttrValue_ListValue::s() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.s) + return s_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +AttrValue_ListValue::mutable_s() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.s) + return &s_; +} + +// repeated int64 i = 3 [packed = true]; +int AttrValue_ListValue::i_size() const { + return i_.size(); +} +void AttrValue_ListValue::clear_i() { + i_.Clear(); +} +::google::protobuf::int64 AttrValue_ListValue::i(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.i) + return i_.Get(index); +} +void AttrValue_ListValue::set_i(int index, ::google::protobuf::int64 value) { + i_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.i) +} +void AttrValue_ListValue::add_i(::google::protobuf::int64 value) { + i_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.i) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +AttrValue_ListValue::i() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.i) + return i_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +AttrValue_ListValue::mutable_i() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.i) + return &i_; +} + +// repeated float f = 4 [packed = true]; +int AttrValue_ListValue::f_size() const { + return f_.size(); +} +void AttrValue_ListValue::clear_f() { + f_.Clear(); +} +float AttrValue_ListValue::f(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.f) + return f_.Get(index); +} +void AttrValue_ListValue::set_f(int index, float value) { + f_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.f) +} +void AttrValue_ListValue::add_f(float value) { + f_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.f) +} +const ::google::protobuf::RepeatedField< float >& +AttrValue_ListValue::f() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.f) + return f_; +} +::google::protobuf::RepeatedField< float >* +AttrValue_ListValue::mutable_f() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.f) + return &f_; +} + +// repeated bool b = 5 [packed = true]; +int AttrValue_ListValue::b_size() const { + return b_.size(); +} +void AttrValue_ListValue::clear_b() { + b_.Clear(); +} +bool AttrValue_ListValue::b(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.b) + return b_.Get(index); +} +void AttrValue_ListValue::set_b(int index, bool value) { + b_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.b) +} +void AttrValue_ListValue::add_b(bool value) { + b_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.b) +} +const ::google::protobuf::RepeatedField< bool >& +AttrValue_ListValue::b() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.b) + return b_; +} +::google::protobuf::RepeatedField< bool >* +AttrValue_ListValue::mutable_b() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.b) + return &b_; +} + +// repeated .tensorflow.DataType type = 6 [packed = true]; +int AttrValue_ListValue::type_size() const { + return type_.size(); +} +void AttrValue_ListValue::clear_type() { + type_.Clear(); +} +::tensorflow::DataType AttrValue_ListValue::type(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.type) + return static_cast< ::tensorflow::DataType >(type_.Get(index)); +} +void AttrValue_ListValue::set_type(int index, ::tensorflow::DataType value) { + type_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.type) +} +void AttrValue_ListValue::add_type(::tensorflow::DataType value) { + type_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.type) +} +const ::google::protobuf::RepeatedField& +AttrValue_ListValue::type() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.type) + return type_; +} +::google::protobuf::RepeatedField* +AttrValue_ListValue::mutable_type() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.type) + return &type_; +} + +// repeated .tensorflow.TensorShapeProto shape = 7; +int AttrValue_ListValue::shape_size() const { + return shape_.size(); +} +void AttrValue_ListValue::clear_shape() { + shape_.Clear(); +} +const ::tensorflow::TensorShapeProto& AttrValue_ListValue::shape(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.shape) + return shape_.Get(index); +} +::tensorflow::TensorShapeProto* AttrValue_ListValue::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.ListValue.shape) + return shape_.Mutable(index); +} +::tensorflow::TensorShapeProto* AttrValue_ListValue::add_shape() { + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto >* +AttrValue_ListValue::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto >& +AttrValue_ListValue::shape() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.shape) + return shape_; +} + +// repeated .tensorflow.TensorProto tensor = 8; +int AttrValue_ListValue::tensor_size() const { + return tensor_.size(); +} +void AttrValue_ListValue::clear_tensor() { + tensor_.Clear(); +} +const ::tensorflow::TensorProto& AttrValue_ListValue::tensor(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.tensor) + return tensor_.Get(index); +} +::tensorflow::TensorProto* AttrValue_ListValue::mutable_tensor(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.ListValue.tensor) + return tensor_.Mutable(index); +} +::tensorflow::TensorProto* AttrValue_ListValue::add_tensor() { + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.tensor) + return tensor_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto >* +AttrValue_ListValue::mutable_tensor() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.tensor) + return &tensor_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto >& +AttrValue_ListValue::tensor() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.tensor) + return tensor_; +} + +inline const AttrValue_ListValue* AttrValue_ListValue::internal_default_instance() { + return &AttrValue_ListValue_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// AttrValue + +// optional bytes s = 2; +bool AttrValue::has_s() const { + return value_case() == kS; +} +void AttrValue::set_has_s() { + _oneof_case_[0] = kS; +} +void AttrValue::clear_s() { + if (has_s()) { + value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +const ::std::string& AttrValue::s() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.s) + if (has_s()) { + return value_.s_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +void AttrValue::set_s(const ::std::string& value) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.s) +} +void AttrValue::set_s(const char* value) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.AttrValue.s) +} +void AttrValue::set_s(const void* value, + size_t size) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.AttrValue.s) +} +::std::string* AttrValue::mutable_s() { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.s) +} +::std::string* AttrValue::release_s() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.s) + if (has_s()) { + clear_has_value(); + return value_.s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +::std::string* AttrValue::unsafe_arena_release_s() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_s()) { + clear_has_value(); + return value_.s_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +void AttrValue::set_allocated_s(::std::string* s) { + if (!has_s()) { + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (s != NULL) { + set_has_s(); + value_.s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.s) +} +void AttrValue::unsafe_arena_set_allocated_s(::std::string* s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_s()) { + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (s) { + set_has_s(); + value_.s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.s) +} + +// optional int64 i = 3; +bool AttrValue::has_i() const { + return value_case() == kI; +} +void AttrValue::set_has_i() { + _oneof_case_[0] = kI; +} +void AttrValue::clear_i() { + if (has_i()) { + value_.i_ = GOOGLE_LONGLONG(0); + clear_has_value(); + } +} +::google::protobuf::int64 AttrValue::i() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.i) + if (has_i()) { + return value_.i_; + } + return GOOGLE_LONGLONG(0); +} +void AttrValue::set_i(::google::protobuf::int64 value) { + if (!has_i()) { + clear_value(); + set_has_i(); + } + value_.i_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.i) +} + +// optional float f = 4; +bool AttrValue::has_f() const { + return value_case() == kF; +} +void AttrValue::set_has_f() { + _oneof_case_[0] = kF; +} +void AttrValue::clear_f() { + if (has_f()) { + value_.f_ = 0; + clear_has_value(); + } +} +float AttrValue::f() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.f) + if (has_f()) { + return value_.f_; + } + return 0; +} +void AttrValue::set_f(float value) { + if (!has_f()) { + clear_value(); + set_has_f(); + } + value_.f_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.f) +} + +// optional bool b = 5; +bool AttrValue::has_b() const { + return value_case() == kB; +} +void AttrValue::set_has_b() { + _oneof_case_[0] = kB; +} +void AttrValue::clear_b() { + if (has_b()) { + value_.b_ = false; + clear_has_value(); + } +} +bool AttrValue::b() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.b) + if (has_b()) { + return value_.b_; + } + return false; +} +void AttrValue::set_b(bool value) { + if (!has_b()) { + clear_value(); + set_has_b(); + } + value_.b_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.b) +} + +// optional .tensorflow.DataType type = 6; +bool AttrValue::has_type() const { + return value_case() == kType; +} +void AttrValue::set_has_type() { + _oneof_case_[0] = kType; +} +void AttrValue::clear_type() { + if (has_type()) { + value_.type_ = 0; + clear_has_value(); + } +} +::tensorflow::DataType AttrValue::type() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.type) + if (has_type()) { + return static_cast< ::tensorflow::DataType >(value_.type_); + } + return static_cast< ::tensorflow::DataType >(0); +} +void AttrValue::set_type(::tensorflow::DataType value) { + if (!has_type()) { + clear_value(); + set_has_type(); + } + value_.type_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.type) +} + +// optional .tensorflow.TensorShapeProto shape = 7; +bool AttrValue::has_shape() const { + return value_case() == kShape; +} +void AttrValue::set_has_shape() { + _oneof_case_[0] = kShape; +} +void AttrValue::clear_shape() { + if (has_shape()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.shape_; + } + clear_has_value(); + } +} + const ::tensorflow::TensorShapeProto& AttrValue::shape() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.shape) + return has_shape() + ? *value_.shape_ + : ::tensorflow::TensorShapeProto::default_instance(); +} +::tensorflow::TensorShapeProto* AttrValue::mutable_shape() { + if (!has_shape()) { + clear_value(); + set_has_shape(); + value_.shape_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.shape) + return value_.shape_; +} +::tensorflow::TensorShapeProto* AttrValue::release_shape() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.shape) + if (has_shape()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::TensorShapeProto* temp = new ::tensorflow::TensorShapeProto(*value_.shape_); + value_.shape_ = NULL; + return temp; + } else { + ::tensorflow::TensorShapeProto* temp = value_.shape_; + value_.shape_ = NULL; + return temp; + } + } else { + return NULL; + } +} +void AttrValue::set_allocated_shape(::tensorflow::TensorShapeProto* shape) { + clear_value(); + if (shape) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(shape) == NULL) { + GetArenaNoVirtual()->Own(shape); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(shape)) { + ::tensorflow::TensorShapeProto* new_shape = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >( + GetArenaNoVirtual()); + new_shape->CopyFrom(*shape); + shape = new_shape; + } + set_has_shape(); + value_.shape_ = shape; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.shape) +} + ::tensorflow::TensorShapeProto* AttrValue::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.shape) + if (has_shape()) { + clear_has_value(); + ::tensorflow::TensorShapeProto* temp = value_.shape_; + value_.shape_ = NULL; + return temp; + } else { + return NULL; + } +} + void AttrValue::unsafe_arena_set_allocated_shape(::tensorflow::TensorShapeProto* shape) { + clear_value(); + if (shape) { + set_has_shape(); + value_.shape_ = shape; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.shape) +} + +// optional .tensorflow.TensorProto tensor = 8; +bool AttrValue::has_tensor() const { + return value_case() == kTensor; +} +void AttrValue::set_has_tensor() { + _oneof_case_[0] = kTensor; +} +void AttrValue::clear_tensor() { + if (has_tensor()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + clear_has_value(); + } +} + const ::tensorflow::TensorProto& AttrValue::tensor() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.tensor) + return has_tensor() + ? *value_.tensor_ + : ::tensorflow::TensorProto::default_instance(); +} +::tensorflow::TensorProto* AttrValue::mutable_tensor() { + if (!has_tensor()) { + clear_value(); + set_has_tensor(); + value_.tensor_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.tensor) + return value_.tensor_; +} +::tensorflow::TensorProto* AttrValue::release_tensor() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.tensor) + if (has_tensor()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::TensorProto* temp = new ::tensorflow::TensorProto(*value_.tensor_); + value_.tensor_ = NULL; + return temp; + } else { + ::tensorflow::TensorProto* temp = value_.tensor_; + value_.tensor_ = NULL; + return temp; + } + } else { + return NULL; + } +} +void AttrValue::set_allocated_tensor(::tensorflow::TensorProto* tensor) { + clear_value(); + if (tensor) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(tensor) == NULL) { + GetArenaNoVirtual()->Own(tensor); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(tensor)) { + ::tensorflow::TensorProto* new_tensor = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorProto >( + GetArenaNoVirtual()); + new_tensor->CopyFrom(*tensor); + tensor = new_tensor; + } + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.tensor) +} + ::tensorflow::TensorProto* AttrValue::unsafe_arena_release_tensor() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.tensor) + if (has_tensor()) { + clear_has_value(); + ::tensorflow::TensorProto* temp = value_.tensor_; + value_.tensor_ = NULL; + return temp; + } else { + return NULL; + } +} + void AttrValue::unsafe_arena_set_allocated_tensor(::tensorflow::TensorProto* tensor) { + clear_value(); + if (tensor) { + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.tensor) +} + +// optional .tensorflow.AttrValue.ListValue list = 1; +bool AttrValue::has_list() const { + return value_case() == kList; +} +void AttrValue::set_has_list() { + _oneof_case_[0] = kList; +} +void AttrValue::clear_list() { + if (has_list()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.list_; + } + clear_has_value(); + } +} + const ::tensorflow::AttrValue_ListValue& AttrValue::list() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.list) + return has_list() + ? *value_.list_ + : ::tensorflow::AttrValue_ListValue::default_instance(); +} +::tensorflow::AttrValue_ListValue* AttrValue::mutable_list() { + if (!has_list()) { + clear_value(); + set_has_list(); + value_.list_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue_ListValue >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.list) + return value_.list_; +} +::tensorflow::AttrValue_ListValue* AttrValue::release_list() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.list) + if (has_list()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::AttrValue_ListValue* temp = new ::tensorflow::AttrValue_ListValue(*value_.list_); + value_.list_ = NULL; + return temp; + } else { + ::tensorflow::AttrValue_ListValue* temp = value_.list_; + value_.list_ = NULL; + return temp; + } + } else { + return NULL; + } +} +void AttrValue::set_allocated_list(::tensorflow::AttrValue_ListValue* list) { + clear_value(); + if (list) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(list) == NULL) { + GetArenaNoVirtual()->Own(list); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(list)) { + ::tensorflow::AttrValue_ListValue* new_list = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue_ListValue >( + GetArenaNoVirtual()); + new_list->CopyFrom(*list); + list = new_list; + } + set_has_list(); + value_.list_ = list; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.list) +} + ::tensorflow::AttrValue_ListValue* AttrValue::unsafe_arena_release_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.list) + if (has_list()) { + clear_has_value(); + ::tensorflow::AttrValue_ListValue* temp = value_.list_; + value_.list_ = NULL; + return temp; + } else { + return NULL; + } +} + void AttrValue::unsafe_arena_set_allocated_list(::tensorflow::AttrValue_ListValue* list) { + clear_value(); + if (list) { + set_has_list(); + value_.list_ = list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.list) +} + +// optional .tensorflow.NameAttrList func = 10; +bool AttrValue::has_func() const { + return value_case() == kFunc; +} +void AttrValue::set_has_func() { + _oneof_case_[0] = kFunc; +} +void AttrValue::clear_func() { + if (has_func()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.func_; + } + clear_has_value(); + } +} + const ::tensorflow::NameAttrList& AttrValue::func() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.func) + return has_func() + ? *value_.func_ + : ::tensorflow::NameAttrList::default_instance(); +} +::tensorflow::NameAttrList* AttrValue::mutable_func() { + if (!has_func()) { + clear_value(); + set_has_func(); + value_.func_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::NameAttrList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.func) + return value_.func_; +} +::tensorflow::NameAttrList* AttrValue::release_func() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.func) + if (has_func()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::NameAttrList* temp = new ::tensorflow::NameAttrList(*value_.func_); + value_.func_ = NULL; + return temp; + } else { + ::tensorflow::NameAttrList* temp = value_.func_; + value_.func_ = NULL; + return temp; + } + } else { + return NULL; + } +} +void AttrValue::set_allocated_func(::tensorflow::NameAttrList* func) { + clear_value(); + if (func) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(func) == NULL) { + GetArenaNoVirtual()->Own(func); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(func)) { + ::tensorflow::NameAttrList* new_func = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::NameAttrList >( + GetArenaNoVirtual()); + new_func->CopyFrom(*func); + func = new_func; + } + set_has_func(); + value_.func_ = func; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.func) +} + ::tensorflow::NameAttrList* AttrValue::unsafe_arena_release_func() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.func) + if (has_func()) { + clear_has_value(); + ::tensorflow::NameAttrList* temp = value_.func_; + value_.func_ = NULL; + return temp; + } else { + return NULL; + } +} + void AttrValue::unsafe_arena_set_allocated_func(::tensorflow::NameAttrList* func) { + clear_value(); + if (func) { + set_has_func(); + value_.func_ = func; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.func) +} + +// optional string placeholder = 9; +bool AttrValue::has_placeholder() const { + return value_case() == kPlaceholder; +} +void AttrValue::set_has_placeholder() { + _oneof_case_[0] = kPlaceholder; +} +void AttrValue::clear_placeholder() { + if (has_placeholder()) { + value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +const ::std::string& AttrValue::placeholder() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.placeholder) + if (has_placeholder()) { + return value_.placeholder_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +void AttrValue::set_placeholder(const ::std::string& value) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.placeholder) +} +void AttrValue::set_placeholder(const char* value) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.AttrValue.placeholder) +} +void AttrValue::set_placeholder(const char* value, + size_t size) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.AttrValue.placeholder) +} +::std::string* AttrValue::mutable_placeholder() { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.placeholder_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.placeholder) +} +::std::string* AttrValue::release_placeholder() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.placeholder) + if (has_placeholder()) { + clear_has_value(); + return value_.placeholder_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +::std::string* AttrValue::unsafe_arena_release_placeholder() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.placeholder) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_placeholder()) { + clear_has_value(); + return value_.placeholder_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +void AttrValue::set_allocated_placeholder(::std::string* placeholder) { + if (!has_placeholder()) { + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (placeholder != NULL) { + set_has_placeholder(); + value_.placeholder_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.placeholder) +} +void AttrValue::unsafe_arena_set_allocated_placeholder(::std::string* placeholder) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_placeholder()) { + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (placeholder) { + set_has_placeholder(); + value_.placeholder_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.placeholder) +} + +bool AttrValue::has_value() const { + return value_case() != VALUE_NOT_SET; +} +void AttrValue::clear_has_value() { + _oneof_case_[0] = VALUE_NOT_SET; +} +AttrValue::ValueCase AttrValue::value_case() const { + return AttrValue::ValueCase(_oneof_case_[0]); +} +inline const AttrValue* AttrValue::internal_default_instance() { + return &AttrValue_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NameAttrList::kNameFieldNumber; +const int NameAttrList::kAttrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NameAttrList::NameAttrList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_attr_5fvalue_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.NameAttrList) +} +NameAttrList::NameAttrList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + attr_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_attr_5fvalue_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.NameAttrList) +} + +void NameAttrList::InitAsDefaultInstance() { +} + +NameAttrList::NameAttrList(const NameAttrList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.NameAttrList) +} + +void NameAttrList::SharedCtor() { + attr_.SetAssignDescriptorCallback( + protobuf_AssignDescriptorsOnce); + attr_.SetEntryDescriptor( + &::tensorflow::NameAttrList_AttrEntry_descriptor_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; +} + +NameAttrList::~NameAttrList() { + // @@protoc_insertion_point(destructor:tensorflow.NameAttrList) + SharedDtor(); +} + +void NameAttrList::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void NameAttrList::ArenaDtor(void* object) { + NameAttrList* _this = reinterpret_cast< NameAttrList* >(object); + (void)_this; +} +void NameAttrList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NameAttrList::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NameAttrList::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NameAttrList_descriptor_; +} + +const NameAttrList& NameAttrList::default_instance() { + protobuf_InitDefaults_attr_5fvalue_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NameAttrList_default_instance_; + +NameAttrList* NameAttrList::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void NameAttrList::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.NameAttrList) + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + attr_.Clear(); +} + +bool NameAttrList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.NameAttrList) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NameAttrList.name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_attr; + break; + } + + // map attr = 2; + case 2: { + if (tag == 18) { + parse_attr: + DO_(input->IncrementRecursionDepth()); + parse_loop_attr: + NameAttrList_AttrEntry::Parser< ::google::protobuf::internal::MapField< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), parser.key().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NameAttrList.AttrEntry.key")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_attr; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.NameAttrList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.NameAttrList) + return false; +#undef DO_ +} + +void NameAttrList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.NameAttrList) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NameAttrList.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // map attr = 2; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), p->first.length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NameAttrList.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterminstic() && + this->attr().size() > 1) { + ::google::protobuf::scoped_array items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[n] = SortItem(&*it); + } + ::std::sort(&items[0], &items[n], Less()); + ::google::protobuf::scoped_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[i]->first, items[i]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[i]); + } + } else { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // @@protoc_insertion_point(serialize_end:tensorflow.NameAttrList) +} + +::google::protobuf::uint8* NameAttrList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NameAttrList) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NameAttrList.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // map attr = 2; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), p->first.length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NameAttrList.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::google::protobuf::scoped_array items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[n] = SortItem(&*it); + } + ::std::sort(&items[0], &items[n], Less()); + ::google::protobuf::scoped_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[i]->first, items[i]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[i]); + } + } else { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NameAttrList) + return target; +} + +size_t NameAttrList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.NameAttrList) + size_t total_size = 0; + + // optional string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // map attr = 2; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NameAttrList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.NameAttrList) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NameAttrList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.NameAttrList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.NameAttrList) + UnsafeMergeFrom(*source); + } +} + +void NameAttrList::MergeFrom(const NameAttrList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NameAttrList) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NameAttrList::UnsafeMergeFrom(const NameAttrList& from) { + GOOGLE_DCHECK(&from != this); + attr_.MergeFrom(from.attr_); + if (from.name().size() > 0) { + set_name(from.name()); + } +} + +void NameAttrList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.NameAttrList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NameAttrList::CopyFrom(const NameAttrList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NameAttrList) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NameAttrList::IsInitialized() const { + + return true; +} + +void NameAttrList::Swap(NameAttrList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NameAttrList temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void NameAttrList::UnsafeArenaSwap(NameAttrList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NameAttrList::InternalSwap(NameAttrList* other) { + name_.Swap(&other->name_); + attr_.Swap(&other->attr_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NameAttrList::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NameAttrList_descriptor_; + metadata.reflection = NameAttrList_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NameAttrList + +// optional string name = 1; +void NameAttrList::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& NameAttrList::name() const { + // @@protoc_insertion_point(field_get:tensorflow.NameAttrList.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void NameAttrList::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NameAttrList.name) +} +void NameAttrList::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NameAttrList.name) +} +void NameAttrList::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NameAttrList.name) +} +::std::string* NameAttrList::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NameAttrList.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NameAttrList::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.NameAttrList.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NameAttrList::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NameAttrList.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void NameAttrList::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NameAttrList.name) +} +void NameAttrList::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NameAttrList.name) +} + +// map attr = 2; +int NameAttrList::attr_size() const { + return attr_.size(); +} +void NameAttrList::clear_attr() { + attr_.Clear(); +} + const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& +NameAttrList::attr() const { + // @@protoc_insertion_point(field_map:tensorflow.NameAttrList.attr) + return attr_.GetMap(); +} + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* +NameAttrList::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:tensorflow.NameAttrList.attr) + return attr_.MutableMap(); +} + +inline const NameAttrList* NameAttrList::internal_default_instance() { + return &NameAttrList_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/attr_value.pb.h b/modules/dnn/misc/tensorflow/attr_value.pb.h new file mode 100644 index 0000000000..d37a724ab1 --- /dev/null +++ b/modules/dnn/misc/tensorflow/attr_value.pb.h @@ -0,0 +1,1697 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: attr_value.proto + +#ifndef PROTOBUF_attr_5fvalue_2eproto__INCLUDED +#define PROTOBUF_attr_5fvalue_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "tensor.pb.h" +#include "tensor_shape.pb.h" +#include "types.pb.h" +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_attr_5fvalue_2eproto(); +void protobuf_InitDefaults_attr_5fvalue_2eproto(); +void protobuf_AssignDesc_attr_5fvalue_2eproto(); +void protobuf_ShutdownFile_attr_5fvalue_2eproto(); + +class AttrValue; +class AttrValue_ListValue; +class NameAttrList; + +// =================================================================== + +class AttrValue_ListValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.AttrValue.ListValue) */ { + public: + AttrValue_ListValue(); + virtual ~AttrValue_ListValue(); + + AttrValue_ListValue(const AttrValue_ListValue& from); + + inline AttrValue_ListValue& operator=(const AttrValue_ListValue& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AttrValue_ListValue& default_instance(); + + static const AttrValue_ListValue* internal_default_instance(); + + void UnsafeArenaSwap(AttrValue_ListValue* other); + void Swap(AttrValue_ListValue* other); + + // implements Message ---------------------------------------------- + + inline AttrValue_ListValue* New() const { return New(NULL); } + + AttrValue_ListValue* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const AttrValue_ListValue& from); + void MergeFrom(const AttrValue_ListValue& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(AttrValue_ListValue* other); + void UnsafeMergeFrom(const AttrValue_ListValue& from); + protected: + explicit AttrValue_ListValue(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bytes s = 2; + int s_size() const; + void clear_s(); + static const int kSFieldNumber = 2; + const ::std::string& s(int index) const; + ::std::string* mutable_s(int index); + void set_s(int index, const ::std::string& value); + void set_s(int index, const char* value); + void set_s(int index, const void* value, size_t size); + ::std::string* add_s(); + void add_s(const ::std::string& value); + void add_s(const char* value); + void add_s(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& s() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_s(); + + // repeated int64 i = 3 [packed = true]; + int i_size() const; + void clear_i(); + static const int kIFieldNumber = 3; + ::google::protobuf::int64 i(int index) const; + void set_i(int index, ::google::protobuf::int64 value); + void add_i(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + i() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_i(); + + // repeated float f = 4 [packed = true]; + int f_size() const; + void clear_f(); + static const int kFFieldNumber = 4; + float f(int index) const; + void set_f(int index, float value); + void add_f(float value); + const ::google::protobuf::RepeatedField< float >& + f() const; + ::google::protobuf::RepeatedField< float >* + mutable_f(); + + // repeated bool b = 5 [packed = true]; + int b_size() const; + void clear_b(); + static const int kBFieldNumber = 5; + bool b(int index) const; + void set_b(int index, bool value); + void add_b(bool value); + const ::google::protobuf::RepeatedField< bool >& + b() const; + ::google::protobuf::RepeatedField< bool >* + mutable_b(); + + // repeated .tensorflow.DataType type = 6 [packed = true]; + int type_size() const; + void clear_type(); + static const int kTypeFieldNumber = 6; + ::tensorflow::DataType type(int index) const; + void set_type(int index, ::tensorflow::DataType value); + void add_type(::tensorflow::DataType value); + const ::google::protobuf::RepeatedField& type() const; + ::google::protobuf::RepeatedField* mutable_type(); + + // repeated .tensorflow.TensorShapeProto shape = 7; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + const ::tensorflow::TensorShapeProto& shape(int index) const; + ::tensorflow::TensorShapeProto* mutable_shape(int index); + ::tensorflow::TensorShapeProto* add_shape(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto >& + shape() const; + + // repeated .tensorflow.TensorProto tensor = 8; + int tensor_size() const; + void clear_tensor(); + static const int kTensorFieldNumber = 8; + const ::tensorflow::TensorProto& tensor(int index) const; + ::tensorflow::TensorProto* mutable_tensor(int index); + ::tensorflow::TensorProto* add_tensor(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto >* + mutable_tensor(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto >& + tensor() const; + + // @@protoc_insertion_point(class_scope:tensorflow.AttrValue.ListValue) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> s_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > i_; + mutable int _i_cached_byte_size_; + ::google::protobuf::RepeatedField< float > f_; + mutable int _f_cached_byte_size_; + ::google::protobuf::RepeatedField< bool > b_; + mutable int _b_cached_byte_size_; + ::google::protobuf::RepeatedField type_; + mutable int _type_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto > shape_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto > tensor_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_attr_5fvalue_2eproto_impl(); + friend void protobuf_AddDesc_attr_5fvalue_2eproto_impl(); + friend void protobuf_AssignDesc_attr_5fvalue_2eproto(); + friend void protobuf_ShutdownFile_attr_5fvalue_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed AttrValue_ListValue_default_instance_; + +// ------------------------------------------------------------------- + +class AttrValue : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.AttrValue) */ { + public: + AttrValue(); + virtual ~AttrValue(); + + AttrValue(const AttrValue& from); + + inline AttrValue& operator=(const AttrValue& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const AttrValue& default_instance(); + + enum ValueCase { + kS = 2, + kI = 3, + kF = 4, + kB = 5, + kType = 6, + kShape = 7, + kTensor = 8, + kList = 1, + kFunc = 10, + kPlaceholder = 9, + VALUE_NOT_SET = 0, + }; + + static const AttrValue* internal_default_instance(); + + void UnsafeArenaSwap(AttrValue* other); + void Swap(AttrValue* other); + + // implements Message ---------------------------------------------- + + inline AttrValue* New() const { return New(NULL); } + + AttrValue* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const AttrValue& from); + void MergeFrom(const AttrValue& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(AttrValue* other); + void UnsafeMergeFrom(const AttrValue& from); + protected: + explicit AttrValue(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef AttrValue_ListValue ListValue; + + // accessors ------------------------------------------------------- + + // optional bytes s = 2; + private: + bool has_s() const; + public: + void clear_s(); + static const int kSFieldNumber = 2; + const ::std::string& s() const; + void set_s(const ::std::string& value); + void set_s(const char* value); + void set_s(const void* value, size_t size); + ::std::string* mutable_s(); + ::std::string* release_s(); + void set_allocated_s(::std::string* s); + ::std::string* unsafe_arena_release_s(); + void unsafe_arena_set_allocated_s( + ::std::string* s); + + // optional int64 i = 3; + private: + bool has_i() const; + public: + void clear_i(); + static const int kIFieldNumber = 3; + ::google::protobuf::int64 i() const; + void set_i(::google::protobuf::int64 value); + + // optional float f = 4; + private: + bool has_f() const; + public: + void clear_f(); + static const int kFFieldNumber = 4; + float f() const; + void set_f(float value); + + // optional bool b = 5; + private: + bool has_b() const; + public: + void clear_b(); + static const int kBFieldNumber = 5; + bool b() const; + void set_b(bool value); + + // optional .tensorflow.DataType type = 6; + private: + bool has_type() const; + public: + void clear_type(); + static const int kTypeFieldNumber = 6; + ::tensorflow::DataType type() const; + void set_type(::tensorflow::DataType value); + + // optional .tensorflow.TensorShapeProto shape = 7; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + private: + void _slow_mutable_shape(); + void _slow_set_allocated_shape( + ::google::protobuf::Arena* message_arena, ::tensorflow::TensorShapeProto** shape); + ::tensorflow::TensorShapeProto* _slow_release_shape(); + public: + const ::tensorflow::TensorShapeProto& shape() const; + ::tensorflow::TensorShapeProto* mutable_shape(); + ::tensorflow::TensorShapeProto* release_shape(); + void set_allocated_shape(::tensorflow::TensorShapeProto* shape); + ::tensorflow::TensorShapeProto* unsafe_arena_release_shape(); + void unsafe_arena_set_allocated_shape( + ::tensorflow::TensorShapeProto* shape); + + // optional .tensorflow.TensorProto tensor = 8; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 8; + private: + void _slow_mutable_tensor(); + void _slow_set_allocated_tensor( + ::google::protobuf::Arena* message_arena, ::tensorflow::TensorProto** tensor); + ::tensorflow::TensorProto* _slow_release_tensor(); + public: + const ::tensorflow::TensorProto& tensor() const; + ::tensorflow::TensorProto* mutable_tensor(); + ::tensorflow::TensorProto* release_tensor(); + void set_allocated_tensor(::tensorflow::TensorProto* tensor); + ::tensorflow::TensorProto* unsafe_arena_release_tensor(); + void unsafe_arena_set_allocated_tensor( + ::tensorflow::TensorProto* tensor); + + // optional .tensorflow.AttrValue.ListValue list = 1; + bool has_list() const; + void clear_list(); + static const int kListFieldNumber = 1; + private: + void _slow_mutable_list(); + void _slow_set_allocated_list( + ::google::protobuf::Arena* message_arena, ::tensorflow::AttrValue_ListValue** list); + ::tensorflow::AttrValue_ListValue* _slow_release_list(); + public: + const ::tensorflow::AttrValue_ListValue& list() const; + ::tensorflow::AttrValue_ListValue* mutable_list(); + ::tensorflow::AttrValue_ListValue* release_list(); + void set_allocated_list(::tensorflow::AttrValue_ListValue* list); + ::tensorflow::AttrValue_ListValue* unsafe_arena_release_list(); + void unsafe_arena_set_allocated_list( + ::tensorflow::AttrValue_ListValue* list); + + // optional .tensorflow.NameAttrList func = 10; + bool has_func() const; + void clear_func(); + static const int kFuncFieldNumber = 10; + private: + void _slow_mutable_func(); + void _slow_set_allocated_func( + ::google::protobuf::Arena* message_arena, ::tensorflow::NameAttrList** func); + ::tensorflow::NameAttrList* _slow_release_func(); + public: + const ::tensorflow::NameAttrList& func() const; + ::tensorflow::NameAttrList* mutable_func(); + ::tensorflow::NameAttrList* release_func(); + void set_allocated_func(::tensorflow::NameAttrList* func); + ::tensorflow::NameAttrList* unsafe_arena_release_func(); + void unsafe_arena_set_allocated_func( + ::tensorflow::NameAttrList* func); + + // optional string placeholder = 9; + private: + bool has_placeholder() const; + public: + void clear_placeholder(); + static const int kPlaceholderFieldNumber = 9; + const ::std::string& placeholder() const; + void set_placeholder(const ::std::string& value); + void set_placeholder(const char* value); + void set_placeholder(const char* value, size_t size); + ::std::string* mutable_placeholder(); + ::std::string* release_placeholder(); + void set_allocated_placeholder(::std::string* placeholder); + ::std::string* unsafe_arena_release_placeholder(); + void unsafe_arena_set_allocated_placeholder( + ::std::string* placeholder); + + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:tensorflow.AttrValue) + private: + inline void set_has_s(); + inline void set_has_i(); + inline void set_has_f(); + inline void set_has_b(); + inline void set_has_type(); + inline void set_has_shape(); + inline void set_has_tensor(); + inline void set_has_list(); + inline void set_has_func(); + inline void set_has_placeholder(); + + inline bool has_value() const; + void clear_value(); + inline void clear_has_value(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + union ValueUnion { + ValueUnion() {} + ::google::protobuf::internal::ArenaStringPtr s_; + ::google::protobuf::int64 i_; + float f_; + bool b_; + int type_; + ::tensorflow::TensorShapeProto* shape_; + ::tensorflow::TensorProto* tensor_; + ::tensorflow::AttrValue_ListValue* list_; + ::tensorflow::NameAttrList* func_; + ::google::protobuf::internal::ArenaStringPtr placeholder_; + } value_; + mutable int _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_InitDefaults_attr_5fvalue_2eproto_impl(); + friend void protobuf_AddDesc_attr_5fvalue_2eproto_impl(); + friend void protobuf_AssignDesc_attr_5fvalue_2eproto(); + friend void protobuf_ShutdownFile_attr_5fvalue_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed AttrValue_default_instance_; + +// ------------------------------------------------------------------- + +class NameAttrList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.NameAttrList) */ { + public: + NameAttrList(); + virtual ~NameAttrList(); + + NameAttrList(const NameAttrList& from); + + inline NameAttrList& operator=(const NameAttrList& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NameAttrList& default_instance(); + + static const NameAttrList* internal_default_instance(); + + void UnsafeArenaSwap(NameAttrList* other); + void Swap(NameAttrList* other); + + // implements Message ---------------------------------------------- + + inline NameAttrList* New() const { return New(NULL); } + + NameAttrList* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NameAttrList& from); + void MergeFrom(const NameAttrList& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NameAttrList* other); + void UnsafeMergeFrom(const NameAttrList& from); + protected: + explicit NameAttrList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // optional string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // map attr = 2; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 2; + const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* + mutable_attr(); + + // @@protoc_insertion_point(class_scope:tensorflow.NameAttrList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + typedef ::google::protobuf::internal::MapEntryLite< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > + NameAttrList_AttrEntry; + ::google::protobuf::internal::MapField< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::google::protobuf::internal::ArenaStringPtr name_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_attr_5fvalue_2eproto_impl(); + friend void protobuf_AddDesc_attr_5fvalue_2eproto_impl(); + friend void protobuf_AssignDesc_attr_5fvalue_2eproto(); + friend void protobuf_ShutdownFile_attr_5fvalue_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NameAttrList_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// AttrValue_ListValue + +// repeated bytes s = 2; +inline int AttrValue_ListValue::s_size() const { + return s_.size(); +} +inline void AttrValue_ListValue::clear_s() { + s_.Clear(); +} +inline const ::std::string& AttrValue_ListValue::s(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.s) + return s_.Get(index); +} +inline ::std::string* AttrValue_ListValue::mutable_s(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.ListValue.s) + return s_.Mutable(index); +} +inline void AttrValue_ListValue::set_s(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.s) + s_.Mutable(index)->assign(value); +} +inline void AttrValue_ListValue::set_s(int index, const char* value) { + s_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.AttrValue.ListValue.s) +} +inline void AttrValue_ListValue::set_s(int index, const void* value, size_t size) { + s_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.AttrValue.ListValue.s) +} +inline ::std::string* AttrValue_ListValue::add_s() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.AttrValue.ListValue.s) + return s_.Add(); +} +inline void AttrValue_ListValue::add_s(const ::std::string& value) { + s_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.s) +} +inline void AttrValue_ListValue::add_s(const char* value) { + s_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.AttrValue.ListValue.s) +} +inline void AttrValue_ListValue::add_s(const void* value, size_t size) { + s_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.AttrValue.ListValue.s) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +AttrValue_ListValue::s() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.s) + return s_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +AttrValue_ListValue::mutable_s() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.s) + return &s_; +} + +// repeated int64 i = 3 [packed = true]; +inline int AttrValue_ListValue::i_size() const { + return i_.size(); +} +inline void AttrValue_ListValue::clear_i() { + i_.Clear(); +} +inline ::google::protobuf::int64 AttrValue_ListValue::i(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.i) + return i_.Get(index); +} +inline void AttrValue_ListValue::set_i(int index, ::google::protobuf::int64 value) { + i_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.i) +} +inline void AttrValue_ListValue::add_i(::google::protobuf::int64 value) { + i_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.i) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +AttrValue_ListValue::i() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.i) + return i_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +AttrValue_ListValue::mutable_i() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.i) + return &i_; +} + +// repeated float f = 4 [packed = true]; +inline int AttrValue_ListValue::f_size() const { + return f_.size(); +} +inline void AttrValue_ListValue::clear_f() { + f_.Clear(); +} +inline float AttrValue_ListValue::f(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.f) + return f_.Get(index); +} +inline void AttrValue_ListValue::set_f(int index, float value) { + f_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.f) +} +inline void AttrValue_ListValue::add_f(float value) { + f_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.f) +} +inline const ::google::protobuf::RepeatedField< float >& +AttrValue_ListValue::f() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.f) + return f_; +} +inline ::google::protobuf::RepeatedField< float >* +AttrValue_ListValue::mutable_f() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.f) + return &f_; +} + +// repeated bool b = 5 [packed = true]; +inline int AttrValue_ListValue::b_size() const { + return b_.size(); +} +inline void AttrValue_ListValue::clear_b() { + b_.Clear(); +} +inline bool AttrValue_ListValue::b(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.b) + return b_.Get(index); +} +inline void AttrValue_ListValue::set_b(int index, bool value) { + b_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.b) +} +inline void AttrValue_ListValue::add_b(bool value) { + b_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.b) +} +inline const ::google::protobuf::RepeatedField< bool >& +AttrValue_ListValue::b() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.b) + return b_; +} +inline ::google::protobuf::RepeatedField< bool >* +AttrValue_ListValue::mutable_b() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.b) + return &b_; +} + +// repeated .tensorflow.DataType type = 6 [packed = true]; +inline int AttrValue_ListValue::type_size() const { + return type_.size(); +} +inline void AttrValue_ListValue::clear_type() { + type_.Clear(); +} +inline ::tensorflow::DataType AttrValue_ListValue::type(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.type) + return static_cast< ::tensorflow::DataType >(type_.Get(index)); +} +inline void AttrValue_ListValue::set_type(int index, ::tensorflow::DataType value) { + type_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.ListValue.type) +} +inline void AttrValue_ListValue::add_type(::tensorflow::DataType value) { + type_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.type) +} +inline const ::google::protobuf::RepeatedField& +AttrValue_ListValue::type() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.type) + return type_; +} +inline ::google::protobuf::RepeatedField* +AttrValue_ListValue::mutable_type() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.type) + return &type_; +} + +// repeated .tensorflow.TensorShapeProto shape = 7; +inline int AttrValue_ListValue::shape_size() const { + return shape_.size(); +} +inline void AttrValue_ListValue::clear_shape() { + shape_.Clear(); +} +inline const ::tensorflow::TensorShapeProto& AttrValue_ListValue::shape(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.shape) + return shape_.Get(index); +} +inline ::tensorflow::TensorShapeProto* AttrValue_ListValue::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.ListValue.shape) + return shape_.Mutable(index); +} +inline ::tensorflow::TensorShapeProto* AttrValue_ListValue::add_shape() { + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto >* +AttrValue_ListValue::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto >& +AttrValue_ListValue::shape() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.shape) + return shape_; +} + +// repeated .tensorflow.TensorProto tensor = 8; +inline int AttrValue_ListValue::tensor_size() const { + return tensor_.size(); +} +inline void AttrValue_ListValue::clear_tensor() { + tensor_.Clear(); +} +inline const ::tensorflow::TensorProto& AttrValue_ListValue::tensor(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.ListValue.tensor) + return tensor_.Get(index); +} +inline ::tensorflow::TensorProto* AttrValue_ListValue::mutable_tensor(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.ListValue.tensor) + return tensor_.Mutable(index); +} +inline ::tensorflow::TensorProto* AttrValue_ListValue::add_tensor() { + // @@protoc_insertion_point(field_add:tensorflow.AttrValue.ListValue.tensor) + return tensor_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto >* +AttrValue_ListValue::mutable_tensor() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.AttrValue.ListValue.tensor) + return &tensor_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorProto >& +AttrValue_ListValue::tensor() const { + // @@protoc_insertion_point(field_list:tensorflow.AttrValue.ListValue.tensor) + return tensor_; +} + +inline const AttrValue_ListValue* AttrValue_ListValue::internal_default_instance() { + return &AttrValue_ListValue_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// AttrValue + +// optional bytes s = 2; +inline bool AttrValue::has_s() const { + return value_case() == kS; +} +inline void AttrValue::set_has_s() { + _oneof_case_[0] = kS; +} +inline void AttrValue::clear_s() { + if (has_s()) { + value_.s_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +inline const ::std::string& AttrValue::s() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.s) + if (has_s()) { + return value_.s_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void AttrValue::set_s(const ::std::string& value) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.s) +} +inline void AttrValue::set_s(const char* value) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.AttrValue.s) +} +inline void AttrValue::set_s(const void* value, + size_t size) { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.s_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.AttrValue.s) +} +inline ::std::string* AttrValue::mutable_s() { + if (!has_s()) { + clear_value(); + set_has_s(); + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.s_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.s) +} +inline ::std::string* AttrValue::release_s() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.s) + if (has_s()) { + clear_has_value(); + return value_.s_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline ::std::string* AttrValue::unsafe_arena_release_s() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.s) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_s()) { + clear_has_value(); + return value_.s_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_s(::std::string* s) { + if (!has_s()) { + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (s != NULL) { + set_has_s(); + value_.s_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.s) +} +inline void AttrValue::unsafe_arena_set_allocated_s(::std::string* s) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_s()) { + value_.s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (s) { + set_has_s(); + value_.s_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), s, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.s) +} + +// optional int64 i = 3; +inline bool AttrValue::has_i() const { + return value_case() == kI; +} +inline void AttrValue::set_has_i() { + _oneof_case_[0] = kI; +} +inline void AttrValue::clear_i() { + if (has_i()) { + value_.i_ = GOOGLE_LONGLONG(0); + clear_has_value(); + } +} +inline ::google::protobuf::int64 AttrValue::i() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.i) + if (has_i()) { + return value_.i_; + } + return GOOGLE_LONGLONG(0); +} +inline void AttrValue::set_i(::google::protobuf::int64 value) { + if (!has_i()) { + clear_value(); + set_has_i(); + } + value_.i_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.i) +} + +// optional float f = 4; +inline bool AttrValue::has_f() const { + return value_case() == kF; +} +inline void AttrValue::set_has_f() { + _oneof_case_[0] = kF; +} +inline void AttrValue::clear_f() { + if (has_f()) { + value_.f_ = 0; + clear_has_value(); + } +} +inline float AttrValue::f() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.f) + if (has_f()) { + return value_.f_; + } + return 0; +} +inline void AttrValue::set_f(float value) { + if (!has_f()) { + clear_value(); + set_has_f(); + } + value_.f_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.f) +} + +// optional bool b = 5; +inline bool AttrValue::has_b() const { + return value_case() == kB; +} +inline void AttrValue::set_has_b() { + _oneof_case_[0] = kB; +} +inline void AttrValue::clear_b() { + if (has_b()) { + value_.b_ = false; + clear_has_value(); + } +} +inline bool AttrValue::b() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.b) + if (has_b()) { + return value_.b_; + } + return false; +} +inline void AttrValue::set_b(bool value) { + if (!has_b()) { + clear_value(); + set_has_b(); + } + value_.b_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.b) +} + +// optional .tensorflow.DataType type = 6; +inline bool AttrValue::has_type() const { + return value_case() == kType; +} +inline void AttrValue::set_has_type() { + _oneof_case_[0] = kType; +} +inline void AttrValue::clear_type() { + if (has_type()) { + value_.type_ = 0; + clear_has_value(); + } +} +inline ::tensorflow::DataType AttrValue::type() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.type) + if (has_type()) { + return static_cast< ::tensorflow::DataType >(value_.type_); + } + return static_cast< ::tensorflow::DataType >(0); +} +inline void AttrValue::set_type(::tensorflow::DataType value) { + if (!has_type()) { + clear_value(); + set_has_type(); + } + value_.type_ = value; + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.type) +} + +// optional .tensorflow.TensorShapeProto shape = 7; +inline bool AttrValue::has_shape() const { + return value_case() == kShape; +} +inline void AttrValue::set_has_shape() { + _oneof_case_[0] = kShape; +} +inline void AttrValue::clear_shape() { + if (has_shape()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.shape_; + } + clear_has_value(); + } +} +inline const ::tensorflow::TensorShapeProto& AttrValue::shape() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.shape) + return has_shape() + ? *value_.shape_ + : ::tensorflow::TensorShapeProto::default_instance(); +} +inline ::tensorflow::TensorShapeProto* AttrValue::mutable_shape() { + if (!has_shape()) { + clear_value(); + set_has_shape(); + value_.shape_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.shape) + return value_.shape_; +} +inline ::tensorflow::TensorShapeProto* AttrValue::release_shape() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.shape) + if (has_shape()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::TensorShapeProto* temp = new ::tensorflow::TensorShapeProto(*value_.shape_); + value_.shape_ = NULL; + return temp; + } else { + ::tensorflow::TensorShapeProto* temp = value_.shape_; + value_.shape_ = NULL; + return temp; + } + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_shape(::tensorflow::TensorShapeProto* shape) { + clear_value(); + if (shape) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(shape) == NULL) { + GetArenaNoVirtual()->Own(shape); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(shape)) { + ::tensorflow::TensorShapeProto* new_shape = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >( + GetArenaNoVirtual()); + new_shape->CopyFrom(*shape); + shape = new_shape; + } + set_has_shape(); + value_.shape_ = shape; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.shape) +} +inline ::tensorflow::TensorShapeProto* AttrValue::unsafe_arena_release_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.shape) + if (has_shape()) { + clear_has_value(); + ::tensorflow::TensorShapeProto* temp = value_.shape_; + value_.shape_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_shape(::tensorflow::TensorShapeProto* shape) { + clear_value(); + if (shape) { + set_has_shape(); + value_.shape_ = shape; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.shape) +} + +// optional .tensorflow.TensorProto tensor = 8; +inline bool AttrValue::has_tensor() const { + return value_case() == kTensor; +} +inline void AttrValue::set_has_tensor() { + _oneof_case_[0] = kTensor; +} +inline void AttrValue::clear_tensor() { + if (has_tensor()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.tensor_; + } + clear_has_value(); + } +} +inline const ::tensorflow::TensorProto& AttrValue::tensor() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.tensor) + return has_tensor() + ? *value_.tensor_ + : ::tensorflow::TensorProto::default_instance(); +} +inline ::tensorflow::TensorProto* AttrValue::mutable_tensor() { + if (!has_tensor()) { + clear_value(); + set_has_tensor(); + value_.tensor_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorProto >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.tensor) + return value_.tensor_; +} +inline ::tensorflow::TensorProto* AttrValue::release_tensor() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.tensor) + if (has_tensor()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::TensorProto* temp = new ::tensorflow::TensorProto(*value_.tensor_); + value_.tensor_ = NULL; + return temp; + } else { + ::tensorflow::TensorProto* temp = value_.tensor_; + value_.tensor_ = NULL; + return temp; + } + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_tensor(::tensorflow::TensorProto* tensor) { + clear_value(); + if (tensor) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(tensor) == NULL) { + GetArenaNoVirtual()->Own(tensor); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(tensor)) { + ::tensorflow::TensorProto* new_tensor = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorProto >( + GetArenaNoVirtual()); + new_tensor->CopyFrom(*tensor); + tensor = new_tensor; + } + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.tensor) +} +inline ::tensorflow::TensorProto* AttrValue::unsafe_arena_release_tensor() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.tensor) + if (has_tensor()) { + clear_has_value(); + ::tensorflow::TensorProto* temp = value_.tensor_; + value_.tensor_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_tensor(::tensorflow::TensorProto* tensor) { + clear_value(); + if (tensor) { + set_has_tensor(); + value_.tensor_ = tensor; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.tensor) +} + +// optional .tensorflow.AttrValue.ListValue list = 1; +inline bool AttrValue::has_list() const { + return value_case() == kList; +} +inline void AttrValue::set_has_list() { + _oneof_case_[0] = kList; +} +inline void AttrValue::clear_list() { + if (has_list()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.list_; + } + clear_has_value(); + } +} +inline const ::tensorflow::AttrValue_ListValue& AttrValue::list() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.list) + return has_list() + ? *value_.list_ + : ::tensorflow::AttrValue_ListValue::default_instance(); +} +inline ::tensorflow::AttrValue_ListValue* AttrValue::mutable_list() { + if (!has_list()) { + clear_value(); + set_has_list(); + value_.list_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue_ListValue >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.list) + return value_.list_; +} +inline ::tensorflow::AttrValue_ListValue* AttrValue::release_list() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.list) + if (has_list()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::AttrValue_ListValue* temp = new ::tensorflow::AttrValue_ListValue(*value_.list_); + value_.list_ = NULL; + return temp; + } else { + ::tensorflow::AttrValue_ListValue* temp = value_.list_; + value_.list_ = NULL; + return temp; + } + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_list(::tensorflow::AttrValue_ListValue* list) { + clear_value(); + if (list) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(list) == NULL) { + GetArenaNoVirtual()->Own(list); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(list)) { + ::tensorflow::AttrValue_ListValue* new_list = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue_ListValue >( + GetArenaNoVirtual()); + new_list->CopyFrom(*list); + list = new_list; + } + set_has_list(); + value_.list_ = list; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.list) +} +inline ::tensorflow::AttrValue_ListValue* AttrValue::unsafe_arena_release_list() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.list) + if (has_list()) { + clear_has_value(); + ::tensorflow::AttrValue_ListValue* temp = value_.list_; + value_.list_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_list(::tensorflow::AttrValue_ListValue* list) { + clear_value(); + if (list) { + set_has_list(); + value_.list_ = list; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.list) +} + +// optional .tensorflow.NameAttrList func = 10; +inline bool AttrValue::has_func() const { + return value_case() == kFunc; +} +inline void AttrValue::set_has_func() { + _oneof_case_[0] = kFunc; +} +inline void AttrValue::clear_func() { + if (has_func()) { + if (GetArenaNoVirtual() == NULL) { + delete value_.func_; + } + clear_has_value(); + } +} +inline const ::tensorflow::NameAttrList& AttrValue::func() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.func) + return has_func() + ? *value_.func_ + : ::tensorflow::NameAttrList::default_instance(); +} +inline ::tensorflow::NameAttrList* AttrValue::mutable_func() { + if (!has_func()) { + clear_value(); + set_has_func(); + value_.func_ = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::NameAttrList >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.func) + return value_.func_; +} +inline ::tensorflow::NameAttrList* AttrValue::release_func() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.func) + if (has_func()) { + clear_has_value(); + if (GetArenaNoVirtual() != NULL) { + ::tensorflow::NameAttrList* temp = new ::tensorflow::NameAttrList(*value_.func_); + value_.func_ = NULL; + return temp; + } else { + ::tensorflow::NameAttrList* temp = value_.func_; + value_.func_ = NULL; + return temp; + } + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_func(::tensorflow::NameAttrList* func) { + clear_value(); + if (func) { + if (GetArenaNoVirtual() != NULL && + ::google::protobuf::Arena::GetArena(func) == NULL) { + GetArenaNoVirtual()->Own(func); + } else if (GetArenaNoVirtual() != + ::google::protobuf::Arena::GetArena(func)) { + ::tensorflow::NameAttrList* new_func = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::NameAttrList >( + GetArenaNoVirtual()); + new_func->CopyFrom(*func); + func = new_func; + } + set_has_func(); + value_.func_ = func; + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.func) +} +inline ::tensorflow::NameAttrList* AttrValue::unsafe_arena_release_func() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.func) + if (has_func()) { + clear_has_value(); + ::tensorflow::NameAttrList* temp = value_.func_; + value_.func_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void AttrValue::unsafe_arena_set_allocated_func(::tensorflow::NameAttrList* func) { + clear_value(); + if (func) { + set_has_func(); + value_.func_ = func; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.func) +} + +// optional string placeholder = 9; +inline bool AttrValue::has_placeholder() const { + return value_case() == kPlaceholder; +} +inline void AttrValue::set_has_placeholder() { + _oneof_case_[0] = kPlaceholder; +} +inline void AttrValue::clear_placeholder() { + if (has_placeholder()) { + value_.placeholder_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + clear_has_value(); + } +} +inline const ::std::string& AttrValue::placeholder() const { + // @@protoc_insertion_point(field_get:tensorflow.AttrValue.placeholder) + if (has_placeholder()) { + return value_.placeholder_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void AttrValue::set_placeholder(const ::std::string& value) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.AttrValue.placeholder) +} +inline void AttrValue::set_placeholder(const char* value) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.AttrValue.placeholder) +} +inline void AttrValue::set_placeholder(const char* value, + size_t size) { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + value_.placeholder_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.AttrValue.placeholder) +} +inline ::std::string* AttrValue::mutable_placeholder() { + if (!has_placeholder()) { + clear_value(); + set_has_placeholder(); + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return value_.placeholder_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_mutable:tensorflow.AttrValue.placeholder) +} +inline ::std::string* AttrValue::release_placeholder() { + // @@protoc_insertion_point(field_release:tensorflow.AttrValue.placeholder) + if (has_placeholder()) { + clear_has_value(); + return value_.placeholder_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline ::std::string* AttrValue::unsafe_arena_release_placeholder() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AttrValue.placeholder) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (has_placeholder()) { + clear_has_value(); + return value_.placeholder_.UnsafeArenaRelease( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + } else { + return NULL; + } +} +inline void AttrValue::set_allocated_placeholder(::std::string* placeholder) { + if (!has_placeholder()) { + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (placeholder != NULL) { + set_has_placeholder(); + value_.placeholder_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.placeholder) +} +inline void AttrValue::unsafe_arena_set_allocated_placeholder(::std::string* placeholder) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (!has_placeholder()) { + value_.placeholder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_value(); + if (placeholder) { + set_has_placeholder(); + value_.placeholder_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placeholder, GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AttrValue.placeholder) +} + +inline bool AttrValue::has_value() const { + return value_case() != VALUE_NOT_SET; +} +inline void AttrValue::clear_has_value() { + _oneof_case_[0] = VALUE_NOT_SET; +} +inline AttrValue::ValueCase AttrValue::value_case() const { + return AttrValue::ValueCase(_oneof_case_[0]); +} +inline const AttrValue* AttrValue::internal_default_instance() { + return &AttrValue_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NameAttrList + +// optional string name = 1; +inline void NameAttrList::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NameAttrList::name() const { + // @@protoc_insertion_point(field_get:tensorflow.NameAttrList.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NameAttrList::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NameAttrList.name) +} +inline void NameAttrList::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NameAttrList.name) +} +inline void NameAttrList::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NameAttrList.name) +} +inline ::std::string* NameAttrList::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NameAttrList.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NameAttrList::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.NameAttrList.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NameAttrList::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NameAttrList.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NameAttrList::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NameAttrList.name) +} +inline void NameAttrList::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NameAttrList.name) +} + +// map attr = 2; +inline int NameAttrList::attr_size() const { + return attr_.size(); +} +inline void NameAttrList::clear_attr() { + attr_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& +NameAttrList::attr() const { + // @@protoc_insertion_point(field_map:tensorflow.NameAttrList.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* +NameAttrList::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:tensorflow.NameAttrList.attr) + return attr_.MutableMap(); +} + +inline const NameAttrList* NameAttrList::internal_default_instance() { + return &NameAttrList_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_attr_5fvalue_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/function.pb.cc b/modules/dnn/misc/tensorflow/function.pb.cc new file mode 100644 index 0000000000..408a07e394 --- /dev/null +++ b/modules/dnn/misc/tensorflow/function.pb.cc @@ -0,0 +1,2348 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: function.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "function.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* FunctionDefLibrary_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FunctionDefLibrary_reflection_ = NULL; +const ::google::protobuf::Descriptor* FunctionDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FunctionDef_reflection_ = NULL; +const ::google::protobuf::Descriptor* FunctionDef_Node_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FunctionDef_Node_reflection_ = NULL; +const ::google::protobuf::Descriptor* FunctionDef_Node_AttrEntry_descriptor_ = NULL; +const ::google::protobuf::Descriptor* GradientDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + GradientDef_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_function_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_function_2eproto() { + protobuf_AddDesc_function_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "function.proto"); + GOOGLE_CHECK(file != NULL); + FunctionDefLibrary_descriptor_ = file->message_type(0); + static const int FunctionDefLibrary_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDefLibrary, function_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDefLibrary, gradient_), + }; + FunctionDefLibrary_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FunctionDefLibrary_descriptor_, + FunctionDefLibrary::internal_default_instance(), + FunctionDefLibrary_offsets_, + -1, + -1, + -1, + sizeof(FunctionDefLibrary), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDefLibrary, _internal_metadata_)); + FunctionDef_descriptor_ = file->message_type(1); + static const int FunctionDef_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef, signature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef, node_), + }; + FunctionDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FunctionDef_descriptor_, + FunctionDef::internal_default_instance(), + FunctionDef_offsets_, + -1, + -1, + -1, + sizeof(FunctionDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef, _internal_metadata_)); + FunctionDef_Node_descriptor_ = FunctionDef_descriptor_->nested_type(0); + static const int FunctionDef_Node_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef_Node, ret_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef_Node, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef_Node, arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef_Node, dep_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef_Node, attr_), + }; + FunctionDef_Node_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FunctionDef_Node_descriptor_, + FunctionDef_Node::internal_default_instance(), + FunctionDef_Node_offsets_, + -1, + -1, + -1, + sizeof(FunctionDef_Node), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FunctionDef_Node, _internal_metadata_)); + FunctionDef_Node_AttrEntry_descriptor_ = FunctionDef_Node_descriptor_->nested_type(0); + GradientDef_descriptor_ = file->message_type(2); + static const int GradientDef_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GradientDef, function_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GradientDef, gradient_func_), + }; + GradientDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + GradientDef_descriptor_, + GradientDef::internal_default_instance(), + GradientDef_offsets_, + -1, + -1, + -1, + sizeof(GradientDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GradientDef, _internal_metadata_)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_function_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FunctionDefLibrary_descriptor_, FunctionDefLibrary::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FunctionDef_descriptor_, FunctionDef::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FunctionDef_Node_descriptor_, FunctionDef_Node::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FunctionDef_Node_AttrEntry_descriptor_, + ::google::protobuf::internal::MapEntry< + ::std::string, + ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0>::CreateDefaultInstance( + FunctionDef_Node_AttrEntry_descriptor_)); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + GradientDef_descriptor_, GradientDef::internal_default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_function_2eproto() { + FunctionDefLibrary_default_instance_.Shutdown(); + delete FunctionDefLibrary_reflection_; + FunctionDef_default_instance_.Shutdown(); + delete FunctionDef_reflection_; + FunctionDef_Node_default_instance_.Shutdown(); + delete FunctionDef_Node_reflection_; + GradientDef_default_instance_.Shutdown(); + delete GradientDef_reflection_; +} + +void protobuf_InitDefaults_function_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::tensorflow::protobuf_InitDefaults_attr_5fvalue_2eproto(); + ::tensorflow::protobuf_InitDefaults_op_5fdef_2eproto(); + FunctionDefLibrary_default_instance_.DefaultConstruct(); + FunctionDef_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + FunctionDef_Node_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + GradientDef_default_instance_.DefaultConstruct(); + FunctionDefLibrary_default_instance_.get_mutable()->InitAsDefaultInstance(); + FunctionDef_default_instance_.get_mutable()->InitAsDefaultInstance(); + FunctionDef_Node_default_instance_.get_mutable()->InitAsDefaultInstance(); + GradientDef_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_function_2eproto_once_); +void protobuf_InitDefaults_function_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_function_2eproto_once_, + &protobuf_InitDefaults_function_2eproto_impl); +} +void protobuf_AddDesc_function_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_function_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\016function.proto\022\ntensorflow\032\020attr_value" + ".proto\032\014op_def.proto\"j\n\022FunctionDefLibra" + "ry\022)\n\010function\030\001 \003(\0132\027.tensorflow.Functi" + "onDef\022)\n\010gradient\030\002 \003(\0132\027.tensorflow.Gra" + "dientDef\"\225\002\n\013FunctionDef\022$\n\tsignature\030\001 " + "\001(\0132\021.tensorflow.OpDef\022*\n\004node\030\002 \003(\0132\034.t" + "ensorflow.FunctionDef.Node\032\263\001\n\004Node\022\013\n\003r" + "et\030\001 \003(\t\022\n\n\002op\030\002 \001(\t\022\013\n\003arg\030\003 \003(\t\022\013\n\003dep" + "\030\004 \003(\t\0224\n\004attr\030\005 \003(\0132&.tensorflow.Functi" + "onDef.Node.AttrEntry\032B\n\tAttrEntry\022\013\n\003key" + "\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.AttrV" + "alue:\0028\001\";\n\013GradientDef\022\025\n\rfunction_name" + "\030\001 \001(\t\022\025\n\rgradient_func\030\002 \001(\tB/\n\030org.ten" + "sorflow.frameworkB\016FunctionProtosP\001\370\001\001b\006" + "proto3", 566); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "function.proto", &protobuf_RegisterTypes); + ::tensorflow::protobuf_AddDesc_attr_5fvalue_2eproto(); + ::tensorflow::protobuf_AddDesc_op_5fdef_2eproto(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_function_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_function_2eproto_once_); +void protobuf_AddDesc_function_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_function_2eproto_once_, + &protobuf_AddDesc_function_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_function_2eproto { + StaticDescriptorInitializer_function_2eproto() { + protobuf_AddDesc_function_2eproto(); + } +} static_descriptor_initializer_function_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FunctionDefLibrary::kFunctionFieldNumber; +const int FunctionDefLibrary::kGradientFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FunctionDefLibrary::FunctionDefLibrary() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_function_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.FunctionDefLibrary) +} +FunctionDefLibrary::FunctionDefLibrary(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + function_(arena), + gradient_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_function_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.FunctionDefLibrary) +} + +void FunctionDefLibrary::InitAsDefaultInstance() { +} + +FunctionDefLibrary::FunctionDefLibrary(const FunctionDefLibrary& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.FunctionDefLibrary) +} + +void FunctionDefLibrary::SharedCtor() { + _cached_size_ = 0; +} + +FunctionDefLibrary::~FunctionDefLibrary() { + // @@protoc_insertion_point(destructor:tensorflow.FunctionDefLibrary) + SharedDtor(); +} + +void FunctionDefLibrary::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + +} + +void FunctionDefLibrary::ArenaDtor(void* object) { + FunctionDefLibrary* _this = reinterpret_cast< FunctionDefLibrary* >(object); + (void)_this; +} +void FunctionDefLibrary::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FunctionDefLibrary::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FunctionDefLibrary::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FunctionDefLibrary_descriptor_; +} + +const FunctionDefLibrary& FunctionDefLibrary::default_instance() { + protobuf_InitDefaults_function_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed FunctionDefLibrary_default_instance_; + +FunctionDefLibrary* FunctionDefLibrary::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void FunctionDefLibrary::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.FunctionDefLibrary) + function_.Clear(); + gradient_.Clear(); +} + +bool FunctionDefLibrary::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.FunctionDefLibrary) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .tensorflow.FunctionDef function = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_function: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_function())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_function; + if (input->ExpectTag(18)) goto parse_loop_gradient; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .tensorflow.GradientDef gradient = 2; + case 2: { + if (tag == 18) { + DO_(input->IncrementRecursionDepth()); + parse_loop_gradient: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_gradient())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_gradient; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.FunctionDefLibrary) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.FunctionDefLibrary) + return false; +#undef DO_ +} + +void FunctionDefLibrary::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.FunctionDefLibrary) + // repeated .tensorflow.FunctionDef function = 1; + for (unsigned int i = 0, n = this->function_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->function(i), output); + } + + // repeated .tensorflow.GradientDef gradient = 2; + for (unsigned int i = 0, n = this->gradient_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->gradient(i), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.FunctionDefLibrary) +} + +::google::protobuf::uint8* FunctionDefLibrary::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.FunctionDefLibrary) + // repeated .tensorflow.FunctionDef function = 1; + for (unsigned int i = 0, n = this->function_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->function(i), false, target); + } + + // repeated .tensorflow.GradientDef gradient = 2; + for (unsigned int i = 0, n = this->gradient_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, this->gradient(i), false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.FunctionDefLibrary) + return target; +} + +size_t FunctionDefLibrary::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.FunctionDefLibrary) + size_t total_size = 0; + + // repeated .tensorflow.FunctionDef function = 1; + { + unsigned int count = this->function_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->function(i)); + } + } + + // repeated .tensorflow.GradientDef gradient = 2; + { + unsigned int count = this->gradient_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->gradient(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FunctionDefLibrary::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.FunctionDefLibrary) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FunctionDefLibrary* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.FunctionDefLibrary) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.FunctionDefLibrary) + UnsafeMergeFrom(*source); + } +} + +void FunctionDefLibrary::MergeFrom(const FunctionDefLibrary& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.FunctionDefLibrary) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void FunctionDefLibrary::UnsafeMergeFrom(const FunctionDefLibrary& from) { + GOOGLE_DCHECK(&from != this); + function_.MergeFrom(from.function_); + gradient_.MergeFrom(from.gradient_); +} + +void FunctionDefLibrary::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.FunctionDefLibrary) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FunctionDefLibrary::CopyFrom(const FunctionDefLibrary& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.FunctionDefLibrary) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool FunctionDefLibrary::IsInitialized() const { + + return true; +} + +void FunctionDefLibrary::Swap(FunctionDefLibrary* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FunctionDefLibrary temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void FunctionDefLibrary::UnsafeArenaSwap(FunctionDefLibrary* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FunctionDefLibrary::InternalSwap(FunctionDefLibrary* other) { + function_.UnsafeArenaSwap(&other->function_); + gradient_.UnsafeArenaSwap(&other->gradient_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FunctionDefLibrary::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FunctionDefLibrary_descriptor_; + metadata.reflection = FunctionDefLibrary_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FunctionDefLibrary + +// repeated .tensorflow.FunctionDef function = 1; +int FunctionDefLibrary::function_size() const { + return function_.size(); +} +void FunctionDefLibrary::clear_function() { + function_.Clear(); +} +const ::tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDefLibrary.function) + return function_.Get(index); +} +::tensorflow::FunctionDef* FunctionDefLibrary::mutable_function(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDefLibrary.function) + return function_.Mutable(index); +} +::tensorflow::FunctionDef* FunctionDefLibrary::add_function() { + // @@protoc_insertion_point(field_add:tensorflow.FunctionDefLibrary.function) + return function_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >* +FunctionDefLibrary::mutable_function() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDefLibrary.function) + return &function_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >& +FunctionDefLibrary::function() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDefLibrary.function) + return function_; +} + +// repeated .tensorflow.GradientDef gradient = 2; +int FunctionDefLibrary::gradient_size() const { + return gradient_.size(); +} +void FunctionDefLibrary::clear_gradient() { + gradient_.Clear(); +} +const ::tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDefLibrary.gradient) + return gradient_.Get(index); +} +::tensorflow::GradientDef* FunctionDefLibrary::mutable_gradient(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDefLibrary.gradient) + return gradient_.Mutable(index); +} +::tensorflow::GradientDef* FunctionDefLibrary::add_gradient() { + // @@protoc_insertion_point(field_add:tensorflow.FunctionDefLibrary.gradient) + return gradient_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >* +FunctionDefLibrary::mutable_gradient() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDefLibrary.gradient) + return &gradient_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >& +FunctionDefLibrary::gradient() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDefLibrary.gradient) + return gradient_; +} + +inline const FunctionDefLibrary* FunctionDefLibrary::internal_default_instance() { + return &FunctionDefLibrary_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FunctionDef_Node::kRetFieldNumber; +const int FunctionDef_Node::kOpFieldNumber; +const int FunctionDef_Node::kArgFieldNumber; +const int FunctionDef_Node::kDepFieldNumber; +const int FunctionDef_Node::kAttrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FunctionDef_Node::FunctionDef_Node() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_function_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.FunctionDef.Node) +} +FunctionDef_Node::FunctionDef_Node(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + ret_(arena), + arg_(arena), + dep_(arena), + attr_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_function_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.FunctionDef.Node) +} + +void FunctionDef_Node::InitAsDefaultInstance() { +} + +FunctionDef_Node::FunctionDef_Node(const FunctionDef_Node& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.FunctionDef.Node) +} + +void FunctionDef_Node::SharedCtor() { + attr_.SetAssignDescriptorCallback( + protobuf_AssignDescriptorsOnce); + attr_.SetEntryDescriptor( + &::tensorflow::FunctionDef_Node_AttrEntry_descriptor_); + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; +} + +FunctionDef_Node::~FunctionDef_Node() { + // @@protoc_insertion_point(destructor:tensorflow.FunctionDef.Node) + SharedDtor(); +} + +void FunctionDef_Node::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + op_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void FunctionDef_Node::ArenaDtor(void* object) { + FunctionDef_Node* _this = reinterpret_cast< FunctionDef_Node* >(object); + (void)_this; +} +void FunctionDef_Node::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FunctionDef_Node::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FunctionDef_Node::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FunctionDef_Node_descriptor_; +} + +const FunctionDef_Node& FunctionDef_Node::default_instance() { + protobuf_InitDefaults_function_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed FunctionDef_Node_default_instance_; + +FunctionDef_Node* FunctionDef_Node::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void FunctionDef_Node::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.FunctionDef.Node) + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + ret_.Clear(); + arg_.Clear(); + dep_.Clear(); + attr_.Clear(); +} + +bool FunctionDef_Node::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.FunctionDef.Node) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated string ret = 1; + case 1: { + if (tag == 10) { + parse_ret: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_ret())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->ret(this->ret_size() - 1).data(), + this->ret(this->ret_size() - 1).length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.FunctionDef.Node.ret")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_ret; + if (input->ExpectTag(18)) goto parse_op; + break; + } + + // optional string op = 2; + case 2: { + if (tag == 18) { + parse_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), this->op().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.FunctionDef.Node.op")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_arg; + break; + } + + // repeated string arg = 3; + case 3: { + if (tag == 26) { + parse_arg: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_arg())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->arg(this->arg_size() - 1).data(), + this->arg(this->arg_size() - 1).length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.FunctionDef.Node.arg")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_arg; + if (input->ExpectTag(34)) goto parse_dep; + break; + } + + // repeated string dep = 4; + case 4: { + if (tag == 34) { + parse_dep: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_dep())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->dep(this->dep_size() - 1).data(), + this->dep(this->dep_size() - 1).length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.FunctionDef.Node.dep")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_dep; + if (input->ExpectTag(42)) goto parse_attr; + break; + } + + // map attr = 5; + case 5: { + if (tag == 42) { + parse_attr: + DO_(input->IncrementRecursionDepth()); + parse_loop_attr: + FunctionDef_Node_AttrEntry::Parser< ::google::protobuf::internal::MapField< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), parser.key().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.FunctionDef.Node.AttrEntry.key")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_loop_attr; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.FunctionDef.Node) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.FunctionDef.Node) + return false; +#undef DO_ +} + +void FunctionDef_Node::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.FunctionDef.Node) + // repeated string ret = 1; + for (int i = 0; i < this->ret_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->ret(i).data(), this->ret(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.ret"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->ret(i), output); + } + + // optional string op = 2; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), this->op().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->op(), output); + } + + // repeated string arg = 3; + for (int i = 0; i < this->arg_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->arg(i).data(), this->arg(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.arg"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->arg(i), output); + } + + // repeated string dep = 4; + for (int i = 0; i < this->dep_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->dep(i).data(), this->dep(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.dep"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 4, this->dep(i), output); + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), p->first.length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterminstic() && + this->attr().size() > 1) { + ::google::protobuf::scoped_array items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[n] = SortItem(&*it); + } + ::std::sort(&items[0], &items[n], Less()); + ::google::protobuf::scoped_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[i]->first, items[i]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[i]); + } + } else { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // @@protoc_insertion_point(serialize_end:tensorflow.FunctionDef.Node) +} + +::google::protobuf::uint8* FunctionDef_Node::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.FunctionDef.Node) + // repeated string ret = 1; + for (int i = 0; i < this->ret_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->ret(i).data(), this->ret(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.ret"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1, this->ret(i), target); + } + + // optional string op = 2; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), this->op().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->op(), target); + } + + // repeated string arg = 3; + for (int i = 0; i < this->arg_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->arg(i).data(), this->arg(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.arg"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->arg(i), target); + } + + // repeated string dep = 4; + for (int i = 0; i < this->dep_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->dep(i).data(), this->dep(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.dep"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(4, this->dep(i), target); + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), p->first.length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.FunctionDef.Node.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::google::protobuf::scoped_array items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[n] = SortItem(&*it); + } + ::std::sort(&items[0], &items[n], Less()); + ::google::protobuf::scoped_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[i]->first, items[i]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[i]); + } + } else { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.FunctionDef.Node) + return target; +} + +size_t FunctionDef_Node::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.FunctionDef.Node) + size_t total_size = 0; + + // optional string op = 2; + if (this->op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op()); + } + + // repeated string ret = 1; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->ret_size()); + for (int i = 0; i < this->ret_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->ret(i)); + } + + // repeated string arg = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->arg_size()); + for (int i = 0; i < this->arg_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->arg(i)); + } + + // repeated string dep = 4; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->dep_size()); + for (int i = 0; i < this->dep_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->dep(i)); + } + + // map attr = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FunctionDef_Node::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.FunctionDef.Node) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FunctionDef_Node* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.FunctionDef.Node) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.FunctionDef.Node) + UnsafeMergeFrom(*source); + } +} + +void FunctionDef_Node::MergeFrom(const FunctionDef_Node& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.FunctionDef.Node) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void FunctionDef_Node::UnsafeMergeFrom(const FunctionDef_Node& from) { + GOOGLE_DCHECK(&from != this); + ret_.UnsafeMergeFrom(from.ret_); + arg_.UnsafeMergeFrom(from.arg_); + dep_.UnsafeMergeFrom(from.dep_); + attr_.MergeFrom(from.attr_); + if (from.op().size() > 0) { + set_op(from.op()); + } +} + +void FunctionDef_Node::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.FunctionDef.Node) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FunctionDef_Node::CopyFrom(const FunctionDef_Node& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.FunctionDef.Node) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool FunctionDef_Node::IsInitialized() const { + + return true; +} + +void FunctionDef_Node::Swap(FunctionDef_Node* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FunctionDef_Node temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void FunctionDef_Node::UnsafeArenaSwap(FunctionDef_Node* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FunctionDef_Node::InternalSwap(FunctionDef_Node* other) { + ret_.UnsafeArenaSwap(&other->ret_); + op_.Swap(&other->op_); + arg_.UnsafeArenaSwap(&other->arg_); + dep_.UnsafeArenaSwap(&other->dep_); + attr_.Swap(&other->attr_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FunctionDef_Node::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FunctionDef_Node_descriptor_; + metadata.reflection = FunctionDef_Node_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +void FunctionDef::_slow_mutable_signature() { + signature_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::OpDef >( + GetArenaNoVirtual()); +} +::tensorflow::OpDef* FunctionDef::_slow_release_signature() { + if (signature_ == NULL) { + return NULL; + } else { + ::tensorflow::OpDef* temp = new ::tensorflow::OpDef(*signature_); + signature_ = NULL; + return temp; + } +} +::tensorflow::OpDef* FunctionDef::unsafe_arena_release_signature() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.FunctionDef.signature) + + ::tensorflow::OpDef* temp = signature_; + signature_ = NULL; + return temp; +} +void FunctionDef::_slow_set_allocated_signature( + ::google::protobuf::Arena* message_arena, ::tensorflow::OpDef** signature) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*signature) == NULL) { + message_arena->Own(*signature); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*signature)) { + ::tensorflow::OpDef* new_signature = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::OpDef >( + message_arena); + new_signature->CopyFrom(**signature); + *signature = new_signature; + } +} +void FunctionDef::unsafe_arena_set_allocated_signature( + ::tensorflow::OpDef* signature) { + if (GetArenaNoVirtual() == NULL) { + delete signature_; + } + signature_ = signature; + if (signature) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.FunctionDef.signature) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FunctionDef::kSignatureFieldNumber; +const int FunctionDef::kNodeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FunctionDef::FunctionDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_function_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.FunctionDef) +} +FunctionDef::FunctionDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_function_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.FunctionDef) +} + +void FunctionDef::InitAsDefaultInstance() { + signature_ = const_cast< ::tensorflow::OpDef*>( + ::tensorflow::OpDef::internal_default_instance()); +} + +FunctionDef::FunctionDef(const FunctionDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.FunctionDef) +} + +void FunctionDef::SharedCtor() { + signature_ = NULL; + _cached_size_ = 0; +} + +FunctionDef::~FunctionDef() { + // @@protoc_insertion_point(destructor:tensorflow.FunctionDef) + SharedDtor(); +} + +void FunctionDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + if (this != &FunctionDef_default_instance_.get()) { + delete signature_; + } +} + +void FunctionDef::ArenaDtor(void* object) { + FunctionDef* _this = reinterpret_cast< FunctionDef* >(object); + (void)_this; +} +void FunctionDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void FunctionDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FunctionDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FunctionDef_descriptor_; +} + +const FunctionDef& FunctionDef::default_instance() { + protobuf_InitDefaults_function_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed FunctionDef_default_instance_; + +FunctionDef* FunctionDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void FunctionDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.FunctionDef) + if (GetArenaNoVirtual() == NULL && signature_ != NULL) delete signature_; + signature_ = NULL; + node_.Clear(); +} + +bool FunctionDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.FunctionDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .tensorflow.OpDef signature = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_node; + break; + } + + // repeated .tensorflow.FunctionDef.Node node = 2; + case 2: { + if (tag == 18) { + parse_node: + DO_(input->IncrementRecursionDepth()); + parse_loop_node: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_node())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_node; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.FunctionDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.FunctionDef) + return false; +#undef DO_ +} + +void FunctionDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.FunctionDef) + // optional .tensorflow.OpDef signature = 1; + if (this->has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, *this->signature_, output); + } + + // repeated .tensorflow.FunctionDef.Node node = 2; + for (unsigned int i = 0, n = this->node_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->node(i), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.FunctionDef) +} + +::google::protobuf::uint8* FunctionDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.FunctionDef) + // optional .tensorflow.OpDef signature = 1; + if (this->has_signature()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, *this->signature_, false, target); + } + + // repeated .tensorflow.FunctionDef.Node node = 2; + for (unsigned int i = 0, n = this->node_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, this->node(i), false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.FunctionDef) + return target; +} + +size_t FunctionDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.FunctionDef) + size_t total_size = 0; + + // optional .tensorflow.OpDef signature = 1; + if (this->has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->signature_); + } + + // repeated .tensorflow.FunctionDef.Node node = 2; + { + unsigned int count = this->node_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->node(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FunctionDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.FunctionDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FunctionDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.FunctionDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.FunctionDef) + UnsafeMergeFrom(*source); + } +} + +void FunctionDef::MergeFrom(const FunctionDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.FunctionDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void FunctionDef::UnsafeMergeFrom(const FunctionDef& from) { + GOOGLE_DCHECK(&from != this); + node_.MergeFrom(from.node_); + if (from.has_signature()) { + mutable_signature()->::tensorflow::OpDef::MergeFrom(from.signature()); + } +} + +void FunctionDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.FunctionDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FunctionDef::CopyFrom(const FunctionDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.FunctionDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool FunctionDef::IsInitialized() const { + + return true; +} + +void FunctionDef::Swap(FunctionDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + FunctionDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void FunctionDef::UnsafeArenaSwap(FunctionDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void FunctionDef::InternalSwap(FunctionDef* other) { + std::swap(signature_, other->signature_); + node_.UnsafeArenaSwap(&other->node_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FunctionDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FunctionDef_descriptor_; + metadata.reflection = FunctionDef_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FunctionDef_Node + +// repeated string ret = 1; +int FunctionDef_Node::ret_size() const { + return ret_.size(); +} +void FunctionDef_Node::clear_ret() { + ret_.Clear(); +} +const ::std::string& FunctionDef_Node::ret(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.ret) + return ret_.Get(index); +} +::std::string* FunctionDef_Node::mutable_ret(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.ret) + return ret_.Mutable(index); +} +void FunctionDef_Node::set_ret(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.ret) + ret_.Mutable(index)->assign(value); +} +void FunctionDef_Node::set_ret(int index, const char* value) { + ret_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.ret) +} +void FunctionDef_Node::set_ret(int index, const char* value, size_t size) { + ret_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.ret) +} +::std::string* FunctionDef_Node::add_ret() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.ret) + return ret_.Add(); +} +void FunctionDef_Node::add_ret(const ::std::string& value) { + ret_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.ret) +} +void FunctionDef_Node::add_ret(const char* value) { + ret_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.ret) +} +void FunctionDef_Node::add_ret(const char* value, size_t size) { + ret_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.ret) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +FunctionDef_Node::ret() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.ret) + return ret_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +FunctionDef_Node::mutable_ret() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.ret) + return &ret_; +} + +// optional string op = 2; +void FunctionDef_Node::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& FunctionDef_Node::op() const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.op) + return op_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void FunctionDef_Node::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.op) +} +void FunctionDef_Node::set_op(const char* value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.op) +} +void FunctionDef_Node::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.op) +} +::std::string* FunctionDef_Node::mutable_op() { + + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* FunctionDef_Node::release_op() { + // @@protoc_insertion_point(field_release:tensorflow.FunctionDef.Node.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* FunctionDef_Node::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.FunctionDef.Node.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void FunctionDef_Node::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.FunctionDef.Node.op) +} +void FunctionDef_Node::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.FunctionDef.Node.op) +} + +// repeated string arg = 3; +int FunctionDef_Node::arg_size() const { + return arg_.size(); +} +void FunctionDef_Node::clear_arg() { + arg_.Clear(); +} +const ::std::string& FunctionDef_Node::arg(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.arg) + return arg_.Get(index); +} +::std::string* FunctionDef_Node::mutable_arg(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.arg) + return arg_.Mutable(index); +} +void FunctionDef_Node::set_arg(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.arg) + arg_.Mutable(index)->assign(value); +} +void FunctionDef_Node::set_arg(int index, const char* value) { + arg_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.arg) +} +void FunctionDef_Node::set_arg(int index, const char* value, size_t size) { + arg_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.arg) +} +::std::string* FunctionDef_Node::add_arg() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.arg) + return arg_.Add(); +} +void FunctionDef_Node::add_arg(const ::std::string& value) { + arg_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.arg) +} +void FunctionDef_Node::add_arg(const char* value) { + arg_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.arg) +} +void FunctionDef_Node::add_arg(const char* value, size_t size) { + arg_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.arg) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +FunctionDef_Node::arg() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.arg) + return arg_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +FunctionDef_Node::mutable_arg() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.arg) + return &arg_; +} + +// repeated string dep = 4; +int FunctionDef_Node::dep_size() const { + return dep_.size(); +} +void FunctionDef_Node::clear_dep() { + dep_.Clear(); +} +const ::std::string& FunctionDef_Node::dep(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.dep) + return dep_.Get(index); +} +::std::string* FunctionDef_Node::mutable_dep(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.dep) + return dep_.Mutable(index); +} +void FunctionDef_Node::set_dep(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.dep) + dep_.Mutable(index)->assign(value); +} +void FunctionDef_Node::set_dep(int index, const char* value) { + dep_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.dep) +} +void FunctionDef_Node::set_dep(int index, const char* value, size_t size) { + dep_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.dep) +} +::std::string* FunctionDef_Node::add_dep() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.dep) + return dep_.Add(); +} +void FunctionDef_Node::add_dep(const ::std::string& value) { + dep_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.dep) +} +void FunctionDef_Node::add_dep(const char* value) { + dep_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.dep) +} +void FunctionDef_Node::add_dep(const char* value, size_t size) { + dep_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.dep) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +FunctionDef_Node::dep() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.dep) + return dep_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +FunctionDef_Node::mutable_dep() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.dep) + return &dep_; +} + +// map attr = 5; +int FunctionDef_Node::attr_size() const { + return attr_.size(); +} +void FunctionDef_Node::clear_attr() { + attr_.Clear(); +} + const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& +FunctionDef_Node::attr() const { + // @@protoc_insertion_point(field_map:tensorflow.FunctionDef.Node.attr) + return attr_.GetMap(); +} + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* +FunctionDef_Node::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:tensorflow.FunctionDef.Node.attr) + return attr_.MutableMap(); +} + +inline const FunctionDef_Node* FunctionDef_Node::internal_default_instance() { + return &FunctionDef_Node_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// FunctionDef + +// optional .tensorflow.OpDef signature = 1; +bool FunctionDef::has_signature() const { + return this != internal_default_instance() && signature_ != NULL; +} +void FunctionDef::clear_signature() { + if (GetArenaNoVirtual() == NULL && signature_ != NULL) delete signature_; + signature_ = NULL; +} +const ::tensorflow::OpDef& FunctionDef::signature() const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.signature) + return signature_ != NULL ? *signature_ + : *::tensorflow::OpDef::internal_default_instance(); +} +::tensorflow::OpDef* FunctionDef::mutable_signature() { + + if (signature_ == NULL) { + _slow_mutable_signature(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.signature) + return signature_; +} +::tensorflow::OpDef* FunctionDef::release_signature() { + // @@protoc_insertion_point(field_release:tensorflow.FunctionDef.signature) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_signature(); + } else { + ::tensorflow::OpDef* temp = signature_; + signature_ = NULL; + return temp; + } +} + void FunctionDef::set_allocated_signature(::tensorflow::OpDef* signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete signature_; + } + if (signature != NULL) { + _slow_set_allocated_signature(message_arena, &signature); + } + signature_ = signature; + if (signature) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.FunctionDef.signature) +} + +// repeated .tensorflow.FunctionDef.Node node = 2; +int FunctionDef::node_size() const { + return node_.size(); +} +void FunctionDef::clear_node() { + node_.Clear(); +} +const ::tensorflow::FunctionDef_Node& FunctionDef::node(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.node) + return node_.Get(index); +} +::tensorflow::FunctionDef_Node* FunctionDef::mutable_node(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.node) + return node_.Mutable(index); +} +::tensorflow::FunctionDef_Node* FunctionDef::add_node() { + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.node) + return node_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >* +FunctionDef::mutable_node() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.node) + return &node_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >& +FunctionDef::node() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.node) + return node_; +} + +inline const FunctionDef* FunctionDef::internal_default_instance() { + return &FunctionDef_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GradientDef::kFunctionNameFieldNumber; +const int GradientDef::kGradientFuncFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GradientDef::GradientDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_function_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.GradientDef) +} +GradientDef::GradientDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_function_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.GradientDef) +} + +void GradientDef::InitAsDefaultInstance() { +} + +GradientDef::GradientDef(const GradientDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.GradientDef) +} + +void GradientDef::SharedCtor() { + function_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gradient_func_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; +} + +GradientDef::~GradientDef() { + // @@protoc_insertion_point(destructor:tensorflow.GradientDef) + SharedDtor(); +} + +void GradientDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + function_name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + gradient_func_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void GradientDef::ArenaDtor(void* object) { + GradientDef* _this = reinterpret_cast< GradientDef* >(object); + (void)_this; +} +void GradientDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GradientDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* GradientDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return GradientDef_descriptor_; +} + +const GradientDef& GradientDef::default_instance() { + protobuf_InitDefaults_function_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed GradientDef_default_instance_; + +GradientDef* GradientDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void GradientDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.GradientDef) + function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} + +bool GradientDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.GradientDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string function_name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_function_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->function_name().data(), this->function_name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.GradientDef.function_name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_gradient_func; + break; + } + + // optional string gradient_func = 2; + case 2: { + if (tag == 18) { + parse_gradient_func: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_gradient_func())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->gradient_func().data(), this->gradient_func().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.GradientDef.gradient_func")); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.GradientDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.GradientDef) + return false; +#undef DO_ +} + +void GradientDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.GradientDef) + // optional string function_name = 1; + if (this->function_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->function_name().data(), this->function_name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.GradientDef.function_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->function_name(), output); + } + + // optional string gradient_func = 2; + if (this->gradient_func().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->gradient_func().data(), this->gradient_func().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.GradientDef.gradient_func"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->gradient_func(), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.GradientDef) +} + +::google::protobuf::uint8* GradientDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.GradientDef) + // optional string function_name = 1; + if (this->function_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->function_name().data(), this->function_name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.GradientDef.function_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->function_name(), target); + } + + // optional string gradient_func = 2; + if (this->gradient_func().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->gradient_func().data(), this->gradient_func().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.GradientDef.gradient_func"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->gradient_func(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.GradientDef) + return target; +} + +size_t GradientDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.GradientDef) + size_t total_size = 0; + + // optional string function_name = 1; + if (this->function_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->function_name()); + } + + // optional string gradient_func = 2; + if (this->gradient_func().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->gradient_func()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void GradientDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.GradientDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const GradientDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.GradientDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.GradientDef) + UnsafeMergeFrom(*source); + } +} + +void GradientDef::MergeFrom(const GradientDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.GradientDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void GradientDef::UnsafeMergeFrom(const GradientDef& from) { + GOOGLE_DCHECK(&from != this); + if (from.function_name().size() > 0) { + set_function_name(from.function_name()); + } + if (from.gradient_func().size() > 0) { + set_gradient_func(from.gradient_func()); + } +} + +void GradientDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.GradientDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GradientDef::CopyFrom(const GradientDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.GradientDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool GradientDef::IsInitialized() const { + + return true; +} + +void GradientDef::Swap(GradientDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GradientDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void GradientDef::UnsafeArenaSwap(GradientDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GradientDef::InternalSwap(GradientDef* other) { + function_name_.Swap(&other->function_name_); + gradient_func_.Swap(&other->gradient_func_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata GradientDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = GradientDef_descriptor_; + metadata.reflection = GradientDef_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// GradientDef + +// optional string function_name = 1; +void GradientDef::clear_function_name() { + function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& GradientDef::function_name() const { + // @@protoc_insertion_point(field_get:tensorflow.GradientDef.function_name) + return function_name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void GradientDef::set_function_name(const ::std::string& value) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.GradientDef.function_name) +} +void GradientDef::set_function_name(const char* value) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.GradientDef.function_name) +} +void GradientDef::set_function_name(const char* value, + size_t size) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.GradientDef.function_name) +} +::std::string* GradientDef::mutable_function_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.GradientDef.function_name) + return function_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* GradientDef::release_function_name() { + // @@protoc_insertion_point(field_release:tensorflow.GradientDef.function_name) + + return function_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* GradientDef::unsafe_arena_release_function_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GradientDef.function_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return function_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void GradientDef::set_allocated_function_name(::std::string* function_name) { + if (function_name != NULL) { + + } else { + + } + function_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), function_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.GradientDef.function_name) +} +void GradientDef::unsafe_arena_set_allocated_function_name( + ::std::string* function_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (function_name != NULL) { + + } else { + + } + function_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + function_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GradientDef.function_name) +} + +// optional string gradient_func = 2; +void GradientDef::clear_gradient_func() { + gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& GradientDef::gradient_func() const { + // @@protoc_insertion_point(field_get:tensorflow.GradientDef.gradient_func) + return gradient_func_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void GradientDef::set_gradient_func(const ::std::string& value) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.GradientDef.gradient_func) +} +void GradientDef::set_gradient_func(const char* value) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.GradientDef.gradient_func) +} +void GradientDef::set_gradient_func(const char* value, + size_t size) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.GradientDef.gradient_func) +} +::std::string* GradientDef::mutable_gradient_func() { + + // @@protoc_insertion_point(field_mutable:tensorflow.GradientDef.gradient_func) + return gradient_func_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* GradientDef::release_gradient_func() { + // @@protoc_insertion_point(field_release:tensorflow.GradientDef.gradient_func) + + return gradient_func_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* GradientDef::unsafe_arena_release_gradient_func() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GradientDef.gradient_func) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return gradient_func_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void GradientDef::set_allocated_gradient_func(::std::string* gradient_func) { + if (gradient_func != NULL) { + + } else { + + } + gradient_func_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), gradient_func, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.GradientDef.gradient_func) +} +void GradientDef::unsafe_arena_set_allocated_gradient_func( + ::std::string* gradient_func) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (gradient_func != NULL) { + + } else { + + } + gradient_func_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + gradient_func, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GradientDef.gradient_func) +} + +inline const GradientDef* GradientDef::internal_default_instance() { + return &GradientDef_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/function.pb.h b/modules/dnn/misc/tensorflow/function.pb.h new file mode 100644 index 0000000000..3f89687b61 --- /dev/null +++ b/modules/dnn/misc/tensorflow/function.pb.h @@ -0,0 +1,1160 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: function.proto + +#ifndef PROTOBUF_function_2eproto__INCLUDED +#define PROTOBUF_function_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "attr_value.pb.h" +#include "op_def.pb.h" +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_function_2eproto(); +void protobuf_InitDefaults_function_2eproto(); +void protobuf_AssignDesc_function_2eproto(); +void protobuf_ShutdownFile_function_2eproto(); + +class FunctionDef; +class FunctionDefLibrary; +class FunctionDef_Node; +class GradientDef; + +// =================================================================== + +class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.FunctionDefLibrary) */ { + public: + FunctionDefLibrary(); + virtual ~FunctionDefLibrary(); + + FunctionDefLibrary(const FunctionDefLibrary& from); + + inline FunctionDefLibrary& operator=(const FunctionDefLibrary& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FunctionDefLibrary& default_instance(); + + static const FunctionDefLibrary* internal_default_instance(); + + void UnsafeArenaSwap(FunctionDefLibrary* other); + void Swap(FunctionDefLibrary* other); + + // implements Message ---------------------------------------------- + + inline FunctionDefLibrary* New() const { return New(NULL); } + + FunctionDefLibrary* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FunctionDefLibrary& from); + void MergeFrom(const FunctionDefLibrary& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FunctionDefLibrary* other); + void UnsafeMergeFrom(const FunctionDefLibrary& from); + protected: + explicit FunctionDefLibrary(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .tensorflow.FunctionDef function = 1; + int function_size() const; + void clear_function(); + static const int kFunctionFieldNumber = 1; + const ::tensorflow::FunctionDef& function(int index) const; + ::tensorflow::FunctionDef* mutable_function(int index); + ::tensorflow::FunctionDef* add_function(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >* + mutable_function(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >& + function() const; + + // repeated .tensorflow.GradientDef gradient = 2; + int gradient_size() const; + void clear_gradient(); + static const int kGradientFieldNumber = 2; + const ::tensorflow::GradientDef& gradient(int index) const; + ::tensorflow::GradientDef* mutable_gradient(int index); + ::tensorflow::GradientDef* add_gradient(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >* + mutable_gradient(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >& + gradient() const; + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionDefLibrary) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef > function_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef > gradient_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_function_2eproto_impl(); + friend void protobuf_AddDesc_function_2eproto_impl(); + friend void protobuf_AssignDesc_function_2eproto(); + friend void protobuf_ShutdownFile_function_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed FunctionDefLibrary_default_instance_; + +// ------------------------------------------------------------------- + +class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.FunctionDef.Node) */ { + public: + FunctionDef_Node(); + virtual ~FunctionDef_Node(); + + FunctionDef_Node(const FunctionDef_Node& from); + + inline FunctionDef_Node& operator=(const FunctionDef_Node& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FunctionDef_Node& default_instance(); + + static const FunctionDef_Node* internal_default_instance(); + + void UnsafeArenaSwap(FunctionDef_Node* other); + void Swap(FunctionDef_Node* other); + + // implements Message ---------------------------------------------- + + inline FunctionDef_Node* New() const { return New(NULL); } + + FunctionDef_Node* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FunctionDef_Node& from); + void MergeFrom(const FunctionDef_Node& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FunctionDef_Node* other); + void UnsafeMergeFrom(const FunctionDef_Node& from); + protected: + explicit FunctionDef_Node(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // repeated string ret = 1; + int ret_size() const; + void clear_ret(); + static const int kRetFieldNumber = 1; + const ::std::string& ret(int index) const; + ::std::string* mutable_ret(int index); + void set_ret(int index, const ::std::string& value); + void set_ret(int index, const char* value); + void set_ret(int index, const char* value, size_t size); + ::std::string* add_ret(); + void add_ret(const ::std::string& value); + void add_ret(const char* value); + void add_ret(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& ret() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_ret(); + + // optional string op = 2; + void clear_op(); + static const int kOpFieldNumber = 2; + const ::std::string& op() const; + void set_op(const ::std::string& value); + void set_op(const char* value); + void set_op(const char* value, size_t size); + ::std::string* mutable_op(); + ::std::string* release_op(); + void set_allocated_op(::std::string* op); + ::std::string* unsafe_arena_release_op(); + void unsafe_arena_set_allocated_op( + ::std::string* op); + + // repeated string arg = 3; + int arg_size() const; + void clear_arg(); + static const int kArgFieldNumber = 3; + const ::std::string& arg(int index) const; + ::std::string* mutable_arg(int index); + void set_arg(int index, const ::std::string& value); + void set_arg(int index, const char* value); + void set_arg(int index, const char* value, size_t size); + ::std::string* add_arg(); + void add_arg(const ::std::string& value); + void add_arg(const char* value); + void add_arg(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& arg() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_arg(); + + // repeated string dep = 4; + int dep_size() const; + void clear_dep(); + static const int kDepFieldNumber = 4; + const ::std::string& dep(int index) const; + ::std::string* mutable_dep(int index); + void set_dep(int index, const ::std::string& value); + void set_dep(int index, const char* value); + void set_dep(int index, const char* value, size_t size); + ::std::string* add_dep(); + void add_dep(const ::std::string& value); + void add_dep(const char* value); + void add_dep(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& dep() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_dep(); + + // map attr = 5; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 5; + const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* + mutable_attr(); + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef.Node) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> ret_; + ::google::protobuf::RepeatedPtrField< ::std::string> arg_; + ::google::protobuf::RepeatedPtrField< ::std::string> dep_; + typedef ::google::protobuf::internal::MapEntryLite< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > + FunctionDef_Node_AttrEntry; + ::google::protobuf::internal::MapField< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::google::protobuf::internal::ArenaStringPtr op_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_function_2eproto_impl(); + friend void protobuf_AddDesc_function_2eproto_impl(); + friend void protobuf_AssignDesc_function_2eproto(); + friend void protobuf_ShutdownFile_function_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed FunctionDef_Node_default_instance_; + +// ------------------------------------------------------------------- + +class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.FunctionDef) */ { + public: + FunctionDef(); + virtual ~FunctionDef(); + + FunctionDef(const FunctionDef& from); + + inline FunctionDef& operator=(const FunctionDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const FunctionDef& default_instance(); + + static const FunctionDef* internal_default_instance(); + + void UnsafeArenaSwap(FunctionDef* other); + void Swap(FunctionDef* other); + + // implements Message ---------------------------------------------- + + inline FunctionDef* New() const { return New(NULL); } + + FunctionDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FunctionDef& from); + void MergeFrom(const FunctionDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FunctionDef* other); + void UnsafeMergeFrom(const FunctionDef& from); + protected: + explicit FunctionDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef FunctionDef_Node Node; + + // accessors ------------------------------------------------------- + + // optional .tensorflow.OpDef signature = 1; + bool has_signature() const; + void clear_signature(); + static const int kSignatureFieldNumber = 1; + private: + void _slow_mutable_signature(); + void _slow_set_allocated_signature( + ::google::protobuf::Arena* message_arena, ::tensorflow::OpDef** signature); + ::tensorflow::OpDef* _slow_release_signature(); + public: + const ::tensorflow::OpDef& signature() const; + ::tensorflow::OpDef* mutable_signature(); + ::tensorflow::OpDef* release_signature(); + void set_allocated_signature(::tensorflow::OpDef* signature); + ::tensorflow::OpDef* unsafe_arena_release_signature(); + void unsafe_arena_set_allocated_signature( + ::tensorflow::OpDef* signature); + + // repeated .tensorflow.FunctionDef.Node node = 2; + int node_size() const; + void clear_node(); + static const int kNodeFieldNumber = 2; + const ::tensorflow::FunctionDef_Node& node(int index) const; + ::tensorflow::FunctionDef_Node* mutable_node(int index); + ::tensorflow::FunctionDef_Node* add_node(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >* + mutable_node(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >& + node() const; + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node > node_; + ::tensorflow::OpDef* signature_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_function_2eproto_impl(); + friend void protobuf_AddDesc_function_2eproto_impl(); + friend void protobuf_AssignDesc_function_2eproto(); + friend void protobuf_ShutdownFile_function_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed FunctionDef_default_instance_; + +// ------------------------------------------------------------------- + +class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.GradientDef) */ { + public: + GradientDef(); + virtual ~GradientDef(); + + GradientDef(const GradientDef& from); + + inline GradientDef& operator=(const GradientDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GradientDef& default_instance(); + + static const GradientDef* internal_default_instance(); + + void UnsafeArenaSwap(GradientDef* other); + void Swap(GradientDef* other); + + // implements Message ---------------------------------------------- + + inline GradientDef* New() const { return New(NULL); } + + GradientDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const GradientDef& from); + void MergeFrom(const GradientDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(GradientDef* other); + void UnsafeMergeFrom(const GradientDef& from); + protected: + explicit GradientDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string function_name = 1; + void clear_function_name(); + static const int kFunctionNameFieldNumber = 1; + const ::std::string& function_name() const; + void set_function_name(const ::std::string& value); + void set_function_name(const char* value); + void set_function_name(const char* value, size_t size); + ::std::string* mutable_function_name(); + ::std::string* release_function_name(); + void set_allocated_function_name(::std::string* function_name); + ::std::string* unsafe_arena_release_function_name(); + void unsafe_arena_set_allocated_function_name( + ::std::string* function_name); + + // optional string gradient_func = 2; + void clear_gradient_func(); + static const int kGradientFuncFieldNumber = 2; + const ::std::string& gradient_func() const; + void set_gradient_func(const ::std::string& value); + void set_gradient_func(const char* value); + void set_gradient_func(const char* value, size_t size); + ::std::string* mutable_gradient_func(); + ::std::string* release_gradient_func(); + void set_allocated_gradient_func(::std::string* gradient_func); + ::std::string* unsafe_arena_release_gradient_func(); + void unsafe_arena_set_allocated_gradient_func( + ::std::string* gradient_func); + + // @@protoc_insertion_point(class_scope:tensorflow.GradientDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr function_name_; + ::google::protobuf::internal::ArenaStringPtr gradient_func_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_function_2eproto_impl(); + friend void protobuf_AddDesc_function_2eproto_impl(); + friend void protobuf_AssignDesc_function_2eproto(); + friend void protobuf_ShutdownFile_function_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed GradientDef_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// FunctionDefLibrary + +// repeated .tensorflow.FunctionDef function = 1; +inline int FunctionDefLibrary::function_size() const { + return function_.size(); +} +inline void FunctionDefLibrary::clear_function() { + function_.Clear(); +} +inline const ::tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDefLibrary.function) + return function_.Get(index); +} +inline ::tensorflow::FunctionDef* FunctionDefLibrary::mutable_function(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDefLibrary.function) + return function_.Mutable(index); +} +inline ::tensorflow::FunctionDef* FunctionDefLibrary::add_function() { + // @@protoc_insertion_point(field_add:tensorflow.FunctionDefLibrary.function) + return function_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >* +FunctionDefLibrary::mutable_function() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDefLibrary.function) + return &function_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >& +FunctionDefLibrary::function() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDefLibrary.function) + return function_; +} + +// repeated .tensorflow.GradientDef gradient = 2; +inline int FunctionDefLibrary::gradient_size() const { + return gradient_.size(); +} +inline void FunctionDefLibrary::clear_gradient() { + gradient_.Clear(); +} +inline const ::tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDefLibrary.gradient) + return gradient_.Get(index); +} +inline ::tensorflow::GradientDef* FunctionDefLibrary::mutable_gradient(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDefLibrary.gradient) + return gradient_.Mutable(index); +} +inline ::tensorflow::GradientDef* FunctionDefLibrary::add_gradient() { + // @@protoc_insertion_point(field_add:tensorflow.FunctionDefLibrary.gradient) + return gradient_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >* +FunctionDefLibrary::mutable_gradient() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDefLibrary.gradient) + return &gradient_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >& +FunctionDefLibrary::gradient() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDefLibrary.gradient) + return gradient_; +} + +inline const FunctionDefLibrary* FunctionDefLibrary::internal_default_instance() { + return &FunctionDefLibrary_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// FunctionDef_Node + +// repeated string ret = 1; +inline int FunctionDef_Node::ret_size() const { + return ret_.size(); +} +inline void FunctionDef_Node::clear_ret() { + ret_.Clear(); +} +inline const ::std::string& FunctionDef_Node::ret(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.ret) + return ret_.Get(index); +} +inline ::std::string* FunctionDef_Node::mutable_ret(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.ret) + return ret_.Mutable(index); +} +inline void FunctionDef_Node::set_ret(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.ret) + ret_.Mutable(index)->assign(value); +} +inline void FunctionDef_Node::set_ret(int index, const char* value) { + ret_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.ret) +} +inline void FunctionDef_Node::set_ret(int index, const char* value, size_t size) { + ret_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.ret) +} +inline ::std::string* FunctionDef_Node::add_ret() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.ret) + return ret_.Add(); +} +inline void FunctionDef_Node::add_ret(const ::std::string& value) { + ret_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.ret) +} +inline void FunctionDef_Node::add_ret(const char* value) { + ret_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.ret) +} +inline void FunctionDef_Node::add_ret(const char* value, size_t size) { + ret_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.ret) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +FunctionDef_Node::ret() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.ret) + return ret_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +FunctionDef_Node::mutable_ret() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.ret) + return &ret_; +} + +// optional string op = 2; +inline void FunctionDef_Node::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& FunctionDef_Node::op() const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.op) + return op_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FunctionDef_Node::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.op) +} +inline void FunctionDef_Node::set_op(const char* value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.op) +} +inline void FunctionDef_Node::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.op) +} +inline ::std::string* FunctionDef_Node::mutable_op() { + + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FunctionDef_Node::release_op() { + // @@protoc_insertion_point(field_release:tensorflow.FunctionDef.Node.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* FunctionDef_Node::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.FunctionDef.Node.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void FunctionDef_Node::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.FunctionDef.Node.op) +} +inline void FunctionDef_Node::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.FunctionDef.Node.op) +} + +// repeated string arg = 3; +inline int FunctionDef_Node::arg_size() const { + return arg_.size(); +} +inline void FunctionDef_Node::clear_arg() { + arg_.Clear(); +} +inline const ::std::string& FunctionDef_Node::arg(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.arg) + return arg_.Get(index); +} +inline ::std::string* FunctionDef_Node::mutable_arg(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.arg) + return arg_.Mutable(index); +} +inline void FunctionDef_Node::set_arg(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.arg) + arg_.Mutable(index)->assign(value); +} +inline void FunctionDef_Node::set_arg(int index, const char* value) { + arg_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.arg) +} +inline void FunctionDef_Node::set_arg(int index, const char* value, size_t size) { + arg_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.arg) +} +inline ::std::string* FunctionDef_Node::add_arg() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.arg) + return arg_.Add(); +} +inline void FunctionDef_Node::add_arg(const ::std::string& value) { + arg_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.arg) +} +inline void FunctionDef_Node::add_arg(const char* value) { + arg_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.arg) +} +inline void FunctionDef_Node::add_arg(const char* value, size_t size) { + arg_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.arg) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +FunctionDef_Node::arg() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.arg) + return arg_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +FunctionDef_Node::mutable_arg() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.arg) + return &arg_; +} + +// repeated string dep = 4; +inline int FunctionDef_Node::dep_size() const { + return dep_.size(); +} +inline void FunctionDef_Node::clear_dep() { + dep_.Clear(); +} +inline const ::std::string& FunctionDef_Node::dep(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.dep) + return dep_.Get(index); +} +inline ::std::string* FunctionDef_Node::mutable_dep(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.dep) + return dep_.Mutable(index); +} +inline void FunctionDef_Node::set_dep(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.dep) + dep_.Mutable(index)->assign(value); +} +inline void FunctionDef_Node::set_dep(int index, const char* value) { + dep_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.dep) +} +inline void FunctionDef_Node::set_dep(int index, const char* value, size_t size) { + dep_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.dep) +} +inline ::std::string* FunctionDef_Node::add_dep() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.dep) + return dep_.Add(); +} +inline void FunctionDef_Node::add_dep(const ::std::string& value) { + dep_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.dep) +} +inline void FunctionDef_Node::add_dep(const char* value) { + dep_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.dep) +} +inline void FunctionDef_Node::add_dep(const char* value, size_t size) { + dep_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.dep) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +FunctionDef_Node::dep() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.dep) + return dep_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +FunctionDef_Node::mutable_dep() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.dep) + return &dep_; +} + +// map attr = 5; +inline int FunctionDef_Node::attr_size() const { + return attr_.size(); +} +inline void FunctionDef_Node::clear_attr() { + attr_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& +FunctionDef_Node::attr() const { + // @@protoc_insertion_point(field_map:tensorflow.FunctionDef.Node.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* +FunctionDef_Node::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:tensorflow.FunctionDef.Node.attr) + return attr_.MutableMap(); +} + +inline const FunctionDef_Node* FunctionDef_Node::internal_default_instance() { + return &FunctionDef_Node_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// FunctionDef + +// optional .tensorflow.OpDef signature = 1; +inline bool FunctionDef::has_signature() const { + return this != internal_default_instance() && signature_ != NULL; +} +inline void FunctionDef::clear_signature() { + if (GetArenaNoVirtual() == NULL && signature_ != NULL) delete signature_; + signature_ = NULL; +} +inline const ::tensorflow::OpDef& FunctionDef::signature() const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.signature) + return signature_ != NULL ? *signature_ + : *::tensorflow::OpDef::internal_default_instance(); +} +inline ::tensorflow::OpDef* FunctionDef::mutable_signature() { + + if (signature_ == NULL) { + _slow_mutable_signature(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.signature) + return signature_; +} +inline ::tensorflow::OpDef* FunctionDef::release_signature() { + // @@protoc_insertion_point(field_release:tensorflow.FunctionDef.signature) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_signature(); + } else { + ::tensorflow::OpDef* temp = signature_; + signature_ = NULL; + return temp; + } +} +inline void FunctionDef::set_allocated_signature(::tensorflow::OpDef* signature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete signature_; + } + if (signature != NULL) { + _slow_set_allocated_signature(message_arena, &signature); + } + signature_ = signature; + if (signature) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.FunctionDef.signature) +} + +// repeated .tensorflow.FunctionDef.Node node = 2; +inline int FunctionDef::node_size() const { + return node_.size(); +} +inline void FunctionDef::clear_node() { + node_.Clear(); +} +inline const ::tensorflow::FunctionDef_Node& FunctionDef::node(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.FunctionDef.node) + return node_.Get(index); +} +inline ::tensorflow::FunctionDef_Node* FunctionDef::mutable_node(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.node) + return node_.Mutable(index); +} +inline ::tensorflow::FunctionDef_Node* FunctionDef::add_node() { + // @@protoc_insertion_point(field_add:tensorflow.FunctionDef.node) + return node_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >* +FunctionDef::mutable_node() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.node) + return &node_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >& +FunctionDef::node() const { + // @@protoc_insertion_point(field_list:tensorflow.FunctionDef.node) + return node_; +} + +inline const FunctionDef* FunctionDef::internal_default_instance() { + return &FunctionDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// GradientDef + +// optional string function_name = 1; +inline void GradientDef::clear_function_name() { + function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GradientDef::function_name() const { + // @@protoc_insertion_point(field_get:tensorflow.GradientDef.function_name) + return function_name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void GradientDef::set_function_name(const ::std::string& value) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.GradientDef.function_name) +} +inline void GradientDef::set_function_name(const char* value) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.GradientDef.function_name) +} +inline void GradientDef::set_function_name(const char* value, + size_t size) { + + function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.GradientDef.function_name) +} +inline ::std::string* GradientDef::mutable_function_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.GradientDef.function_name) + return function_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GradientDef::release_function_name() { + // @@protoc_insertion_point(field_release:tensorflow.GradientDef.function_name) + + return function_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GradientDef::unsafe_arena_release_function_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GradientDef.function_name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return function_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GradientDef::set_allocated_function_name(::std::string* function_name) { + if (function_name != NULL) { + + } else { + + } + function_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), function_name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.GradientDef.function_name) +} +inline void GradientDef::unsafe_arena_set_allocated_function_name( + ::std::string* function_name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (function_name != NULL) { + + } else { + + } + function_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + function_name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GradientDef.function_name) +} + +// optional string gradient_func = 2; +inline void GradientDef::clear_gradient_func() { + gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& GradientDef::gradient_func() const { + // @@protoc_insertion_point(field_get:tensorflow.GradientDef.gradient_func) + return gradient_func_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void GradientDef::set_gradient_func(const ::std::string& value) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.GradientDef.gradient_func) +} +inline void GradientDef::set_gradient_func(const char* value) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.GradientDef.gradient_func) +} +inline void GradientDef::set_gradient_func(const char* value, + size_t size) { + + gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.GradientDef.gradient_func) +} +inline ::std::string* GradientDef::mutable_gradient_func() { + + // @@protoc_insertion_point(field_mutable:tensorflow.GradientDef.gradient_func) + return gradient_func_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GradientDef::release_gradient_func() { + // @@protoc_insertion_point(field_release:tensorflow.GradientDef.gradient_func) + + return gradient_func_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* GradientDef::unsafe_arena_release_gradient_func() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GradientDef.gradient_func) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return gradient_func_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void GradientDef::set_allocated_gradient_func(::std::string* gradient_func) { + if (gradient_func != NULL) { + + } else { + + } + gradient_func_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), gradient_func, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.GradientDef.gradient_func) +} +inline void GradientDef::unsafe_arena_set_allocated_gradient_func( + ::std::string* gradient_func) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (gradient_func != NULL) { + + } else { + + } + gradient_func_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + gradient_func, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GradientDef.gradient_func) +} + +inline const GradientDef* GradientDef::internal_default_instance() { + return &GradientDef_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_function_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/graph.pb.cc b/modules/dnn/misc/tensorflow/graph.pb.cc new file mode 100644 index 0000000000..21cec2e77e --- /dev/null +++ b/modules/dnn/misc/tensorflow/graph.pb.cc @@ -0,0 +1,1687 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: graph.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "graph.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* GraphDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + GraphDef_reflection_ = NULL; +const ::google::protobuf::Descriptor* NodeDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NodeDef_reflection_ = NULL; +const ::google::protobuf::Descriptor* NodeDef_AttrEntry_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_graph_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_graph_2eproto() { + protobuf_AddDesc_graph_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "graph.proto"); + GOOGLE_CHECK(file != NULL); + GraphDef_descriptor_ = file->message_type(0); + static const int GraphDef_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GraphDef, node_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GraphDef, versions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GraphDef, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GraphDef, library_), + }; + GraphDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + GraphDef_descriptor_, + GraphDef::internal_default_instance(), + GraphDef_offsets_, + -1, + -1, + -1, + sizeof(GraphDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GraphDef, _internal_metadata_)); + NodeDef_descriptor_ = file->message_type(1); + static const int NodeDef_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NodeDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NodeDef, op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NodeDef, input_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NodeDef, device_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NodeDef, attr_), + }; + NodeDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + NodeDef_descriptor_, + NodeDef::internal_default_instance(), + NodeDef_offsets_, + -1, + -1, + -1, + sizeof(NodeDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NodeDef, _internal_metadata_)); + NodeDef_AttrEntry_descriptor_ = NodeDef_descriptor_->nested_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_graph_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + GraphDef_descriptor_, GraphDef::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NodeDef_descriptor_, NodeDef::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NodeDef_AttrEntry_descriptor_, + ::google::protobuf::internal::MapEntry< + ::std::string, + ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0>::CreateDefaultInstance( + NodeDef_AttrEntry_descriptor_)); +} + +} // namespace + +void protobuf_ShutdownFile_graph_2eproto() { + GraphDef_default_instance_.Shutdown(); + delete GraphDef_reflection_; + NodeDef_default_instance_.Shutdown(); + delete NodeDef_reflection_; +} + +void protobuf_InitDefaults_graph_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::tensorflow::protobuf_InitDefaults_attr_5fvalue_2eproto(); + ::tensorflow::protobuf_InitDefaults_function_2eproto(); + ::tensorflow::protobuf_InitDefaults_versions_2eproto(); + GraphDef_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + NodeDef_default_instance_.DefaultConstruct(); + GraphDef_default_instance_.get_mutable()->InitAsDefaultInstance(); + NodeDef_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_graph_2eproto_once_); +void protobuf_InitDefaults_graph_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_graph_2eproto_once_, + &protobuf_InitDefaults_graph_2eproto_impl); +} +void protobuf_AddDesc_graph_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_graph_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\013graph.proto\022\ntensorflow\032\020attr_value.pr" + "oto\032\016function.proto\032\016versions.proto\"\235\001\n\010" + "GraphDef\022!\n\004node\030\001 \003(\0132\023.tensorflow.Node" + "Def\022(\n\010versions\030\004 \001(\0132\026.tensorflow.Versi" + "onDef\022\023\n\007version\030\003 \001(\005B\002\030\001\022/\n\007library\030\002 " + "\001(\0132\036.tensorflow.FunctionDefLibrary\"\263\001\n\007" + "NodeDef\022\014\n\004name\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005inp" + "ut\030\003 \003(\t\022\016\n\006device\030\004 \001(\t\022+\n\004attr\030\005 \003(\0132\035" + ".tensorflow.NodeDef.AttrEntry\032B\n\tAttrEnt" + "ry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tensorf" + "low.AttrValue:\0028\001B,\n\030org.tensorflow.fram" + "eworkB\013GraphProtosP\001\370\001\001b\006proto3", 471); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "graph.proto", &protobuf_RegisterTypes); + ::tensorflow::protobuf_AddDesc_attr_5fvalue_2eproto(); + ::tensorflow::protobuf_AddDesc_function_2eproto(); + ::tensorflow::protobuf_AddDesc_versions_2eproto(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_graph_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_graph_2eproto_once_); +void protobuf_AddDesc_graph_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_graph_2eproto_once_, + &protobuf_AddDesc_graph_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_graph_2eproto { + StaticDescriptorInitializer_graph_2eproto() { + protobuf_AddDesc_graph_2eproto(); + } +} static_descriptor_initializer_graph_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +void GraphDef::_slow_mutable_versions() { + versions_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::VersionDef >( + GetArenaNoVirtual()); +} +::tensorflow::VersionDef* GraphDef::_slow_release_versions() { + if (versions_ == NULL) { + return NULL; + } else { + ::tensorflow::VersionDef* temp = new ::tensorflow::VersionDef(*versions_); + versions_ = NULL; + return temp; + } +} +::tensorflow::VersionDef* GraphDef::unsafe_arena_release_versions() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GraphDef.versions) + + ::tensorflow::VersionDef* temp = versions_; + versions_ = NULL; + return temp; +} +void GraphDef::_slow_set_allocated_versions( + ::google::protobuf::Arena* message_arena, ::tensorflow::VersionDef** versions) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*versions) == NULL) { + message_arena->Own(*versions); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*versions)) { + ::tensorflow::VersionDef* new_versions = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::VersionDef >( + message_arena); + new_versions->CopyFrom(**versions); + *versions = new_versions; + } +} +void GraphDef::unsafe_arena_set_allocated_versions( + ::tensorflow::VersionDef* versions) { + if (GetArenaNoVirtual() == NULL) { + delete versions_; + } + versions_ = versions; + if (versions) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GraphDef.versions) +} +void GraphDef::_slow_mutable_library() { + library_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::FunctionDefLibrary >( + GetArenaNoVirtual()); +} +::tensorflow::FunctionDefLibrary* GraphDef::_slow_release_library() { + if (library_ == NULL) { + return NULL; + } else { + ::tensorflow::FunctionDefLibrary* temp = new ::tensorflow::FunctionDefLibrary(*library_); + library_ = NULL; + return temp; + } +} +::tensorflow::FunctionDefLibrary* GraphDef::unsafe_arena_release_library() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GraphDef.library) + + ::tensorflow::FunctionDefLibrary* temp = library_; + library_ = NULL; + return temp; +} +void GraphDef::_slow_set_allocated_library( + ::google::protobuf::Arena* message_arena, ::tensorflow::FunctionDefLibrary** library) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*library) == NULL) { + message_arena->Own(*library); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*library)) { + ::tensorflow::FunctionDefLibrary* new_library = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::FunctionDefLibrary >( + message_arena); + new_library->CopyFrom(**library); + *library = new_library; + } +} +void GraphDef::unsafe_arena_set_allocated_library( + ::tensorflow::FunctionDefLibrary* library) { + if (GetArenaNoVirtual() == NULL) { + delete library_; + } + library_ = library; + if (library) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GraphDef.library) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GraphDef::kNodeFieldNumber; +const int GraphDef::kVersionsFieldNumber; +const int GraphDef::kVersionFieldNumber; +const int GraphDef::kLibraryFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GraphDef::GraphDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_graph_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.GraphDef) +} +GraphDef::GraphDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + node_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_graph_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.GraphDef) +} + +void GraphDef::InitAsDefaultInstance() { + versions_ = const_cast< ::tensorflow::VersionDef*>( + ::tensorflow::VersionDef::internal_default_instance()); + library_ = const_cast< ::tensorflow::FunctionDefLibrary*>( + ::tensorflow::FunctionDefLibrary::internal_default_instance()); +} + +GraphDef::GraphDef(const GraphDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.GraphDef) +} + +void GraphDef::SharedCtor() { + versions_ = NULL; + library_ = NULL; + version_ = 0; + _cached_size_ = 0; +} + +GraphDef::~GraphDef() { + // @@protoc_insertion_point(destructor:tensorflow.GraphDef) + SharedDtor(); +} + +void GraphDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + if (this != &GraphDef_default_instance_.get()) { + delete versions_; + delete library_; + } +} + +void GraphDef::ArenaDtor(void* object) { + GraphDef* _this = reinterpret_cast< GraphDef* >(object); + (void)_this; +} +void GraphDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void GraphDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* GraphDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return GraphDef_descriptor_; +} + +const GraphDef& GraphDef::default_instance() { + protobuf_InitDefaults_graph_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed GraphDef_default_instance_; + +GraphDef* GraphDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void GraphDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.GraphDef) + if (GetArenaNoVirtual() == NULL && versions_ != NULL) delete versions_; + versions_ = NULL; + version_ = 0; + if (GetArenaNoVirtual() == NULL && library_ != NULL) delete library_; + library_ = NULL; + node_.Clear(); +} + +bool GraphDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.GraphDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .tensorflow.NodeDef node = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_node: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_node())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_node; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(18)) goto parse_library; + break; + } + + // optional .tensorflow.FunctionDefLibrary library = 2; + case 2: { + if (tag == 18) { + parse_library: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_library())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_version; + break; + } + + // optional int32 version = 3 [deprecated = true]; + case 3: { + if (tag == 24) { + parse_version: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_versions; + break; + } + + // optional .tensorflow.VersionDef versions = 4; + case 4: { + if (tag == 34) { + parse_versions: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_versions())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.GraphDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.GraphDef) + return false; +#undef DO_ +} + +void GraphDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.GraphDef) + // repeated .tensorflow.NodeDef node = 1; + for (unsigned int i = 0, n = this->node_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->node(i), output); + } + + // optional .tensorflow.FunctionDefLibrary library = 2; + if (this->has_library()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *this->library_, output); + } + + // optional int32 version = 3 [deprecated = true]; + if (this->version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version(), output); + } + + // optional .tensorflow.VersionDef versions = 4; + if (this->has_versions()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *this->versions_, output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.GraphDef) +} + +::google::protobuf::uint8* GraphDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.GraphDef) + // repeated .tensorflow.NodeDef node = 1; + for (unsigned int i = 0, n = this->node_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->node(i), false, target); + } + + // optional .tensorflow.FunctionDefLibrary library = 2; + if (this->has_library()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *this->library_, false, target); + } + + // optional int32 version = 3 [deprecated = true]; + if (this->version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version(), target); + } + + // optional .tensorflow.VersionDef versions = 4; + if (this->has_versions()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, *this->versions_, false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.GraphDef) + return target; +} + +size_t GraphDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.GraphDef) + size_t total_size = 0; + + // optional .tensorflow.VersionDef versions = 4; + if (this->has_versions()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->versions_); + } + + // optional int32 version = 3 [deprecated = true]; + if (this->version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version()); + } + + // optional .tensorflow.FunctionDefLibrary library = 2; + if (this->has_library()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->library_); + } + + // repeated .tensorflow.NodeDef node = 1; + { + unsigned int count = this->node_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->node(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void GraphDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.GraphDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const GraphDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.GraphDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.GraphDef) + UnsafeMergeFrom(*source); + } +} + +void GraphDef::MergeFrom(const GraphDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.GraphDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void GraphDef::UnsafeMergeFrom(const GraphDef& from) { + GOOGLE_DCHECK(&from != this); + node_.MergeFrom(from.node_); + if (from.has_versions()) { + mutable_versions()->::tensorflow::VersionDef::MergeFrom(from.versions()); + } + if (from.version() != 0) { + set_version(from.version()); + } + if (from.has_library()) { + mutable_library()->::tensorflow::FunctionDefLibrary::MergeFrom(from.library()); + } +} + +void GraphDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.GraphDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GraphDef::CopyFrom(const GraphDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.GraphDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool GraphDef::IsInitialized() const { + + return true; +} + +void GraphDef::Swap(GraphDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + GraphDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void GraphDef::UnsafeArenaSwap(GraphDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void GraphDef::InternalSwap(GraphDef* other) { + node_.UnsafeArenaSwap(&other->node_); + std::swap(versions_, other->versions_); + std::swap(version_, other->version_); + std::swap(library_, other->library_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata GraphDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = GraphDef_descriptor_; + metadata.reflection = GraphDef_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// GraphDef + +// repeated .tensorflow.NodeDef node = 1; +int GraphDef::node_size() const { + return node_.size(); +} +void GraphDef::clear_node() { + node_.Clear(); +} +const ::tensorflow::NodeDef& GraphDef::node(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.node) + return node_.Get(index); +} +::tensorflow::NodeDef* GraphDef::mutable_node(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.node) + return node_.Mutable(index); +} +::tensorflow::NodeDef* GraphDef::add_node() { + // @@protoc_insertion_point(field_add:tensorflow.GraphDef.node) + return node_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >* +GraphDef::mutable_node() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.GraphDef.node) + return &node_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >& +GraphDef::node() const { + // @@protoc_insertion_point(field_list:tensorflow.GraphDef.node) + return node_; +} + +// optional .tensorflow.VersionDef versions = 4; +bool GraphDef::has_versions() const { + return this != internal_default_instance() && versions_ != NULL; +} +void GraphDef::clear_versions() { + if (GetArenaNoVirtual() == NULL && versions_ != NULL) delete versions_; + versions_ = NULL; +} +const ::tensorflow::VersionDef& GraphDef::versions() const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.versions) + return versions_ != NULL ? *versions_ + : *::tensorflow::VersionDef::internal_default_instance(); +} +::tensorflow::VersionDef* GraphDef::mutable_versions() { + + if (versions_ == NULL) { + _slow_mutable_versions(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.versions) + return versions_; +} +::tensorflow::VersionDef* GraphDef::release_versions() { + // @@protoc_insertion_point(field_release:tensorflow.GraphDef.versions) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_versions(); + } else { + ::tensorflow::VersionDef* temp = versions_; + versions_ = NULL; + return temp; + } +} + void GraphDef::set_allocated_versions(::tensorflow::VersionDef* versions) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete versions_; + } + if (versions != NULL) { + _slow_set_allocated_versions(message_arena, &versions); + } + versions_ = versions; + if (versions) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.GraphDef.versions) +} + +// optional int32 version = 3 [deprecated = true]; +void GraphDef::clear_version() { + version_ = 0; +} +::google::protobuf::int32 GraphDef::version() const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.version) + return version_; +} +void GraphDef::set_version(::google::protobuf::int32 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:tensorflow.GraphDef.version) +} + +// optional .tensorflow.FunctionDefLibrary library = 2; +bool GraphDef::has_library() const { + return this != internal_default_instance() && library_ != NULL; +} +void GraphDef::clear_library() { + if (GetArenaNoVirtual() == NULL && library_ != NULL) delete library_; + library_ = NULL; +} +const ::tensorflow::FunctionDefLibrary& GraphDef::library() const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.library) + return library_ != NULL ? *library_ + : *::tensorflow::FunctionDefLibrary::internal_default_instance(); +} +::tensorflow::FunctionDefLibrary* GraphDef::mutable_library() { + + if (library_ == NULL) { + _slow_mutable_library(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.library) + return library_; +} +::tensorflow::FunctionDefLibrary* GraphDef::release_library() { + // @@protoc_insertion_point(field_release:tensorflow.GraphDef.library) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_library(); + } else { + ::tensorflow::FunctionDefLibrary* temp = library_; + library_ = NULL; + return temp; + } +} + void GraphDef::set_allocated_library(::tensorflow::FunctionDefLibrary* library) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete library_; + } + if (library != NULL) { + _slow_set_allocated_library(message_arena, &library); + } + library_ = library; + if (library) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.GraphDef.library) +} + +inline const GraphDef* GraphDef::internal_default_instance() { + return &GraphDef_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int NodeDef::kNameFieldNumber; +const int NodeDef::kOpFieldNumber; +const int NodeDef::kInputFieldNumber; +const int NodeDef::kDeviceFieldNumber; +const int NodeDef::kAttrFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +NodeDef::NodeDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_graph_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.NodeDef) +} +NodeDef::NodeDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + input_(arena), + attr_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_graph_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.NodeDef) +} + +void NodeDef::InitAsDefaultInstance() { +} + +NodeDef::NodeDef(const NodeDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.NodeDef) +} + +void NodeDef::SharedCtor() { + attr_.SetAssignDescriptorCallback( + protobuf_AssignDescriptorsOnce); + attr_.SetEntryDescriptor( + &::tensorflow::NodeDef_AttrEntry_descriptor_); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; +} + +NodeDef::~NodeDef() { + // @@protoc_insertion_point(destructor:tensorflow.NodeDef) + SharedDtor(); +} + +void NodeDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + op_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + device_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void NodeDef::ArenaDtor(void* object) { + NodeDef* _this = reinterpret_cast< NodeDef* >(object); + (void)_this; +} +void NodeDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void NodeDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NodeDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NodeDef_descriptor_; +} + +const NodeDef& NodeDef::default_instance() { + protobuf_InitDefaults_graph_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed NodeDef_default_instance_; + +NodeDef* NodeDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void NodeDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.NodeDef) + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + input_.Clear(); + attr_.Clear(); +} + +bool NodeDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.NodeDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NodeDef.name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_op; + break; + } + + // optional string op = 2; + case 2: { + if (tag == 18) { + parse_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_op())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), this->op().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NodeDef.op")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_input; + break; + } + + // repeated string input = 3; + case 3: { + if (tag == 26) { + parse_input: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_input())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input(this->input_size() - 1).data(), + this->input(this->input_size() - 1).length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NodeDef.input")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_input; + if (input->ExpectTag(34)) goto parse_device; + break; + } + + // optional string device = 4; + case 4: { + if (tag == 34) { + parse_device: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_device())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), this->device().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NodeDef.device")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_attr; + break; + } + + // map attr = 5; + case 5: { + if (tag == 42) { + parse_attr: + DO_(input->IncrementRecursionDepth()); + parse_loop_attr: + NodeDef_AttrEntry::Parser< ::google::protobuf::internal::MapField< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 >, + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue > > parser(&attr_); + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + parser.key().data(), parser.key().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.NodeDef.AttrEntry.key")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_loop_attr; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.NodeDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.NodeDef) + return false; +#undef DO_ +} + +void NodeDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.NodeDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string op = 2; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), this->op().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.op"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->op(), output); + } + + // repeated string input = 3; + for (int i = 0; i < this->input_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input(i).data(), this->input(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.input"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->input(i), output); + } + + // optional string device = 4; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), this->device().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.device"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->device(), output); + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), p->first.length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.AttrEntry.key"); + } + }; + + if (output->IsSerializationDeterminstic() && + this->attr().size() > 1) { + ::google::protobuf::scoped_array items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[n] = SortItem(&*it); + } + ::std::sort(&items[0], &items[n], Less()); + ::google::protobuf::scoped_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[i]->first, items[i]->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[i]); + } + } else { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *entry, output); + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // @@protoc_insertion_point(serialize_end:tensorflow.NodeDef) +} + +::google::protobuf::uint8* NodeDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NodeDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string op = 2; + if (this->op().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->op().data(), this->op().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.op"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->op(), target); + } + + // repeated string input = 3; + for (int i = 0; i < this->input_size(); i++) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->input(i).data(), this->input(i).length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.input"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->input(i), target); + } + + // optional string device = 4; + if (this->device().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->device().data(), this->device().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.device"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->device(), target); + } + + // map attr = 5; + if (!this->attr().empty()) { + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::google::protobuf::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + p->first.data(), p->first.length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.NodeDef.AttrEntry.key"); + } + }; + + if (deterministic && + this->attr().size() > 1) { + ::google::protobuf::scoped_array items( + new SortItem[this->attr().size()]); + typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type; + size_type n = 0; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it, ++n) { + items[n] = SortItem(&*it); + } + ::std::sort(&items[0], &items[n], Less()); + ::google::protobuf::scoped_ptr entry; + for (size_type i = 0; i < n; i++) { + entry.reset(attr_.NewEntryWrapper( + items[i]->first, items[i]->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(items[i]); + } + } else { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + entry.reset(attr_.NewEntryWrapper( + it->first, it->second)); + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 5, *entry, deterministic, target); +; + if (entry->GetArena() != NULL) { + entry.release(); + } + Utf8Check::Check(&*it); + } + } + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NodeDef) + return target; +} + +size_t NodeDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.NodeDef) + size_t total_size = 0; + + // optional string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string op = 2; + if (this->op().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->op()); + } + + // optional string device = 4; + if (this->device().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->device()); + } + + // repeated string input = 3; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->input_size()); + for (int i = 0; i < this->input_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // map attr = 5; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->attr_size()); + { + ::google::protobuf::scoped_ptr entry; + for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator + it = this->attr().begin(); + it != this->attr().end(); ++it) { + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + entry.reset(attr_.NewEntryWrapper(it->first, it->second)); + total_size += ::google::protobuf::internal::WireFormatLite:: + MessageSizeNoVirtual(*entry); + } + if (entry.get() != NULL && entry->GetArena() != NULL) { + entry.release(); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NodeDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.NodeDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const NodeDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.NodeDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.NodeDef) + UnsafeMergeFrom(*source); + } +} + +void NodeDef::MergeFrom(const NodeDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NodeDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void NodeDef::UnsafeMergeFrom(const NodeDef& from) { + GOOGLE_DCHECK(&from != this); + input_.UnsafeMergeFrom(from.input_); + attr_.MergeFrom(from.attr_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.op().size() > 0) { + set_op(from.op()); + } + if (from.device().size() > 0) { + set_device(from.device()); + } +} + +void NodeDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.NodeDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NodeDef::CopyFrom(const NodeDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NodeDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool NodeDef::IsInitialized() const { + + return true; +} + +void NodeDef::Swap(NodeDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + NodeDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void NodeDef::UnsafeArenaSwap(NodeDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void NodeDef::InternalSwap(NodeDef* other) { + name_.Swap(&other->name_); + op_.Swap(&other->op_); + input_.UnsafeArenaSwap(&other->input_); + device_.Swap(&other->device_); + attr_.Swap(&other->attr_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata NodeDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NodeDef_descriptor_; + metadata.reflection = NodeDef_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NodeDef + +// optional string name = 1; +void NodeDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& NodeDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void NodeDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.name) +} +void NodeDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.name) +} +void NodeDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.name) +} +::std::string* NodeDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NodeDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.NodeDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NodeDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void NodeDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.name) +} +void NodeDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.name) +} + +// optional string op = 2; +void NodeDef::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& NodeDef::op() const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.op) + return op_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void NodeDef::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.op) +} +void NodeDef::set_op(const char* value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.op) +} +void NodeDef::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.op) +} +::std::string* NodeDef::mutable_op() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NodeDef::release_op() { + // @@protoc_insertion_point(field_release:tensorflow.NodeDef.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NodeDef::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void NodeDef::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.op) +} +void NodeDef::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.op) +} + +// repeated string input = 3; +int NodeDef::input_size() const { + return input_.size(); +} +void NodeDef::clear_input() { + input_.Clear(); +} +const ::std::string& NodeDef::input(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.input) + return input_.Get(index); +} +::std::string* NodeDef::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.input) + return input_.Mutable(index); +} +void NodeDef::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.input) + input_.Mutable(index)->assign(value); +} +void NodeDef::set_input(int index, const char* value) { + input_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.input) +} +void NodeDef::set_input(int index, const char* value, size_t size) { + input_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.input) +} +::std::string* NodeDef::add_input() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.NodeDef.input) + return input_.Add(); +} +void NodeDef::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.NodeDef.input) +} +void NodeDef::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.NodeDef.input) +} +void NodeDef::add_input(const char* value, size_t size) { + input_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.NodeDef.input) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +NodeDef::input() const { + // @@protoc_insertion_point(field_list:tensorflow.NodeDef.input) + return input_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +NodeDef::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.NodeDef.input) + return &input_; +} + +// optional string device = 4; +void NodeDef::clear_device() { + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& NodeDef::device() const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.device) + return device_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void NodeDef::set_device(const ::std::string& value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.device) +} +void NodeDef::set_device(const char* value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.device) +} +void NodeDef::set_device(const char* value, + size_t size) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.device) +} +::std::string* NodeDef::mutable_device() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.device) + return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NodeDef::release_device() { + // @@protoc_insertion_point(field_release:tensorflow.NodeDef.device) + + return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* NodeDef::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.device) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void NodeDef::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.device) +} +void NodeDef::unsafe_arena_set_allocated_device( + ::std::string* device) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device != NULL) { + + } else { + + } + device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.device) +} + +// map attr = 5; +int NodeDef::attr_size() const { + return attr_.size(); +} +void NodeDef::clear_attr() { + attr_.Clear(); +} + const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& +NodeDef::attr() const { + // @@protoc_insertion_point(field_map:tensorflow.NodeDef.attr) + return attr_.GetMap(); +} + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* +NodeDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:tensorflow.NodeDef.attr) + return attr_.MutableMap(); +} + +inline const NodeDef* NodeDef::internal_default_instance() { + return &NodeDef_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/graph.pb.h b/modules/dnn/misc/tensorflow/graph.pb.h new file mode 100644 index 0000000000..f4d54bc7f9 --- /dev/null +++ b/modules/dnn/misc/tensorflow/graph.pb.h @@ -0,0 +1,814 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: graph.proto + +#ifndef PROTOBUF_graph_2eproto__INCLUDED +#define PROTOBUF_graph_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "attr_value.pb.h" +#include "function.pb.h" +#include "versions.pb.h" +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_graph_2eproto(); +void protobuf_InitDefaults_graph_2eproto(); +void protobuf_AssignDesc_graph_2eproto(); +void protobuf_ShutdownFile_graph_2eproto(); + +class GraphDef; +class NodeDef; + +// =================================================================== + +class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.GraphDef) */ { + public: + GraphDef(); + virtual ~GraphDef(); + + GraphDef(const GraphDef& from); + + inline GraphDef& operator=(const GraphDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const GraphDef& default_instance(); + + static const GraphDef* internal_default_instance(); + + void UnsafeArenaSwap(GraphDef* other); + void Swap(GraphDef* other); + + // implements Message ---------------------------------------------- + + inline GraphDef* New() const { return New(NULL); } + + GraphDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const GraphDef& from); + void MergeFrom(const GraphDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(GraphDef* other); + void UnsafeMergeFrom(const GraphDef& from); + protected: + explicit GraphDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .tensorflow.NodeDef node = 1; + int node_size() const; + void clear_node(); + static const int kNodeFieldNumber = 1; + const ::tensorflow::NodeDef& node(int index) const; + ::tensorflow::NodeDef* mutable_node(int index); + ::tensorflow::NodeDef* add_node(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >* + mutable_node(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >& + node() const; + + // optional .tensorflow.VersionDef versions = 4; + bool has_versions() const; + void clear_versions(); + static const int kVersionsFieldNumber = 4; + private: + void _slow_mutable_versions(); + void _slow_set_allocated_versions( + ::google::protobuf::Arena* message_arena, ::tensorflow::VersionDef** versions); + ::tensorflow::VersionDef* _slow_release_versions(); + public: + const ::tensorflow::VersionDef& versions() const; + ::tensorflow::VersionDef* mutable_versions(); + ::tensorflow::VersionDef* release_versions(); + void set_allocated_versions(::tensorflow::VersionDef* versions); + ::tensorflow::VersionDef* unsafe_arena_release_versions(); + void unsafe_arena_set_allocated_versions( + ::tensorflow::VersionDef* versions); + + // optional int32 version = 3 [deprecated = true]; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_version(); + GOOGLE_PROTOBUF_DEPRECATED_ATTR static const int kVersionFieldNumber = 3; + GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int32 version() const; + GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value); + + // optional .tensorflow.FunctionDefLibrary library = 2; + bool has_library() const; + void clear_library(); + static const int kLibraryFieldNumber = 2; + private: + void _slow_mutable_library(); + void _slow_set_allocated_library( + ::google::protobuf::Arena* message_arena, ::tensorflow::FunctionDefLibrary** library); + ::tensorflow::FunctionDefLibrary* _slow_release_library(); + public: + const ::tensorflow::FunctionDefLibrary& library() const; + ::tensorflow::FunctionDefLibrary* mutable_library(); + ::tensorflow::FunctionDefLibrary* release_library(); + void set_allocated_library(::tensorflow::FunctionDefLibrary* library); + ::tensorflow::FunctionDefLibrary* unsafe_arena_release_library(); + void unsafe_arena_set_allocated_library( + ::tensorflow::FunctionDefLibrary* library); + + // @@protoc_insertion_point(class_scope:tensorflow.GraphDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef > node_; + ::tensorflow::VersionDef* versions_; + ::tensorflow::FunctionDefLibrary* library_; + ::google::protobuf::int32 version_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_graph_2eproto_impl(); + friend void protobuf_AddDesc_graph_2eproto_impl(); + friend void protobuf_AssignDesc_graph_2eproto(); + friend void protobuf_ShutdownFile_graph_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed GraphDef_default_instance_; + +// ------------------------------------------------------------------- + +class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.NodeDef) */ { + public: + NodeDef(); + virtual ~NodeDef(); + + NodeDef(const NodeDef& from); + + inline NodeDef& operator=(const NodeDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const NodeDef& default_instance(); + + static const NodeDef* internal_default_instance(); + + void UnsafeArenaSwap(NodeDef* other); + void Swap(NodeDef* other); + + // implements Message ---------------------------------------------- + + inline NodeDef* New() const { return New(NULL); } + + NodeDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NodeDef& from); + void MergeFrom(const NodeDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NodeDef* other); + void UnsafeMergeFrom(const NodeDef& from); + protected: + explicit NodeDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + // optional string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // optional string op = 2; + void clear_op(); + static const int kOpFieldNumber = 2; + const ::std::string& op() const; + void set_op(const ::std::string& value); + void set_op(const char* value); + void set_op(const char* value, size_t size); + ::std::string* mutable_op(); + ::std::string* release_op(); + void set_allocated_op(::std::string* op); + ::std::string* unsafe_arena_release_op(); + void unsafe_arena_set_allocated_op( + ::std::string* op); + + // repeated string input = 3; + int input_size() const; + void clear_input(); + static const int kInputFieldNumber = 3; + const ::std::string& input(int index) const; + ::std::string* mutable_input(int index); + void set_input(int index, const ::std::string& value); + void set_input(int index, const char* value); + void set_input(int index, const char* value, size_t size); + ::std::string* add_input(); + void add_input(const ::std::string& value); + void add_input(const char* value); + void add_input(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input(); + + // optional string device = 4; + void clear_device(); + static const int kDeviceFieldNumber = 4; + const ::std::string& device() const; + void set_device(const ::std::string& value); + void set_device(const char* value); + void set_device(const char* value, size_t size); + ::std::string* mutable_device(); + ::std::string* release_device(); + void set_allocated_device(::std::string* device); + ::std::string* unsafe_arena_release_device(); + void unsafe_arena_set_allocated_device( + ::std::string* device); + + // map attr = 5; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 5; + const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& + attr() const; + ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* + mutable_attr(); + + // @@protoc_insertion_point(class_scope:tensorflow.NodeDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + typedef ::google::protobuf::internal::MapEntryLite< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > + NodeDef_AttrEntry; + ::google::protobuf::internal::MapField< + ::std::string, ::tensorflow::AttrValue, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, + 0 > attr_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr op_; + ::google::protobuf::internal::ArenaStringPtr device_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_graph_2eproto_impl(); + friend void protobuf_AddDesc_graph_2eproto_impl(); + friend void protobuf_AssignDesc_graph_2eproto(); + friend void protobuf_ShutdownFile_graph_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed NodeDef_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// GraphDef + +// repeated .tensorflow.NodeDef node = 1; +inline int GraphDef::node_size() const { + return node_.size(); +} +inline void GraphDef::clear_node() { + node_.Clear(); +} +inline const ::tensorflow::NodeDef& GraphDef::node(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.node) + return node_.Get(index); +} +inline ::tensorflow::NodeDef* GraphDef::mutable_node(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.node) + return node_.Mutable(index); +} +inline ::tensorflow::NodeDef* GraphDef::add_node() { + // @@protoc_insertion_point(field_add:tensorflow.GraphDef.node) + return node_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >* +GraphDef::mutable_node() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.GraphDef.node) + return &node_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >& +GraphDef::node() const { + // @@protoc_insertion_point(field_list:tensorflow.GraphDef.node) + return node_; +} + +// optional .tensorflow.VersionDef versions = 4; +inline bool GraphDef::has_versions() const { + return this != internal_default_instance() && versions_ != NULL; +} +inline void GraphDef::clear_versions() { + if (GetArenaNoVirtual() == NULL && versions_ != NULL) delete versions_; + versions_ = NULL; +} +inline const ::tensorflow::VersionDef& GraphDef::versions() const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.versions) + return versions_ != NULL ? *versions_ + : *::tensorflow::VersionDef::internal_default_instance(); +} +inline ::tensorflow::VersionDef* GraphDef::mutable_versions() { + + if (versions_ == NULL) { + _slow_mutable_versions(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.versions) + return versions_; +} +inline ::tensorflow::VersionDef* GraphDef::release_versions() { + // @@protoc_insertion_point(field_release:tensorflow.GraphDef.versions) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_versions(); + } else { + ::tensorflow::VersionDef* temp = versions_; + versions_ = NULL; + return temp; + } +} +inline void GraphDef::set_allocated_versions(::tensorflow::VersionDef* versions) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete versions_; + } + if (versions != NULL) { + _slow_set_allocated_versions(message_arena, &versions); + } + versions_ = versions; + if (versions) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.GraphDef.versions) +} + +// optional int32 version = 3 [deprecated = true]; +inline void GraphDef::clear_version() { + version_ = 0; +} +inline ::google::protobuf::int32 GraphDef::version() const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.version) + return version_; +} +inline void GraphDef::set_version(::google::protobuf::int32 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:tensorflow.GraphDef.version) +} + +// optional .tensorflow.FunctionDefLibrary library = 2; +inline bool GraphDef::has_library() const { + return this != internal_default_instance() && library_ != NULL; +} +inline void GraphDef::clear_library() { + if (GetArenaNoVirtual() == NULL && library_ != NULL) delete library_; + library_ = NULL; +} +inline const ::tensorflow::FunctionDefLibrary& GraphDef::library() const { + // @@protoc_insertion_point(field_get:tensorflow.GraphDef.library) + return library_ != NULL ? *library_ + : *::tensorflow::FunctionDefLibrary::internal_default_instance(); +} +inline ::tensorflow::FunctionDefLibrary* GraphDef::mutable_library() { + + if (library_ == NULL) { + _slow_mutable_library(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.library) + return library_; +} +inline ::tensorflow::FunctionDefLibrary* GraphDef::release_library() { + // @@protoc_insertion_point(field_release:tensorflow.GraphDef.library) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_library(); + } else { + ::tensorflow::FunctionDefLibrary* temp = library_; + library_ = NULL; + return temp; + } +} +inline void GraphDef::set_allocated_library(::tensorflow::FunctionDefLibrary* library) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete library_; + } + if (library != NULL) { + _slow_set_allocated_library(message_arena, &library); + } + library_ = library; + if (library) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.GraphDef.library) +} + +inline const GraphDef* GraphDef::internal_default_instance() { + return &GraphDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// NodeDef + +// optional string name = 1; +inline void NodeDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NodeDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.name) +} +inline void NodeDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.name) +} +inline void NodeDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.name) +} +inline ::std::string* NodeDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.NodeDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.name) +} +inline void NodeDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.name) +} + +// optional string op = 2; +inline void NodeDef::clear_op() { + op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeDef::op() const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.op) + return op_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NodeDef::set_op(const ::std::string& value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.op) +} +inline void NodeDef::set_op(const char* value) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.op) +} +inline void NodeDef::set_op(const char* value, + size_t size) { + + op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.op) +} +inline ::std::string* NodeDef::mutable_op() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.op) + return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::release_op() { + // @@protoc_insertion_point(field_release:tensorflow.NodeDef.op) + + return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::unsafe_arena_release_op() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.op) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeDef::set_allocated_op(::std::string* op) { + if (op != NULL) { + + } else { + + } + op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.op) +} +inline void NodeDef::unsafe_arena_set_allocated_op( + ::std::string* op) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (op != NULL) { + + } else { + + } + op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + op, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.op) +} + +// repeated string input = 3; +inline int NodeDef::input_size() const { + return input_.size(); +} +inline void NodeDef::clear_input() { + input_.Clear(); +} +inline const ::std::string& NodeDef::input(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.input) + return input_.Get(index); +} +inline ::std::string* NodeDef::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.input) + return input_.Mutable(index); +} +inline void NodeDef::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.input) + input_.Mutable(index)->assign(value); +} +inline void NodeDef::set_input(int index, const char* value) { + input_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.input) +} +inline void NodeDef::set_input(int index, const char* value, size_t size) { + input_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.input) +} +inline ::std::string* NodeDef::add_input() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.NodeDef.input) + return input_.Add(); +} +inline void NodeDef::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.NodeDef.input) +} +inline void NodeDef::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.NodeDef.input) +} +inline void NodeDef::add_input(const char* value, size_t size) { + input_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.NodeDef.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NodeDef::input() const { + // @@protoc_insertion_point(field_list:tensorflow.NodeDef.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NodeDef::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.NodeDef.input) + return &input_; +} + +// optional string device = 4; +inline void NodeDef::clear_device() { + device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& NodeDef::device() const { + // @@protoc_insertion_point(field_get:tensorflow.NodeDef.device) + return device_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void NodeDef::set_device(const ::std::string& value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.NodeDef.device) +} +inline void NodeDef::set_device(const char* value) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.device) +} +inline void NodeDef::set_device(const char* value, + size_t size) { + + device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.device) +} +inline ::std::string* NodeDef::mutable_device() { + + // @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.device) + return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::release_device() { + // @@protoc_insertion_point(field_release:tensorflow.NodeDef.device) + + return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* NodeDef::unsafe_arena_release_device() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.device) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void NodeDef::set_allocated_device(::std::string* device) { + if (device != NULL) { + + } else { + + } + device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.device) +} +inline void NodeDef::unsafe_arena_set_allocated_device( + ::std::string* device) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (device != NULL) { + + } else { + + } + device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + device, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.device) +} + +// map attr = 5; +inline int NodeDef::attr_size() const { + return attr_.size(); +} +inline void NodeDef::clear_attr() { + attr_.Clear(); +} +inline const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >& +NodeDef::attr() const { + // @@protoc_insertion_point(field_map:tensorflow.NodeDef.attr) + return attr_.GetMap(); +} +inline ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >* +NodeDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_map:tensorflow.NodeDef.attr) + return attr_.MutableMap(); +} + +inline const NodeDef* NodeDef::internal_default_instance() { + return &NodeDef_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_graph_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/op_def.pb.cc b/modules/dnn/misc/tensorflow/op_def.pb.cc new file mode 100644 index 0000000000..1a9cae3cec --- /dev/null +++ b/modules/dnn/misc/tensorflow/op_def.pb.cc @@ -0,0 +1,4045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: op_def.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "op_def.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* OpDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OpDef_reflection_ = NULL; +const ::google::protobuf::Descriptor* OpDef_ArgDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OpDef_ArgDef_reflection_ = NULL; +const ::google::protobuf::Descriptor* OpDef_AttrDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OpDef_AttrDef_reflection_ = NULL; +const ::google::protobuf::Descriptor* OpDeprecation_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OpDeprecation_reflection_ = NULL; +const ::google::protobuf::Descriptor* OpList_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OpList_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_op_5fdef_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_op_5fdef_2eproto() { + protobuf_AddDesc_op_5fdef_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "op_def.proto"); + GOOGLE_CHECK(file != NULL); + OpDef_descriptor_ = file->message_type(0); + static const int OpDef_offsets_[11] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, input_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, output_arg_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, deprecation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, summary_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, is_commutative_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, is_aggregate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, is_stateful_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, allows_uninitialized_input_), + }; + OpDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + OpDef_descriptor_, + OpDef::internal_default_instance(), + OpDef_offsets_, + -1, + -1, + -1, + sizeof(OpDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef, _internal_metadata_)); + OpDef_ArgDef_descriptor_ = OpDef_descriptor_->nested_type(0); + static const int OpDef_ArgDef_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, type_attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, number_attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, type_list_attr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, is_ref_), + }; + OpDef_ArgDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + OpDef_ArgDef_descriptor_, + OpDef_ArgDef::internal_default_instance(), + OpDef_ArgDef_offsets_, + -1, + -1, + -1, + sizeof(OpDef_ArgDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_ArgDef, _internal_metadata_)); + OpDef_AttrDef_descriptor_ = OpDef_descriptor_->nested_type(1); + static const int OpDef_AttrDef_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, has_minimum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, minimum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, allowed_values_), + }; + OpDef_AttrDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + OpDef_AttrDef_descriptor_, + OpDef_AttrDef::internal_default_instance(), + OpDef_AttrDef_offsets_, + -1, + -1, + -1, + sizeof(OpDef_AttrDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDef_AttrDef, _internal_metadata_)); + OpDeprecation_descriptor_ = file->message_type(1); + static const int OpDeprecation_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDeprecation, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDeprecation, explanation_), + }; + OpDeprecation_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + OpDeprecation_descriptor_, + OpDeprecation::internal_default_instance(), + OpDeprecation_offsets_, + -1, + -1, + -1, + sizeof(OpDeprecation), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpDeprecation, _internal_metadata_)); + OpList_descriptor_ = file->message_type(2); + static const int OpList_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpList, op_), + }; + OpList_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + OpList_descriptor_, + OpList::internal_default_instance(), + OpList_offsets_, + -1, + -1, + -1, + sizeof(OpList), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OpList, _internal_metadata_)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_op_5fdef_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OpDef_descriptor_, OpDef::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OpDef_ArgDef_descriptor_, OpDef_ArgDef::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OpDef_AttrDef_descriptor_, OpDef_AttrDef::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OpDeprecation_descriptor_, OpDeprecation::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OpList_descriptor_, OpList::internal_default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_op_5fdef_2eproto() { + OpDef_default_instance_.Shutdown(); + delete OpDef_reflection_; + OpDef_ArgDef_default_instance_.Shutdown(); + delete OpDef_ArgDef_reflection_; + OpDef_AttrDef_default_instance_.Shutdown(); + delete OpDef_AttrDef_reflection_; + OpDeprecation_default_instance_.Shutdown(); + delete OpDeprecation_reflection_; + OpList_default_instance_.Shutdown(); + delete OpList_reflection_; +} + +void protobuf_InitDefaults_op_5fdef_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::tensorflow::protobuf_InitDefaults_attr_5fvalue_2eproto(); + ::tensorflow::protobuf_InitDefaults_types_2eproto(); + ::google::protobuf::internal::GetEmptyString(); + OpDef_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + OpDef_ArgDef_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + OpDef_AttrDef_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + OpDeprecation_default_instance_.DefaultConstruct(); + OpList_default_instance_.DefaultConstruct(); + OpDef_default_instance_.get_mutable()->InitAsDefaultInstance(); + OpDef_ArgDef_default_instance_.get_mutable()->InitAsDefaultInstance(); + OpDef_AttrDef_default_instance_.get_mutable()->InitAsDefaultInstance(); + OpDeprecation_default_instance_.get_mutable()->InitAsDefaultInstance(); + OpList_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_op_5fdef_2eproto_once_); +void protobuf_InitDefaults_op_5fdef_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_op_5fdef_2eproto_once_, + &protobuf_InitDefaults_op_5fdef_2eproto_impl); +} +void protobuf_AddDesc_op_5fdef_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_op_5fdef_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\014op_def.proto\022\ntensorflow\032\020attr_value.p" + "roto\032\013types.proto\"\270\005\n\005OpDef\022\014\n\004name\030\001 \001(" + "\t\022+\n\tinput_arg\030\002 \003(\0132\030.tensorflow.OpDef." + "ArgDef\022,\n\noutput_arg\030\003 \003(\0132\030.tensorflow." + "OpDef.ArgDef\022\'\n\004attr\030\004 \003(\0132\031.tensorflow." + "OpDef.AttrDef\022.\n\013deprecation\030\010 \001(\0132\031.ten" + "sorflow.OpDeprecation\022\017\n\007summary\030\005 \001(\t\022\023" + "\n\013description\030\006 \001(\t\022\026\n\016is_commutative\030\022 " + "\001(\010\022\024\n\014is_aggregate\030\020 \001(\010\022\023\n\013is_stateful" + "\030\021 \001(\010\022\"\n\032allows_uninitialized_input\030\023 \001" + "(\010\032\237\001\n\006ArgDef\022\014\n\004name\030\001 \001(\t\022\023\n\013descripti" + "on\030\002 \001(\t\022\"\n\004type\030\003 \001(\0162\024.tensorflow.Data" + "Type\022\021\n\ttype_attr\030\004 \001(\t\022\023\n\013number_attr\030\005" + " \001(\t\022\026\n\016type_list_attr\030\006 \001(\t\022\016\n\006is_ref\030\020" + " \001(\010\032\275\001\n\007AttrDef\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002" + " \001(\t\022,\n\rdefault_value\030\003 \001(\0132\025.tensorflow" + ".AttrValue\022\023\n\013description\030\004 \001(\t\022\023\n\013has_m" + "inimum\030\005 \001(\010\022\017\n\007minimum\030\006 \001(\003\022-\n\016allowed" + "_values\030\007 \001(\0132\025.tensorflow.AttrValue\"5\n\r" + "OpDeprecation\022\017\n\007version\030\001 \001(\005\022\023\n\013explan" + "ation\030\002 \001(\t\"\'\n\006OpList\022\035\n\002op\030\001 \003(\0132\021.tens" + "orflow.OpDefB,\n\030org.tensorflow.framework" + "B\013OpDefProtosP\001\370\001\001b\006proto3", 906); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "op_def.proto", &protobuf_RegisterTypes); + ::tensorflow::protobuf_AddDesc_attr_5fvalue_2eproto(); + ::tensorflow::protobuf_AddDesc_types_2eproto(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_op_5fdef_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_op_5fdef_2eproto_once_); +void protobuf_AddDesc_op_5fdef_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_op_5fdef_2eproto_once_, + &protobuf_AddDesc_op_5fdef_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_op_5fdef_2eproto { + StaticDescriptorInitializer_op_5fdef_2eproto() { + protobuf_AddDesc_op_5fdef_2eproto(); + } +} static_descriptor_initializer_op_5fdef_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDef_ArgDef::kNameFieldNumber; +const int OpDef_ArgDef::kDescriptionFieldNumber; +const int OpDef_ArgDef::kTypeFieldNumber; +const int OpDef_ArgDef::kTypeAttrFieldNumber; +const int OpDef_ArgDef::kNumberAttrFieldNumber; +const int OpDef_ArgDef::kTypeListAttrFieldNumber; +const int OpDef_ArgDef::kIsRefFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDef_ArgDef::OpDef_ArgDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_op_5fdef_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.OpDef.ArgDef) +} +OpDef_ArgDef::OpDef_ArgDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_op_5fdef_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.OpDef.ArgDef) +} + +void OpDef_ArgDef::InitAsDefaultInstance() { +} + +OpDef_ArgDef::OpDef_ArgDef(const OpDef_ArgDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.OpDef.ArgDef) +} + +void OpDef_ArgDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + number_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_list_attr_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&type_, 0, reinterpret_cast(&is_ref_) - + reinterpret_cast(&type_) + sizeof(is_ref_)); + _cached_size_ = 0; +} + +OpDef_ArgDef::~OpDef_ArgDef() { + // @@protoc_insertion_point(destructor:tensorflow.OpDef.ArgDef) + SharedDtor(); +} + +void OpDef_ArgDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + description_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + type_attr_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + number_attr_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + type_list_attr_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void OpDef_ArgDef::ArenaDtor(void* object) { + OpDef_ArgDef* _this = reinterpret_cast< OpDef_ArgDef* >(object); + (void)_this; +} +void OpDef_ArgDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDef_ArgDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OpDef_ArgDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OpDef_ArgDef_descriptor_; +} + +const OpDef_ArgDef& OpDef_ArgDef::default_instance() { + protobuf_InitDefaults_op_5fdef_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed OpDef_ArgDef_default_instance_; + +OpDef_ArgDef* OpDef_ArgDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void OpDef_ArgDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.OpDef.ArgDef) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(OpDef_ArgDef, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(type_, is_ref_); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + +#undef ZR_HELPER_ +#undef ZR_ + +} + +bool OpDef_ArgDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.OpDef.ArgDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.ArgDef.name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_description; + break; + } + + // optional string description = 2; + case 2: { + if (tag == 18) { + parse_description: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.ArgDef.description")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_type; + break; + } + + // optional .tensorflow.DataType type = 3; + case 3: { + if (tag == 24) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_type_attr; + break; + } + + // optional string type_attr = 4; + case 4: { + if (tag == 34) { + parse_type_attr: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_attr())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_attr().data(), this->type_attr().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.ArgDef.type_attr")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_number_attr; + break; + } + + // optional string number_attr = 5; + case 5: { + if (tag == 42) { + parse_number_attr: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_number_attr())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->number_attr().data(), this->number_attr().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.ArgDef.number_attr")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_type_list_attr; + break; + } + + // optional string type_list_attr = 6; + case 6: { + if (tag == 50) { + parse_type_list_attr: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_list_attr())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_list_attr().data(), this->type_list_attr().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.ArgDef.type_list_attr")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_is_ref; + break; + } + + // optional bool is_ref = 16; + case 16: { + if (tag == 128) { + parse_is_ref: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_ref_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.OpDef.ArgDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.OpDef.ArgDef) + return false; +#undef DO_ +} + +void OpDef_ArgDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.OpDef.ArgDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string description = 2; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->description(), output); + } + + // optional .tensorflow.DataType type = 3; + if (this->type() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->type(), output); + } + + // optional string type_attr = 4; + if (this->type_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_attr().data(), this->type_attr().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.type_attr"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->type_attr(), output); + } + + // optional string number_attr = 5; + if (this->number_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->number_attr().data(), this->number_attr().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.number_attr"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->number_attr(), output); + } + + // optional string type_list_attr = 6; + if (this->type_list_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_list_attr().data(), this->type_list_attr().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.type_list_attr"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->type_list_attr(), output); + } + + // optional bool is_ref = 16; + if (this->is_ref() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->is_ref(), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.OpDef.ArgDef) +} + +::google::protobuf::uint8* OpDef_ArgDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.OpDef.ArgDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string description = 2; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->description(), target); + } + + // optional .tensorflow.DataType type = 3; + if (this->type() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->type(), target); + } + + // optional string type_attr = 4; + if (this->type_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_attr().data(), this->type_attr().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.type_attr"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->type_attr(), target); + } + + // optional string number_attr = 5; + if (this->number_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->number_attr().data(), this->number_attr().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.number_attr"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->number_attr(), target); + } + + // optional string type_list_attr = 6; + if (this->type_list_attr().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type_list_attr().data(), this->type_list_attr().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.ArgDef.type_list_attr"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->type_list_attr(), target); + } + + // optional bool is_ref = 16; + if (this->is_ref() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->is_ref(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.OpDef.ArgDef) + return target; +} + +size_t OpDef_ArgDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.OpDef.ArgDef) + size_t total_size = 0; + + // optional string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string description = 2; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // optional .tensorflow.DataType type = 3; + if (this->type() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // optional string type_attr = 4; + if (this->type_attr().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_attr()); + } + + // optional string number_attr = 5; + if (this->number_attr().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->number_attr()); + } + + // optional string type_list_attr = 6; + if (this->type_list_attr().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_list_attr()); + } + + // optional bool is_ref = 16; + if (this->is_ref() != 0) { + total_size += 2 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OpDef_ArgDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.OpDef.ArgDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const OpDef_ArgDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.OpDef.ArgDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.OpDef.ArgDef) + UnsafeMergeFrom(*source); + } +} + +void OpDef_ArgDef::MergeFrom(const OpDef_ArgDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.OpDef.ArgDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void OpDef_ArgDef::UnsafeMergeFrom(const OpDef_ArgDef& from) { + GOOGLE_DCHECK(&from != this); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.type() != 0) { + set_type(from.type()); + } + if (from.type_attr().size() > 0) { + set_type_attr(from.type_attr()); + } + if (from.number_attr().size() > 0) { + set_number_attr(from.number_attr()); + } + if (from.type_list_attr().size() > 0) { + set_type_list_attr(from.type_list_attr()); + } + if (from.is_ref() != 0) { + set_is_ref(from.is_ref()); + } +} + +void OpDef_ArgDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.OpDef.ArgDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDef_ArgDef::CopyFrom(const OpDef_ArgDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.OpDef.ArgDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool OpDef_ArgDef::IsInitialized() const { + + return true; +} + +void OpDef_ArgDef::Swap(OpDef_ArgDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDef_ArgDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void OpDef_ArgDef::UnsafeArenaSwap(OpDef_ArgDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDef_ArgDef::InternalSwap(OpDef_ArgDef* other) { + name_.Swap(&other->name_); + description_.Swap(&other->description_); + std::swap(type_, other->type_); + type_attr_.Swap(&other->type_attr_); + number_attr_.Swap(&other->number_attr_); + type_list_attr_.Swap(&other->type_list_attr_); + std::swap(is_ref_, other->is_ref_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OpDef_ArgDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OpDef_ArgDef_descriptor_; + metadata.reflection = OpDef_ArgDef_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +void OpDef_AttrDef::_slow_mutable_default_value() { + default_value_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue >( + GetArenaNoVirtual()); +} +::tensorflow::AttrValue* OpDef_AttrDef::_slow_release_default_value() { + if (default_value_ == NULL) { + return NULL; + } else { + ::tensorflow::AttrValue* temp = new ::tensorflow::AttrValue(*default_value_); + default_value_ = NULL; + return temp; + } +} +::tensorflow::AttrValue* OpDef_AttrDef::unsafe_arena_release_default_value() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.default_value) + + ::tensorflow::AttrValue* temp = default_value_; + default_value_ = NULL; + return temp; +} +void OpDef_AttrDef::_slow_set_allocated_default_value( + ::google::protobuf::Arena* message_arena, ::tensorflow::AttrValue** default_value) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*default_value) == NULL) { + message_arena->Own(*default_value); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*default_value)) { + ::tensorflow::AttrValue* new_default_value = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue >( + message_arena); + new_default_value->CopyFrom(**default_value); + *default_value = new_default_value; + } +} +void OpDef_AttrDef::unsafe_arena_set_allocated_default_value( + ::tensorflow::AttrValue* default_value) { + if (GetArenaNoVirtual() == NULL) { + delete default_value_; + } + default_value_ = default_value; + if (default_value) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.default_value) +} +void OpDef_AttrDef::_slow_mutable_allowed_values() { + allowed_values_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue >( + GetArenaNoVirtual()); +} +::tensorflow::AttrValue* OpDef_AttrDef::_slow_release_allowed_values() { + if (allowed_values_ == NULL) { + return NULL; + } else { + ::tensorflow::AttrValue* temp = new ::tensorflow::AttrValue(*allowed_values_); + allowed_values_ = NULL; + return temp; + } +} +::tensorflow::AttrValue* OpDef_AttrDef::unsafe_arena_release_allowed_values() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.allowed_values) + + ::tensorflow::AttrValue* temp = allowed_values_; + allowed_values_ = NULL; + return temp; +} +void OpDef_AttrDef::_slow_set_allocated_allowed_values( + ::google::protobuf::Arena* message_arena, ::tensorflow::AttrValue** allowed_values) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*allowed_values) == NULL) { + message_arena->Own(*allowed_values); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*allowed_values)) { + ::tensorflow::AttrValue* new_allowed_values = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::AttrValue >( + message_arena); + new_allowed_values->CopyFrom(**allowed_values); + *allowed_values = new_allowed_values; + } +} +void OpDef_AttrDef::unsafe_arena_set_allocated_allowed_values( + ::tensorflow::AttrValue* allowed_values) { + if (GetArenaNoVirtual() == NULL) { + delete allowed_values_; + } + allowed_values_ = allowed_values; + if (allowed_values) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.allowed_values) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDef_AttrDef::kNameFieldNumber; +const int OpDef_AttrDef::kTypeFieldNumber; +const int OpDef_AttrDef::kDefaultValueFieldNumber; +const int OpDef_AttrDef::kDescriptionFieldNumber; +const int OpDef_AttrDef::kHasMinimumFieldNumber; +const int OpDef_AttrDef::kMinimumFieldNumber; +const int OpDef_AttrDef::kAllowedValuesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDef_AttrDef::OpDef_AttrDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_op_5fdef_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.OpDef.AttrDef) +} +OpDef_AttrDef::OpDef_AttrDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_op_5fdef_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.OpDef.AttrDef) +} + +void OpDef_AttrDef::InitAsDefaultInstance() { + default_value_ = const_cast< ::tensorflow::AttrValue*>( + ::tensorflow::AttrValue::internal_default_instance()); + allowed_values_ = const_cast< ::tensorflow::AttrValue*>( + ::tensorflow::AttrValue::internal_default_instance()); +} + +OpDef_AttrDef::OpDef_AttrDef(const OpDef_AttrDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.OpDef.AttrDef) +} + +void OpDef_AttrDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_ = NULL; + allowed_values_ = NULL; + ::memset(&minimum_, 0, reinterpret_cast(&has_minimum_) - + reinterpret_cast(&minimum_) + sizeof(has_minimum_)); + _cached_size_ = 0; +} + +OpDef_AttrDef::~OpDef_AttrDef() { + // @@protoc_insertion_point(destructor:tensorflow.OpDef.AttrDef) + SharedDtor(); +} + +void OpDef_AttrDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + type_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + description_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + if (this != &OpDef_AttrDef_default_instance_.get()) { + delete default_value_; + delete allowed_values_; + } +} + +void OpDef_AttrDef::ArenaDtor(void* object) { + OpDef_AttrDef* _this = reinterpret_cast< OpDef_AttrDef* >(object); + (void)_this; +} +void OpDef_AttrDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDef_AttrDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OpDef_AttrDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OpDef_AttrDef_descriptor_; +} + +const OpDef_AttrDef& OpDef_AttrDef::default_instance() { + protobuf_InitDefaults_op_5fdef_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed OpDef_AttrDef_default_instance_; + +OpDef_AttrDef* OpDef_AttrDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void OpDef_AttrDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.OpDef.AttrDef) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(OpDef_AttrDef, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(minimum_, has_minimum_); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) delete default_value_; + default_value_ = NULL; + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) delete allowed_values_; + allowed_values_ = NULL; + +#undef ZR_HELPER_ +#undef ZR_ + +} + +bool OpDef_AttrDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.OpDef.AttrDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.AttrDef.name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_type; + break; + } + + // optional string type = 2; + case 2: { + if (tag == 18) { + parse_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.AttrDef.type")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_default_value; + break; + } + + // optional .tensorflow.AttrValue default_value = 3; + case 3: { + if (tag == 26) { + parse_default_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_default_value())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_description; + break; + } + + // optional string description = 4; + case 4: { + if (tag == 34) { + parse_description: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.AttrDef.description")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_has_minimum; + break; + } + + // optional bool has_minimum = 5; + case 5: { + if (tag == 40) { + parse_has_minimum: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &has_minimum_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_minimum; + break; + } + + // optional int64 minimum = 6; + case 6: { + if (tag == 48) { + parse_minimum: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &minimum_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_allowed_values; + break; + } + + // optional .tensorflow.AttrValue allowed_values = 7; + case 7: { + if (tag == 58) { + parse_allowed_values: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_allowed_values())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.OpDef.AttrDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.OpDef.AttrDef) + return false; +#undef DO_ +} + +void OpDef_AttrDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.OpDef.AttrDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.AttrDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (this->type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.AttrDef.type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->type(), output); + } + + // optional .tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->default_value_, output); + } + + // optional string description = 4; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.AttrDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->description(), output); + } + + // optional bool has_minimum = 5; + if (this->has_minimum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->has_minimum(), output); + } + + // optional int64 minimum = 6; + if (this->minimum() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->minimum(), output); + } + + // optional .tensorflow.AttrValue allowed_values = 7; + if (this->has_allowed_values()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *this->allowed_values_, output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.OpDef.AttrDef) +} + +::google::protobuf::uint8* OpDef_AttrDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.OpDef.AttrDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.AttrDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string type = 2; + if (this->type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->type().data(), this->type().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.AttrDef.type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->type(), target); + } + + // optional .tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, *this->default_value_, false, target); + } + + // optional string description = 4; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.AttrDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->description(), target); + } + + // optional bool has_minimum = 5; + if (this->has_minimum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->has_minimum(), target); + } + + // optional int64 minimum = 6; + if (this->minimum() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->minimum(), target); + } + + // optional .tensorflow.AttrValue allowed_values = 7; + if (this->has_allowed_values()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 7, *this->allowed_values_, false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.OpDef.AttrDef) + return target; +} + +size_t OpDef_AttrDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.OpDef.AttrDef) + size_t total_size = 0; + + // optional string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string type = 2; + if (this->type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + + // optional .tensorflow.AttrValue default_value = 3; + if (this->has_default_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->default_value_); + } + + // optional string description = 4; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // optional bool has_minimum = 5; + if (this->has_minimum() != 0) { + total_size += 1 + 1; + } + + // optional int64 minimum = 6; + if (this->minimum() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->minimum()); + } + + // optional .tensorflow.AttrValue allowed_values = 7; + if (this->has_allowed_values()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->allowed_values_); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OpDef_AttrDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.OpDef.AttrDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const OpDef_AttrDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.OpDef.AttrDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.OpDef.AttrDef) + UnsafeMergeFrom(*source); + } +} + +void OpDef_AttrDef::MergeFrom(const OpDef_AttrDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.OpDef.AttrDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void OpDef_AttrDef::UnsafeMergeFrom(const OpDef_AttrDef& from) { + GOOGLE_DCHECK(&from != this); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.type().size() > 0) { + set_type(from.type()); + } + if (from.has_default_value()) { + mutable_default_value()->::tensorflow::AttrValue::MergeFrom(from.default_value()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.has_minimum() != 0) { + set_has_minimum(from.has_minimum()); + } + if (from.minimum() != 0) { + set_minimum(from.minimum()); + } + if (from.has_allowed_values()) { + mutable_allowed_values()->::tensorflow::AttrValue::MergeFrom(from.allowed_values()); + } +} + +void OpDef_AttrDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.OpDef.AttrDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDef_AttrDef::CopyFrom(const OpDef_AttrDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.OpDef.AttrDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool OpDef_AttrDef::IsInitialized() const { + + return true; +} + +void OpDef_AttrDef::Swap(OpDef_AttrDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDef_AttrDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void OpDef_AttrDef::UnsafeArenaSwap(OpDef_AttrDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDef_AttrDef::InternalSwap(OpDef_AttrDef* other) { + name_.Swap(&other->name_); + type_.Swap(&other->type_); + std::swap(default_value_, other->default_value_); + description_.Swap(&other->description_); + std::swap(has_minimum_, other->has_minimum_); + std::swap(minimum_, other->minimum_); + std::swap(allowed_values_, other->allowed_values_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OpDef_AttrDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OpDef_AttrDef_descriptor_; + metadata.reflection = OpDef_AttrDef_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +void OpDef::_slow_mutable_deprecation() { + deprecation_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::OpDeprecation >( + GetArenaNoVirtual()); +} +::tensorflow::OpDeprecation* OpDef::_slow_release_deprecation() { + if (deprecation_ == NULL) { + return NULL; + } else { + ::tensorflow::OpDeprecation* temp = new ::tensorflow::OpDeprecation(*deprecation_); + deprecation_ = NULL; + return temp; + } +} +::tensorflow::OpDeprecation* OpDef::unsafe_arena_release_deprecation() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.deprecation) + + ::tensorflow::OpDeprecation* temp = deprecation_; + deprecation_ = NULL; + return temp; +} +void OpDef::_slow_set_allocated_deprecation( + ::google::protobuf::Arena* message_arena, ::tensorflow::OpDeprecation** deprecation) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*deprecation) == NULL) { + message_arena->Own(*deprecation); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*deprecation)) { + ::tensorflow::OpDeprecation* new_deprecation = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::OpDeprecation >( + message_arena); + new_deprecation->CopyFrom(**deprecation); + *deprecation = new_deprecation; + } +} +void OpDef::unsafe_arena_set_allocated_deprecation( + ::tensorflow::OpDeprecation* deprecation) { + if (GetArenaNoVirtual() == NULL) { + delete deprecation_; + } + deprecation_ = deprecation; + if (deprecation) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.deprecation) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDef::kNameFieldNumber; +const int OpDef::kInputArgFieldNumber; +const int OpDef::kOutputArgFieldNumber; +const int OpDef::kAttrFieldNumber; +const int OpDef::kDeprecationFieldNumber; +const int OpDef::kSummaryFieldNumber; +const int OpDef::kDescriptionFieldNumber; +const int OpDef::kIsCommutativeFieldNumber; +const int OpDef::kIsAggregateFieldNumber; +const int OpDef::kIsStatefulFieldNumber; +const int OpDef::kAllowsUninitializedInputFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDef::OpDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_op_5fdef_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.OpDef) +} +OpDef::OpDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + input_arg_(arena), + output_arg_(arena), + attr_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_op_5fdef_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.OpDef) +} + +void OpDef::InitAsDefaultInstance() { + deprecation_ = const_cast< ::tensorflow::OpDeprecation*>( + ::tensorflow::OpDeprecation::internal_default_instance()); +} + +OpDef::OpDef(const OpDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.OpDef) +} + +void OpDef::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + summary_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + deprecation_ = NULL; + ::memset(&is_commutative_, 0, reinterpret_cast(&allows_uninitialized_input_) - + reinterpret_cast(&is_commutative_) + sizeof(allows_uninitialized_input_)); + _cached_size_ = 0; +} + +OpDef::~OpDef() { + // @@protoc_insertion_point(destructor:tensorflow.OpDef) + SharedDtor(); +} + +void OpDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + summary_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + description_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + if (this != &OpDef_default_instance_.get()) { + delete deprecation_; + } +} + +void OpDef::ArenaDtor(void* object) { + OpDef* _this = reinterpret_cast< OpDef* >(object); + (void)_this; +} +void OpDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OpDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OpDef_descriptor_; +} + +const OpDef& OpDef::default_instance() { + protobuf_InitDefaults_op_5fdef_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed OpDef_default_instance_; + +OpDef* OpDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void OpDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.OpDef) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(OpDef, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) delete deprecation_; + deprecation_ = NULL; + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + is_commutative_ = false; + ZR_(is_aggregate_, allows_uninitialized_input_); + +#undef ZR_HELPER_ +#undef ZR_ + + input_arg_.Clear(); + output_arg_.Clear(); + attr_.Clear(); +} + +bool OpDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.OpDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_input_arg; + break; + } + + // repeated .tensorflow.OpDef.ArgDef input_arg = 2; + case 2: { + if (tag == 18) { + parse_input_arg: + DO_(input->IncrementRecursionDepth()); + parse_loop_input_arg: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_input_arg())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_input_arg; + if (input->ExpectTag(26)) goto parse_loop_output_arg; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .tensorflow.OpDef.ArgDef output_arg = 3; + case 3: { + if (tag == 26) { + DO_(input->IncrementRecursionDepth()); + parse_loop_output_arg: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_output_arg())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_loop_output_arg; + if (input->ExpectTag(34)) goto parse_loop_attr; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .tensorflow.OpDef.AttrDef attr = 4; + case 4: { + if (tag == 34) { + DO_(input->IncrementRecursionDepth()); + parse_loop_attr: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_attr())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_loop_attr; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(42)) goto parse_summary; + break; + } + + // optional string summary = 5; + case 5: { + if (tag == 42) { + parse_summary: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_summary())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), this->summary().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.summary")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_description; + break; + } + + // optional string description = 6; + case 6: { + if (tag == 50) { + parse_description: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDef.description")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_deprecation; + break; + } + + // optional .tensorflow.OpDeprecation deprecation = 8; + case 8: { + if (tag == 66) { + parse_deprecation: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_deprecation())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_is_aggregate; + break; + } + + // optional bool is_aggregate = 16; + case 16: { + if (tag == 128) { + parse_is_aggregate: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_aggregate_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_is_stateful; + break; + } + + // optional bool is_stateful = 17; + case 17: { + if (tag == 136) { + parse_is_stateful: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_stateful_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_is_commutative; + break; + } + + // optional bool is_commutative = 18; + case 18: { + if (tag == 144) { + parse_is_commutative: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_commutative_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_allows_uninitialized_input; + break; + } + + // optional bool allows_uninitialized_input = 19; + case 19: { + if (tag == 152) { + parse_allows_uninitialized_input: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &allows_uninitialized_input_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.OpDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.OpDef) + return false; +#undef DO_ +} + +void OpDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.OpDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .tensorflow.OpDef.ArgDef input_arg = 2; + for (unsigned int i = 0, n = this->input_arg_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->input_arg(i), output); + } + + // repeated .tensorflow.OpDef.ArgDef output_arg = 3; + for (unsigned int i = 0, n = this->output_arg_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->output_arg(i), output); + } + + // repeated .tensorflow.OpDef.AttrDef attr = 4; + for (unsigned int i = 0, n = this->attr_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->attr(i), output); + } + + // optional string summary = 5; + if (this->summary().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), this->summary().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.summary"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->summary(), output); + } + + // optional string description = 6; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->description(), output); + } + + // optional .tensorflow.OpDeprecation deprecation = 8; + if (this->has_deprecation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *this->deprecation_, output); + } + + // optional bool is_aggregate = 16; + if (this->is_aggregate() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->is_aggregate(), output); + } + + // optional bool is_stateful = 17; + if (this->is_stateful() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->is_stateful(), output); + } + + // optional bool is_commutative = 18; + if (this->is_commutative() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->is_commutative(), output); + } + + // optional bool allows_uninitialized_input = 19; + if (this->allows_uninitialized_input() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->allows_uninitialized_input(), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.OpDef) +} + +::google::protobuf::uint8* OpDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.OpDef) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .tensorflow.OpDef.ArgDef input_arg = 2; + for (unsigned int i = 0, n = this->input_arg_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, this->input_arg(i), false, target); + } + + // repeated .tensorflow.OpDef.ArgDef output_arg = 3; + for (unsigned int i = 0, n = this->output_arg_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 3, this->output_arg(i), false, target); + } + + // repeated .tensorflow.OpDef.AttrDef attr = 4; + for (unsigned int i = 0, n = this->attr_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 4, this->attr(i), false, target); + } + + // optional string summary = 5; + if (this->summary().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->summary().data(), this->summary().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.summary"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->summary(), target); + } + + // optional string description = 6; + if (this->description().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->description().data(), this->description().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDef.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->description(), target); + } + + // optional .tensorflow.OpDeprecation deprecation = 8; + if (this->has_deprecation()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 8, *this->deprecation_, false, target); + } + + // optional bool is_aggregate = 16; + if (this->is_aggregate() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->is_aggregate(), target); + } + + // optional bool is_stateful = 17; + if (this->is_stateful() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->is_stateful(), target); + } + + // optional bool is_commutative = 18; + if (this->is_commutative() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->is_commutative(), target); + } + + // optional bool allows_uninitialized_input = 19; + if (this->allows_uninitialized_input() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->allows_uninitialized_input(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.OpDef) + return target; +} + +size_t OpDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.OpDef) + size_t total_size = 0; + + // optional string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .tensorflow.OpDeprecation deprecation = 8; + if (this->has_deprecation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->deprecation_); + } + + // optional string summary = 5; + if (this->summary().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->summary()); + } + + // optional string description = 6; + if (this->description().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // optional bool is_commutative = 18; + if (this->is_commutative() != 0) { + total_size += 2 + 1; + } + + // optional bool is_aggregate = 16; + if (this->is_aggregate() != 0) { + total_size += 2 + 1; + } + + // optional bool is_stateful = 17; + if (this->is_stateful() != 0) { + total_size += 2 + 1; + } + + // optional bool allows_uninitialized_input = 19; + if (this->allows_uninitialized_input() != 0) { + total_size += 2 + 1; + } + + // repeated .tensorflow.OpDef.ArgDef input_arg = 2; + { + unsigned int count = this->input_arg_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_arg(i)); + } + } + + // repeated .tensorflow.OpDef.ArgDef output_arg = 3; + { + unsigned int count = this->output_arg_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->output_arg(i)); + } + } + + // repeated .tensorflow.OpDef.AttrDef attr = 4; + { + unsigned int count = this->attr_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->attr(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OpDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.OpDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const OpDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.OpDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.OpDef) + UnsafeMergeFrom(*source); + } +} + +void OpDef::MergeFrom(const OpDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.OpDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void OpDef::UnsafeMergeFrom(const OpDef& from) { + GOOGLE_DCHECK(&from != this); + input_arg_.MergeFrom(from.input_arg_); + output_arg_.MergeFrom(from.output_arg_); + attr_.MergeFrom(from.attr_); + if (from.name().size() > 0) { + set_name(from.name()); + } + if (from.has_deprecation()) { + mutable_deprecation()->::tensorflow::OpDeprecation::MergeFrom(from.deprecation()); + } + if (from.summary().size() > 0) { + set_summary(from.summary()); + } + if (from.description().size() > 0) { + set_description(from.description()); + } + if (from.is_commutative() != 0) { + set_is_commutative(from.is_commutative()); + } + if (from.is_aggregate() != 0) { + set_is_aggregate(from.is_aggregate()); + } + if (from.is_stateful() != 0) { + set_is_stateful(from.is_stateful()); + } + if (from.allows_uninitialized_input() != 0) { + set_allows_uninitialized_input(from.allows_uninitialized_input()); + } +} + +void OpDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.OpDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDef::CopyFrom(const OpDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.OpDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool OpDef::IsInitialized() const { + + return true; +} + +void OpDef::Swap(OpDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void OpDef::UnsafeArenaSwap(OpDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDef::InternalSwap(OpDef* other) { + name_.Swap(&other->name_); + input_arg_.UnsafeArenaSwap(&other->input_arg_); + output_arg_.UnsafeArenaSwap(&other->output_arg_); + attr_.UnsafeArenaSwap(&other->attr_); + std::swap(deprecation_, other->deprecation_); + summary_.Swap(&other->summary_); + description_.Swap(&other->description_); + std::swap(is_commutative_, other->is_commutative_); + std::swap(is_aggregate_, other->is_aggregate_); + std::swap(is_stateful_, other->is_stateful_); + std::swap(allows_uninitialized_input_, other->allows_uninitialized_input_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OpDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OpDef_descriptor_; + metadata.reflection = OpDef_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// OpDef_ArgDef + +// optional string name = 1; +void OpDef_ArgDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_ArgDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_ArgDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.name) +} +void OpDef_ArgDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.name) +} +void OpDef_ArgDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.name) +} +::std::string* OpDef_ArgDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_ArgDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.name) +} +void OpDef_ArgDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.name) +} + +// optional string description = 2; +void OpDef_ArgDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_ArgDef::description() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.description) + return description_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_ArgDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.description) +} +void OpDef_ArgDef::set_description(const char* value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.description) +} +void OpDef_ArgDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.description) +} +::std::string* OpDef_ArgDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::release_description() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_ArgDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.description) +} +void OpDef_ArgDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.description) +} + +// optional .tensorflow.DataType type = 3; +void OpDef_ArgDef::clear_type() { + type_ = 0; +} +::tensorflow::DataType OpDef_ArgDef::type() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.type) + return static_cast< ::tensorflow::DataType >(type_); +} +void OpDef_ArgDef::set_type(::tensorflow::DataType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.type) +} + +// optional string type_attr = 4; +void OpDef_ArgDef::clear_type_attr() { + type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_ArgDef::type_attr() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.type_attr) + return type_attr_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_ArgDef::set_type_attr(const ::std::string& value) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.type_attr) +} +void OpDef_ArgDef::set_type_attr(const char* value) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.type_attr) +} +void OpDef_ArgDef::set_type_attr(const char* value, + size_t size) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.type_attr) +} +::std::string* OpDef_ArgDef::mutable_type_attr() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.type_attr) + return type_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::release_type_attr() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.type_attr) + + return type_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::unsafe_arena_release_type_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.type_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_ArgDef::set_allocated_type_attr(::std::string* type_attr) { + if (type_attr != NULL) { + + } else { + + } + type_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.type_attr) +} +void OpDef_ArgDef::unsafe_arena_set_allocated_type_attr( + ::std::string* type_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_attr != NULL) { + + } else { + + } + type_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.type_attr) +} + +// optional string number_attr = 5; +void OpDef_ArgDef::clear_number_attr() { + number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_ArgDef::number_attr() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.number_attr) + return number_attr_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_ArgDef::set_number_attr(const ::std::string& value) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.number_attr) +} +void OpDef_ArgDef::set_number_attr(const char* value) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.number_attr) +} +void OpDef_ArgDef::set_number_attr(const char* value, + size_t size) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.number_attr) +} +::std::string* OpDef_ArgDef::mutable_number_attr() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.number_attr) + return number_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::release_number_attr() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.number_attr) + + return number_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::unsafe_arena_release_number_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.number_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return number_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_ArgDef::set_allocated_number_attr(::std::string* number_attr) { + if (number_attr != NULL) { + + } else { + + } + number_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), number_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.number_attr) +} +void OpDef_ArgDef::unsafe_arena_set_allocated_number_attr( + ::std::string* number_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (number_attr != NULL) { + + } else { + + } + number_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + number_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.number_attr) +} + +// optional string type_list_attr = 6; +void OpDef_ArgDef::clear_type_list_attr() { + type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_ArgDef::type_list_attr() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.type_list_attr) + return type_list_attr_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_ArgDef::set_type_list_attr(const ::std::string& value) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.type_list_attr) +} +void OpDef_ArgDef::set_type_list_attr(const char* value) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.type_list_attr) +} +void OpDef_ArgDef::set_type_list_attr(const char* value, + size_t size) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.type_list_attr) +} +::std::string* OpDef_ArgDef::mutable_type_list_attr() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.type_list_attr) + return type_list_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::release_type_list_attr() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.type_list_attr) + + return type_list_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_ArgDef::unsafe_arena_release_type_list_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.type_list_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_list_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_ArgDef::set_allocated_type_list_attr(::std::string* type_list_attr) { + if (type_list_attr != NULL) { + + } else { + + } + type_list_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_list_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.type_list_attr) +} +void OpDef_ArgDef::unsafe_arena_set_allocated_type_list_attr( + ::std::string* type_list_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_list_attr != NULL) { + + } else { + + } + type_list_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_list_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.type_list_attr) +} + +// optional bool is_ref = 16; +void OpDef_ArgDef::clear_is_ref() { + is_ref_ = false; +} +bool OpDef_ArgDef::is_ref() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.is_ref) + return is_ref_; +} +void OpDef_ArgDef::set_is_ref(bool value) { + + is_ref_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.is_ref) +} + +inline const OpDef_ArgDef* OpDef_ArgDef::internal_default_instance() { + return &OpDef_ArgDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// OpDef_AttrDef + +// optional string name = 1; +void OpDef_AttrDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_AttrDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_AttrDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.name) +} +void OpDef_AttrDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.AttrDef.name) +} +void OpDef_AttrDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.AttrDef.name) +} +::std::string* OpDef_AttrDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_AttrDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_AttrDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_AttrDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.name) +} +void OpDef_AttrDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.name) +} + +// optional string type = 2; +void OpDef_AttrDef::clear_type() { + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_AttrDef::type() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.type) + return type_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_AttrDef::set_type(const ::std::string& value) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.type) +} +void OpDef_AttrDef::set_type(const char* value) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.AttrDef.type) +} +void OpDef_AttrDef::set_type(const char* value, + size_t size) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.AttrDef.type) +} +::std::string* OpDef_AttrDef::mutable_type() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.type) + return type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_AttrDef::release_type() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.type) + + return type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_AttrDef::unsafe_arena_release_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_AttrDef::set_allocated_type(::std::string* type) { + if (type != NULL) { + + } else { + + } + type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.type) +} +void OpDef_AttrDef::unsafe_arena_set_allocated_type( + ::std::string* type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type != NULL) { + + } else { + + } + type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.type) +} + +// optional .tensorflow.AttrValue default_value = 3; +bool OpDef_AttrDef::has_default_value() const { + return this != internal_default_instance() && default_value_ != NULL; +} +void OpDef_AttrDef::clear_default_value() { + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) delete default_value_; + default_value_ = NULL; +} +const ::tensorflow::AttrValue& OpDef_AttrDef::default_value() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.default_value) + return default_value_ != NULL ? *default_value_ + : *::tensorflow::AttrValue::internal_default_instance(); +} +::tensorflow::AttrValue* OpDef_AttrDef::mutable_default_value() { + + if (default_value_ == NULL) { + _slow_mutable_default_value(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.default_value) + return default_value_; +} +::tensorflow::AttrValue* OpDef_AttrDef::release_default_value() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.default_value) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_default_value(); + } else { + ::tensorflow::AttrValue* temp = default_value_; + default_value_ = NULL; + return temp; + } +} + void OpDef_AttrDef::set_allocated_default_value(::tensorflow::AttrValue* default_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete default_value_; + } + if (default_value != NULL) { + _slow_set_allocated_default_value(message_arena, &default_value); + } + default_value_ = default_value; + if (default_value) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.default_value) +} + +// optional string description = 4; +void OpDef_AttrDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef_AttrDef::description() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.description) + return description_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef_AttrDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.description) +} +void OpDef_AttrDef::set_description(const char* value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.AttrDef.description) +} +void OpDef_AttrDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.AttrDef.description) +} +::std::string* OpDef_AttrDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_AttrDef::release_description() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef_AttrDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef_AttrDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.description) +} +void OpDef_AttrDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.description) +} + +// optional bool has_minimum = 5; +void OpDef_AttrDef::clear_has_minimum() { + has_minimum_ = false; +} +bool OpDef_AttrDef::has_minimum() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.has_minimum) + return has_minimum_; +} +void OpDef_AttrDef::set_has_minimum(bool value) { + + has_minimum_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.has_minimum) +} + +// optional int64 minimum = 6; +void OpDef_AttrDef::clear_minimum() { + minimum_ = GOOGLE_LONGLONG(0); +} +::google::protobuf::int64 OpDef_AttrDef::minimum() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.minimum) + return minimum_; +} +void OpDef_AttrDef::set_minimum(::google::protobuf::int64 value) { + + minimum_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.minimum) +} + +// optional .tensorflow.AttrValue allowed_values = 7; +bool OpDef_AttrDef::has_allowed_values() const { + return this != internal_default_instance() && allowed_values_ != NULL; +} +void OpDef_AttrDef::clear_allowed_values() { + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) delete allowed_values_; + allowed_values_ = NULL; +} +const ::tensorflow::AttrValue& OpDef_AttrDef::allowed_values() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.allowed_values) + return allowed_values_ != NULL ? *allowed_values_ + : *::tensorflow::AttrValue::internal_default_instance(); +} +::tensorflow::AttrValue* OpDef_AttrDef::mutable_allowed_values() { + + if (allowed_values_ == NULL) { + _slow_mutable_allowed_values(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.allowed_values) + return allowed_values_; +} +::tensorflow::AttrValue* OpDef_AttrDef::release_allowed_values() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.allowed_values) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_allowed_values(); + } else { + ::tensorflow::AttrValue* temp = allowed_values_; + allowed_values_ = NULL; + return temp; + } +} + void OpDef_AttrDef::set_allocated_allowed_values(::tensorflow::AttrValue* allowed_values) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete allowed_values_; + } + if (allowed_values != NULL) { + _slow_set_allocated_allowed_values(message_arena, &allowed_values); + } + allowed_values_ = allowed_values; + if (allowed_values) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.allowed_values) +} + +inline const OpDef_AttrDef* OpDef_AttrDef::internal_default_instance() { + return &OpDef_AttrDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// OpDef + +// optional string name = 1; +void OpDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.name) +} +void OpDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.name) +} +void OpDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.name) +} +::std::string* OpDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.name) +} +void OpDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.name) +} + +// repeated .tensorflow.OpDef.ArgDef input_arg = 2; +int OpDef::input_arg_size() const { + return input_arg_.size(); +} +void OpDef::clear_input_arg() { + input_arg_.Clear(); +} +const ::tensorflow::OpDef_ArgDef& OpDef::input_arg(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.input_arg) + return input_arg_.Get(index); +} +::tensorflow::OpDef_ArgDef* OpDef::mutable_input_arg(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.input_arg) + return input_arg_.Mutable(index); +} +::tensorflow::OpDef_ArgDef* OpDef::add_input_arg() { + // @@protoc_insertion_point(field_add:tensorflow.OpDef.input_arg) + return input_arg_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >* +OpDef::mutable_input_arg() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpDef.input_arg) + return &input_arg_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >& +OpDef::input_arg() const { + // @@protoc_insertion_point(field_list:tensorflow.OpDef.input_arg) + return input_arg_; +} + +// repeated .tensorflow.OpDef.ArgDef output_arg = 3; +int OpDef::output_arg_size() const { + return output_arg_.size(); +} +void OpDef::clear_output_arg() { + output_arg_.Clear(); +} +const ::tensorflow::OpDef_ArgDef& OpDef::output_arg(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.output_arg) + return output_arg_.Get(index); +} +::tensorflow::OpDef_ArgDef* OpDef::mutable_output_arg(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.output_arg) + return output_arg_.Mutable(index); +} +::tensorflow::OpDef_ArgDef* OpDef::add_output_arg() { + // @@protoc_insertion_point(field_add:tensorflow.OpDef.output_arg) + return output_arg_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >* +OpDef::mutable_output_arg() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpDef.output_arg) + return &output_arg_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >& +OpDef::output_arg() const { + // @@protoc_insertion_point(field_list:tensorflow.OpDef.output_arg) + return output_arg_; +} + +// repeated .tensorflow.OpDef.AttrDef attr = 4; +int OpDef::attr_size() const { + return attr_.size(); +} +void OpDef::clear_attr() { + attr_.Clear(); +} +const ::tensorflow::OpDef_AttrDef& OpDef::attr(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.attr) + return attr_.Get(index); +} +::tensorflow::OpDef_AttrDef* OpDef::mutable_attr(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.attr) + return attr_.Mutable(index); +} +::tensorflow::OpDef_AttrDef* OpDef::add_attr() { + // @@protoc_insertion_point(field_add:tensorflow.OpDef.attr) + return attr_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef >* +OpDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpDef.attr) + return &attr_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef >& +OpDef::attr() const { + // @@protoc_insertion_point(field_list:tensorflow.OpDef.attr) + return attr_; +} + +// optional .tensorflow.OpDeprecation deprecation = 8; +bool OpDef::has_deprecation() const { + return this != internal_default_instance() && deprecation_ != NULL; +} +void OpDef::clear_deprecation() { + if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) delete deprecation_; + deprecation_ = NULL; +} +const ::tensorflow::OpDeprecation& OpDef::deprecation() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.deprecation) + return deprecation_ != NULL ? *deprecation_ + : *::tensorflow::OpDeprecation::internal_default_instance(); +} +::tensorflow::OpDeprecation* OpDef::mutable_deprecation() { + + if (deprecation_ == NULL) { + _slow_mutable_deprecation(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.deprecation) + return deprecation_; +} +::tensorflow::OpDeprecation* OpDef::release_deprecation() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.deprecation) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_deprecation(); + } else { + ::tensorflow::OpDeprecation* temp = deprecation_; + deprecation_ = NULL; + return temp; + } +} + void OpDef::set_allocated_deprecation(::tensorflow::OpDeprecation* deprecation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete deprecation_; + } + if (deprecation != NULL) { + _slow_set_allocated_deprecation(message_arena, &deprecation); + } + deprecation_ = deprecation; + if (deprecation) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.deprecation) +} + +// optional string summary = 5; +void OpDef::clear_summary() { + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef::summary() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.summary) + return summary_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef::set_summary(const ::std::string& value) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.summary) +} +void OpDef::set_summary(const char* value) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.summary) +} +void OpDef::set_summary(const char* value, + size_t size) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.summary) +} +::std::string* OpDef::mutable_summary() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.summary) + return summary_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef::release_summary() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.summary) + + return summary_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef::unsafe_arena_release_summary() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.summary) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return summary_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef::set_allocated_summary(::std::string* summary) { + if (summary != NULL) { + + } else { + + } + summary_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), summary, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.summary) +} +void OpDef::unsafe_arena_set_allocated_summary( + ::std::string* summary) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (summary != NULL) { + + } else { + + } + summary_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + summary, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.summary) +} + +// optional string description = 6; +void OpDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDef::description() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.description) + return description_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.description) +} +void OpDef::set_description(const char* value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.description) +} +void OpDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.description) +} +::std::string* OpDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef::release_description() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.description) +} +void OpDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.description) +} + +// optional bool is_commutative = 18; +void OpDef::clear_is_commutative() { + is_commutative_ = false; +} +bool OpDef::is_commutative() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.is_commutative) + return is_commutative_; +} +void OpDef::set_is_commutative(bool value) { + + is_commutative_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.is_commutative) +} + +// optional bool is_aggregate = 16; +void OpDef::clear_is_aggregate() { + is_aggregate_ = false; +} +bool OpDef::is_aggregate() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.is_aggregate) + return is_aggregate_; +} +void OpDef::set_is_aggregate(bool value) { + + is_aggregate_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.is_aggregate) +} + +// optional bool is_stateful = 17; +void OpDef::clear_is_stateful() { + is_stateful_ = false; +} +bool OpDef::is_stateful() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.is_stateful) + return is_stateful_; +} +void OpDef::set_is_stateful(bool value) { + + is_stateful_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.is_stateful) +} + +// optional bool allows_uninitialized_input = 19; +void OpDef::clear_allows_uninitialized_input() { + allows_uninitialized_input_ = false; +} +bool OpDef::allows_uninitialized_input() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.allows_uninitialized_input) + return allows_uninitialized_input_; +} +void OpDef::set_allows_uninitialized_input(bool value) { + + allows_uninitialized_input_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.allows_uninitialized_input) +} + +inline const OpDef* OpDef::internal_default_instance() { + return &OpDef_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpDeprecation::kVersionFieldNumber; +const int OpDeprecation::kExplanationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpDeprecation::OpDeprecation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_op_5fdef_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.OpDeprecation) +} +OpDeprecation::OpDeprecation(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_op_5fdef_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.OpDeprecation) +} + +void OpDeprecation::InitAsDefaultInstance() { +} + +OpDeprecation::OpDeprecation(const OpDeprecation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.OpDeprecation) +} + +void OpDeprecation::SharedCtor() { + explanation_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + version_ = 0; + _cached_size_ = 0; +} + +OpDeprecation::~OpDeprecation() { + // @@protoc_insertion_point(destructor:tensorflow.OpDeprecation) + SharedDtor(); +} + +void OpDeprecation::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + explanation_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void OpDeprecation::ArenaDtor(void* object) { + OpDeprecation* _this = reinterpret_cast< OpDeprecation* >(object); + (void)_this; +} +void OpDeprecation::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpDeprecation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OpDeprecation::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OpDeprecation_descriptor_; +} + +const OpDeprecation& OpDeprecation::default_instance() { + protobuf_InitDefaults_op_5fdef_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed OpDeprecation_default_instance_; + +OpDeprecation* OpDeprecation::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void OpDeprecation::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.OpDeprecation) + version_ = 0; + explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} + +bool OpDeprecation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.OpDeprecation) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 version = 1; + case 1: { + if (tag == 8) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_explanation; + break; + } + + // optional string explanation = 2; + case 2: { + if (tag == 18) { + parse_explanation: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_explanation())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->explanation().data(), this->explanation().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.OpDeprecation.explanation")); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.OpDeprecation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.OpDeprecation) + return false; +#undef DO_ +} + +void OpDeprecation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.OpDeprecation) + // optional int32 version = 1; + if (this->version() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->version(), output); + } + + // optional string explanation = 2; + if (this->explanation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->explanation().data(), this->explanation().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDeprecation.explanation"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->explanation(), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.OpDeprecation) +} + +::google::protobuf::uint8* OpDeprecation::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.OpDeprecation) + // optional int32 version = 1; + if (this->version() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->version(), target); + } + + // optional string explanation = 2; + if (this->explanation().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->explanation().data(), this->explanation().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.OpDeprecation.explanation"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->explanation(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.OpDeprecation) + return target; +} + +size_t OpDeprecation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.OpDeprecation) + size_t total_size = 0; + + // optional int32 version = 1; + if (this->version() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version()); + } + + // optional string explanation = 2; + if (this->explanation().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->explanation()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OpDeprecation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.OpDeprecation) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const OpDeprecation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.OpDeprecation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.OpDeprecation) + UnsafeMergeFrom(*source); + } +} + +void OpDeprecation::MergeFrom(const OpDeprecation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.OpDeprecation) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void OpDeprecation::UnsafeMergeFrom(const OpDeprecation& from) { + GOOGLE_DCHECK(&from != this); + if (from.version() != 0) { + set_version(from.version()); + } + if (from.explanation().size() > 0) { + set_explanation(from.explanation()); + } +} + +void OpDeprecation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.OpDeprecation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpDeprecation::CopyFrom(const OpDeprecation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.OpDeprecation) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool OpDeprecation::IsInitialized() const { + + return true; +} + +void OpDeprecation::Swap(OpDeprecation* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpDeprecation temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void OpDeprecation::UnsafeArenaSwap(OpDeprecation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpDeprecation::InternalSwap(OpDeprecation* other) { + std::swap(version_, other->version_); + explanation_.Swap(&other->explanation_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OpDeprecation::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OpDeprecation_descriptor_; + metadata.reflection = OpDeprecation_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// OpDeprecation + +// optional int32 version = 1; +void OpDeprecation::clear_version() { + version_ = 0; +} +::google::protobuf::int32 OpDeprecation::version() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDeprecation.version) + return version_; +} +void OpDeprecation::set_version(::google::protobuf::int32 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDeprecation.version) +} + +// optional string explanation = 2; +void OpDeprecation::clear_explanation() { + explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& OpDeprecation::explanation() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDeprecation.explanation) + return explanation_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void OpDeprecation::set_explanation(const ::std::string& value) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDeprecation.explanation) +} +void OpDeprecation::set_explanation(const char* value) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDeprecation.explanation) +} +void OpDeprecation::set_explanation(const char* value, + size_t size) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDeprecation.explanation) +} +::std::string* OpDeprecation::mutable_explanation() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDeprecation.explanation) + return explanation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDeprecation::release_explanation() { + // @@protoc_insertion_point(field_release:tensorflow.OpDeprecation.explanation) + + return explanation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* OpDeprecation::unsafe_arena_release_explanation() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDeprecation.explanation) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return explanation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void OpDeprecation::set_allocated_explanation(::std::string* explanation) { + if (explanation != NULL) { + + } else { + + } + explanation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), explanation, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDeprecation.explanation) +} +void OpDeprecation::unsafe_arena_set_allocated_explanation( + ::std::string* explanation) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (explanation != NULL) { + + } else { + + } + explanation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + explanation, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDeprecation.explanation) +} + +inline const OpDeprecation* OpDeprecation::internal_default_instance() { + return &OpDeprecation_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OpList::kOpFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OpList::OpList() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_op_5fdef_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.OpList) +} +OpList::OpList(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + op_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_op_5fdef_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.OpList) +} + +void OpList::InitAsDefaultInstance() { +} + +OpList::OpList(const OpList& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.OpList) +} + +void OpList::SharedCtor() { + _cached_size_ = 0; +} + +OpList::~OpList() { + // @@protoc_insertion_point(destructor:tensorflow.OpList) + SharedDtor(); +} + +void OpList::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + +} + +void OpList::ArenaDtor(void* object) { + OpList* _this = reinterpret_cast< OpList* >(object); + (void)_this; +} +void OpList::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void OpList::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OpList::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OpList_descriptor_; +} + +const OpList& OpList::default_instance() { + protobuf_InitDefaults_op_5fdef_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed OpList_default_instance_; + +OpList* OpList::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void OpList::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.OpList) + op_.Clear(); +} + +bool OpList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.OpList) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .tensorflow.OpDef op = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_op; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.OpList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.OpList) + return false; +#undef DO_ +} + +void OpList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.OpList) + // repeated .tensorflow.OpDef op = 1; + for (unsigned int i = 0, n = this->op_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->op(i), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.OpList) +} + +::google::protobuf::uint8* OpList::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.OpList) + // repeated .tensorflow.OpDef op = 1; + for (unsigned int i = 0, n = this->op_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 1, this->op(i), false, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.OpList) + return target; +} + +size_t OpList::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.OpList) + size_t total_size = 0; + + // repeated .tensorflow.OpDef op = 1; + { + unsigned int count = this->op_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->op(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OpList::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.OpList) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const OpList* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.OpList) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.OpList) + UnsafeMergeFrom(*source); + } +} + +void OpList::MergeFrom(const OpList& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.OpList) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void OpList::UnsafeMergeFrom(const OpList& from) { + GOOGLE_DCHECK(&from != this); + op_.MergeFrom(from.op_); +} + +void OpList::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.OpList) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OpList::CopyFrom(const OpList& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.OpList) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool OpList::IsInitialized() const { + + return true; +} + +void OpList::Swap(OpList* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + OpList temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void OpList::UnsafeArenaSwap(OpList* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void OpList::InternalSwap(OpList* other) { + op_.UnsafeArenaSwap(&other->op_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OpList::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OpList_descriptor_; + metadata.reflection = OpList_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// OpList + +// repeated .tensorflow.OpDef op = 1; +int OpList::op_size() const { + return op_.size(); +} +void OpList::clear_op() { + op_.Clear(); +} +const ::tensorflow::OpDef& OpList::op(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpList.op) + return op_.Get(index); +} +::tensorflow::OpDef* OpList::mutable_op(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpList.op) + return op_.Mutable(index); +} +::tensorflow::OpDef* OpList::add_op() { + // @@protoc_insertion_point(field_add:tensorflow.OpList.op) + return op_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef >* +OpList::mutable_op() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpList.op) + return &op_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef >& +OpList::op() const { + // @@protoc_insertion_point(field_list:tensorflow.OpList.op) + return op_; +} + +inline const OpList* OpList::internal_default_instance() { + return &OpList_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/op_def.pb.h b/modules/dnn/misc/tensorflow/op_def.pb.h new file mode 100644 index 0000000000..71956e4d20 --- /dev/null +++ b/modules/dnn/misc/tensorflow/op_def.pb.h @@ -0,0 +1,2103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: op_def.proto + +#ifndef PROTOBUF_op_5fdef_2eproto__INCLUDED +#define PROTOBUF_op_5fdef_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "attr_value.pb.h" +#include "types.pb.h" +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_op_5fdef_2eproto(); +void protobuf_InitDefaults_op_5fdef_2eproto(); +void protobuf_AssignDesc_op_5fdef_2eproto(); +void protobuf_ShutdownFile_op_5fdef_2eproto(); + +class OpDef; +class OpDef_ArgDef; +class OpDef_AttrDef; +class OpDeprecation; +class OpList; + +// =================================================================== + +class OpDef_ArgDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.OpDef.ArgDef) */ { + public: + OpDef_ArgDef(); + virtual ~OpDef_ArgDef(); + + OpDef_ArgDef(const OpDef_ArgDef& from); + + inline OpDef_ArgDef& operator=(const OpDef_ArgDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDef_ArgDef& default_instance(); + + static const OpDef_ArgDef* internal_default_instance(); + + void UnsafeArenaSwap(OpDef_ArgDef* other); + void Swap(OpDef_ArgDef* other); + + // implements Message ---------------------------------------------- + + inline OpDef_ArgDef* New() const { return New(NULL); } + + OpDef_ArgDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OpDef_ArgDef& from); + void MergeFrom(const OpDef_ArgDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDef_ArgDef* other); + void UnsafeMergeFrom(const OpDef_ArgDef& from); + protected: + explicit OpDef_ArgDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // optional string description = 2; + void clear_description(); + static const int kDescriptionFieldNumber = 2; + const ::std::string& description() const; + void set_description(const ::std::string& value); + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + ::std::string* unsafe_arena_release_description(); + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // optional .tensorflow.DataType type = 3; + void clear_type(); + static const int kTypeFieldNumber = 3; + ::tensorflow::DataType type() const; + void set_type(::tensorflow::DataType value); + + // optional string type_attr = 4; + void clear_type_attr(); + static const int kTypeAttrFieldNumber = 4; + const ::std::string& type_attr() const; + void set_type_attr(const ::std::string& value); + void set_type_attr(const char* value); + void set_type_attr(const char* value, size_t size); + ::std::string* mutable_type_attr(); + ::std::string* release_type_attr(); + void set_allocated_type_attr(::std::string* type_attr); + ::std::string* unsafe_arena_release_type_attr(); + void unsafe_arena_set_allocated_type_attr( + ::std::string* type_attr); + + // optional string number_attr = 5; + void clear_number_attr(); + static const int kNumberAttrFieldNumber = 5; + const ::std::string& number_attr() const; + void set_number_attr(const ::std::string& value); + void set_number_attr(const char* value); + void set_number_attr(const char* value, size_t size); + ::std::string* mutable_number_attr(); + ::std::string* release_number_attr(); + void set_allocated_number_attr(::std::string* number_attr); + ::std::string* unsafe_arena_release_number_attr(); + void unsafe_arena_set_allocated_number_attr( + ::std::string* number_attr); + + // optional string type_list_attr = 6; + void clear_type_list_attr(); + static const int kTypeListAttrFieldNumber = 6; + const ::std::string& type_list_attr() const; + void set_type_list_attr(const ::std::string& value); + void set_type_list_attr(const char* value); + void set_type_list_attr(const char* value, size_t size); + ::std::string* mutable_type_list_attr(); + ::std::string* release_type_list_attr(); + void set_allocated_type_list_attr(::std::string* type_list_attr); + ::std::string* unsafe_arena_release_type_list_attr(); + void unsafe_arena_set_allocated_type_list_attr( + ::std::string* type_list_attr); + + // optional bool is_ref = 16; + void clear_is_ref(); + static const int kIsRefFieldNumber = 16; + bool is_ref() const; + void set_is_ref(bool value); + + // @@protoc_insertion_point(class_scope:tensorflow.OpDef.ArgDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr type_attr_; + ::google::protobuf::internal::ArenaStringPtr number_attr_; + ::google::protobuf::internal::ArenaStringPtr type_list_attr_; + int type_; + bool is_ref_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_op_5fdef_2eproto_impl(); + friend void protobuf_AddDesc_op_5fdef_2eproto_impl(); + friend void protobuf_AssignDesc_op_5fdef_2eproto(); + friend void protobuf_ShutdownFile_op_5fdef_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed OpDef_ArgDef_default_instance_; + +// ------------------------------------------------------------------- + +class OpDef_AttrDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.OpDef.AttrDef) */ { + public: + OpDef_AttrDef(); + virtual ~OpDef_AttrDef(); + + OpDef_AttrDef(const OpDef_AttrDef& from); + + inline OpDef_AttrDef& operator=(const OpDef_AttrDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDef_AttrDef& default_instance(); + + static const OpDef_AttrDef* internal_default_instance(); + + void UnsafeArenaSwap(OpDef_AttrDef* other); + void Swap(OpDef_AttrDef* other); + + // implements Message ---------------------------------------------- + + inline OpDef_AttrDef* New() const { return New(NULL); } + + OpDef_AttrDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OpDef_AttrDef& from); + void MergeFrom(const OpDef_AttrDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDef_AttrDef* other); + void UnsafeMergeFrom(const OpDef_AttrDef& from); + protected: + explicit OpDef_AttrDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // optional string type = 2; + void clear_type(); + static const int kTypeFieldNumber = 2; + const ::std::string& type() const; + void set_type(const ::std::string& value); + void set_type(const char* value); + void set_type(const char* value, size_t size); + ::std::string* mutable_type(); + ::std::string* release_type(); + void set_allocated_type(::std::string* type); + ::std::string* unsafe_arena_release_type(); + void unsafe_arena_set_allocated_type( + ::std::string* type); + + // optional .tensorflow.AttrValue default_value = 3; + bool has_default_value() const; + void clear_default_value(); + static const int kDefaultValueFieldNumber = 3; + private: + void _slow_mutable_default_value(); + void _slow_set_allocated_default_value( + ::google::protobuf::Arena* message_arena, ::tensorflow::AttrValue** default_value); + ::tensorflow::AttrValue* _slow_release_default_value(); + public: + const ::tensorflow::AttrValue& default_value() const; + ::tensorflow::AttrValue* mutable_default_value(); + ::tensorflow::AttrValue* release_default_value(); + void set_allocated_default_value(::tensorflow::AttrValue* default_value); + ::tensorflow::AttrValue* unsafe_arena_release_default_value(); + void unsafe_arena_set_allocated_default_value( + ::tensorflow::AttrValue* default_value); + + // optional string description = 4; + void clear_description(); + static const int kDescriptionFieldNumber = 4; + const ::std::string& description() const; + void set_description(const ::std::string& value); + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + ::std::string* unsafe_arena_release_description(); + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // optional bool has_minimum = 5; + void clear_has_minimum(); + static const int kHasMinimumFieldNumber = 5; + bool has_minimum() const; + void set_has_minimum(bool value); + + // optional int64 minimum = 6; + void clear_minimum(); + static const int kMinimumFieldNumber = 6; + ::google::protobuf::int64 minimum() const; + void set_minimum(::google::protobuf::int64 value); + + // optional .tensorflow.AttrValue allowed_values = 7; + bool has_allowed_values() const; + void clear_allowed_values(); + static const int kAllowedValuesFieldNumber = 7; + private: + void _slow_mutable_allowed_values(); + void _slow_set_allocated_allowed_values( + ::google::protobuf::Arena* message_arena, ::tensorflow::AttrValue** allowed_values); + ::tensorflow::AttrValue* _slow_release_allowed_values(); + public: + const ::tensorflow::AttrValue& allowed_values() const; + ::tensorflow::AttrValue* mutable_allowed_values(); + ::tensorflow::AttrValue* release_allowed_values(); + void set_allocated_allowed_values(::tensorflow::AttrValue* allowed_values); + ::tensorflow::AttrValue* unsafe_arena_release_allowed_values(); + void unsafe_arena_set_allocated_allowed_values( + ::tensorflow::AttrValue* allowed_values); + + // @@protoc_insertion_point(class_scope:tensorflow.OpDef.AttrDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::tensorflow::AttrValue* default_value_; + ::tensorflow::AttrValue* allowed_values_; + ::google::protobuf::int64 minimum_; + bool has_minimum_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_op_5fdef_2eproto_impl(); + friend void protobuf_AddDesc_op_5fdef_2eproto_impl(); + friend void protobuf_AssignDesc_op_5fdef_2eproto(); + friend void protobuf_ShutdownFile_op_5fdef_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed OpDef_AttrDef_default_instance_; + +// ------------------------------------------------------------------- + +class OpDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.OpDef) */ { + public: + OpDef(); + virtual ~OpDef(); + + OpDef(const OpDef& from); + + inline OpDef& operator=(const OpDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDef& default_instance(); + + static const OpDef* internal_default_instance(); + + void UnsafeArenaSwap(OpDef* other); + void Swap(OpDef* other); + + // implements Message ---------------------------------------------- + + inline OpDef* New() const { return New(NULL); } + + OpDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OpDef& from); + void MergeFrom(const OpDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDef* other); + void UnsafeMergeFrom(const OpDef& from); + protected: + explicit OpDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef OpDef_ArgDef ArgDef; + typedef OpDef_AttrDef AttrDef; + + // accessors ------------------------------------------------------- + + // optional string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // repeated .tensorflow.OpDef.ArgDef input_arg = 2; + int input_arg_size() const; + void clear_input_arg(); + static const int kInputArgFieldNumber = 2; + const ::tensorflow::OpDef_ArgDef& input_arg(int index) const; + ::tensorflow::OpDef_ArgDef* mutable_input_arg(int index); + ::tensorflow::OpDef_ArgDef* add_input_arg(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >* + mutable_input_arg(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >& + input_arg() const; + + // repeated .tensorflow.OpDef.ArgDef output_arg = 3; + int output_arg_size() const; + void clear_output_arg(); + static const int kOutputArgFieldNumber = 3; + const ::tensorflow::OpDef_ArgDef& output_arg(int index) const; + ::tensorflow::OpDef_ArgDef* mutable_output_arg(int index); + ::tensorflow::OpDef_ArgDef* add_output_arg(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >* + mutable_output_arg(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >& + output_arg() const; + + // repeated .tensorflow.OpDef.AttrDef attr = 4; + int attr_size() const; + void clear_attr(); + static const int kAttrFieldNumber = 4; + const ::tensorflow::OpDef_AttrDef& attr(int index) const; + ::tensorflow::OpDef_AttrDef* mutable_attr(int index); + ::tensorflow::OpDef_AttrDef* add_attr(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef >* + mutable_attr(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef >& + attr() const; + + // optional .tensorflow.OpDeprecation deprecation = 8; + bool has_deprecation() const; + void clear_deprecation(); + static const int kDeprecationFieldNumber = 8; + private: + void _slow_mutable_deprecation(); + void _slow_set_allocated_deprecation( + ::google::protobuf::Arena* message_arena, ::tensorflow::OpDeprecation** deprecation); + ::tensorflow::OpDeprecation* _slow_release_deprecation(); + public: + const ::tensorflow::OpDeprecation& deprecation() const; + ::tensorflow::OpDeprecation* mutable_deprecation(); + ::tensorflow::OpDeprecation* release_deprecation(); + void set_allocated_deprecation(::tensorflow::OpDeprecation* deprecation); + ::tensorflow::OpDeprecation* unsafe_arena_release_deprecation(); + void unsafe_arena_set_allocated_deprecation( + ::tensorflow::OpDeprecation* deprecation); + + // optional string summary = 5; + void clear_summary(); + static const int kSummaryFieldNumber = 5; + const ::std::string& summary() const; + void set_summary(const ::std::string& value); + void set_summary(const char* value); + void set_summary(const char* value, size_t size); + ::std::string* mutable_summary(); + ::std::string* release_summary(); + void set_allocated_summary(::std::string* summary); + ::std::string* unsafe_arena_release_summary(); + void unsafe_arena_set_allocated_summary( + ::std::string* summary); + + // optional string description = 6; + void clear_description(); + static const int kDescriptionFieldNumber = 6; + const ::std::string& description() const; + void set_description(const ::std::string& value); + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + ::std::string* unsafe_arena_release_description(); + void unsafe_arena_set_allocated_description( + ::std::string* description); + + // optional bool is_commutative = 18; + void clear_is_commutative(); + static const int kIsCommutativeFieldNumber = 18; + bool is_commutative() const; + void set_is_commutative(bool value); + + // optional bool is_aggregate = 16; + void clear_is_aggregate(); + static const int kIsAggregateFieldNumber = 16; + bool is_aggregate() const; + void set_is_aggregate(bool value); + + // optional bool is_stateful = 17; + void clear_is_stateful(); + static const int kIsStatefulFieldNumber = 17; + bool is_stateful() const; + void set_is_stateful(bool value); + + // optional bool allows_uninitialized_input = 19; + void clear_allows_uninitialized_input(); + static const int kAllowsUninitializedInputFieldNumber = 19; + bool allows_uninitialized_input() const; + void set_allows_uninitialized_input(bool value); + + // @@protoc_insertion_point(class_scope:tensorflow.OpDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef > input_arg_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef > output_arg_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef > attr_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr summary_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::tensorflow::OpDeprecation* deprecation_; + bool is_commutative_; + bool is_aggregate_; + bool is_stateful_; + bool allows_uninitialized_input_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_op_5fdef_2eproto_impl(); + friend void protobuf_AddDesc_op_5fdef_2eproto_impl(); + friend void protobuf_AssignDesc_op_5fdef_2eproto(); + friend void protobuf_ShutdownFile_op_5fdef_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed OpDef_default_instance_; + +// ------------------------------------------------------------------- + +class OpDeprecation : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.OpDeprecation) */ { + public: + OpDeprecation(); + virtual ~OpDeprecation(); + + OpDeprecation(const OpDeprecation& from); + + inline OpDeprecation& operator=(const OpDeprecation& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpDeprecation& default_instance(); + + static const OpDeprecation* internal_default_instance(); + + void UnsafeArenaSwap(OpDeprecation* other); + void Swap(OpDeprecation* other); + + // implements Message ---------------------------------------------- + + inline OpDeprecation* New() const { return New(NULL); } + + OpDeprecation* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OpDeprecation& from); + void MergeFrom(const OpDeprecation& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDeprecation* other); + void UnsafeMergeFrom(const OpDeprecation& from); + protected: + explicit OpDeprecation(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 version = 1; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::google::protobuf::int32 version() const; + void set_version(::google::protobuf::int32 value); + + // optional string explanation = 2; + void clear_explanation(); + static const int kExplanationFieldNumber = 2; + const ::std::string& explanation() const; + void set_explanation(const ::std::string& value); + void set_explanation(const char* value); + void set_explanation(const char* value, size_t size); + ::std::string* mutable_explanation(); + ::std::string* release_explanation(); + void set_allocated_explanation(::std::string* explanation); + ::std::string* unsafe_arena_release_explanation(); + void unsafe_arena_set_allocated_explanation( + ::std::string* explanation); + + // @@protoc_insertion_point(class_scope:tensorflow.OpDeprecation) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr explanation_; + ::google::protobuf::int32 version_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_op_5fdef_2eproto_impl(); + friend void protobuf_AddDesc_op_5fdef_2eproto_impl(); + friend void protobuf_AssignDesc_op_5fdef_2eproto(); + friend void protobuf_ShutdownFile_op_5fdef_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed OpDeprecation_default_instance_; + +// ------------------------------------------------------------------- + +class OpList : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.OpList) */ { + public: + OpList(); + virtual ~OpList(); + + OpList(const OpList& from); + + inline OpList& operator=(const OpList& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const OpList& default_instance(); + + static const OpList* internal_default_instance(); + + void UnsafeArenaSwap(OpList* other); + void Swap(OpList* other); + + // implements Message ---------------------------------------------- + + inline OpList* New() const { return New(NULL); } + + OpList* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OpList& from); + void MergeFrom(const OpList& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpList* other); + void UnsafeMergeFrom(const OpList& from); + protected: + explicit OpList(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .tensorflow.OpDef op = 1; + int op_size() const; + void clear_op(); + static const int kOpFieldNumber = 1; + const ::tensorflow::OpDef& op(int index) const; + ::tensorflow::OpDef* mutable_op(int index); + ::tensorflow::OpDef* add_op(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef >* + mutable_op(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef >& + op() const; + + // @@protoc_insertion_point(class_scope:tensorflow.OpList) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef > op_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_op_5fdef_2eproto_impl(); + friend void protobuf_AddDesc_op_5fdef_2eproto_impl(); + friend void protobuf_AssignDesc_op_5fdef_2eproto(); + friend void protobuf_ShutdownFile_op_5fdef_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed OpList_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// OpDef_ArgDef + +// optional string name = 1; +inline void OpDef_ArgDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_ArgDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.name) +} +inline void OpDef_ArgDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.name) +} +inline void OpDef_ArgDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.name) +} +inline ::std::string* OpDef_ArgDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.name) +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.name) +} + +// optional string description = 2; +inline void OpDef_ArgDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::description() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.description) + return description_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_ArgDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.description) +} +inline void OpDef_ArgDef::set_description(const char* value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.description) +} +inline void OpDef_ArgDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.description) +} +inline ::std::string* OpDef_ArgDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_description() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.description) +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.description) +} + +// optional .tensorflow.DataType type = 3; +inline void OpDef_ArgDef::clear_type() { + type_ = 0; +} +inline ::tensorflow::DataType OpDef_ArgDef::type() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.type) + return static_cast< ::tensorflow::DataType >(type_); +} +inline void OpDef_ArgDef::set_type(::tensorflow::DataType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.type) +} + +// optional string type_attr = 4; +inline void OpDef_ArgDef::clear_type_attr() { + type_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::type_attr() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.type_attr) + return type_attr_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_ArgDef::set_type_attr(const ::std::string& value) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.type_attr) +} +inline void OpDef_ArgDef::set_type_attr(const char* value) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.type_attr) +} +inline void OpDef_ArgDef::set_type_attr(const char* value, + size_t size) { + + type_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.type_attr) +} +inline ::std::string* OpDef_ArgDef::mutable_type_attr() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.type_attr) + return type_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_type_attr() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.type_attr) + + return type_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_type_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.type_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_type_attr(::std::string* type_attr) { + if (type_attr != NULL) { + + } else { + + } + type_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.type_attr) +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_type_attr( + ::std::string* type_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_attr != NULL) { + + } else { + + } + type_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.type_attr) +} + +// optional string number_attr = 5; +inline void OpDef_ArgDef::clear_number_attr() { + number_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::number_attr() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.number_attr) + return number_attr_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_ArgDef::set_number_attr(const ::std::string& value) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.number_attr) +} +inline void OpDef_ArgDef::set_number_attr(const char* value) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.number_attr) +} +inline void OpDef_ArgDef::set_number_attr(const char* value, + size_t size) { + + number_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.number_attr) +} +inline ::std::string* OpDef_ArgDef::mutable_number_attr() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.number_attr) + return number_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_number_attr() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.number_attr) + + return number_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_number_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.number_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return number_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_number_attr(::std::string* number_attr) { + if (number_attr != NULL) { + + } else { + + } + number_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), number_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.number_attr) +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_number_attr( + ::std::string* number_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (number_attr != NULL) { + + } else { + + } + number_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + number_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.number_attr) +} + +// optional string type_list_attr = 6; +inline void OpDef_ArgDef::clear_type_list_attr() { + type_list_attr_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_ArgDef::type_list_attr() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.type_list_attr) + return type_list_attr_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_ArgDef::set_type_list_attr(const ::std::string& value) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.type_list_attr) +} +inline void OpDef_ArgDef::set_type_list_attr(const char* value) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.ArgDef.type_list_attr) +} +inline void OpDef_ArgDef::set_type_list_attr(const char* value, + size_t size) { + + type_list_attr_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.ArgDef.type_list_attr) +} +inline ::std::string* OpDef_ArgDef::mutable_type_list_attr() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.ArgDef.type_list_attr) + return type_list_attr_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::release_type_list_attr() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.ArgDef.type_list_attr) + + return type_list_attr_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_ArgDef::unsafe_arena_release_type_list_attr() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.ArgDef.type_list_attr) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_list_attr_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_ArgDef::set_allocated_type_list_attr(::std::string* type_list_attr) { + if (type_list_attr != NULL) { + + } else { + + } + type_list_attr_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_list_attr, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.ArgDef.type_list_attr) +} +inline void OpDef_ArgDef::unsafe_arena_set_allocated_type_list_attr( + ::std::string* type_list_attr) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type_list_attr != NULL) { + + } else { + + } + type_list_attr_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type_list_attr, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.ArgDef.type_list_attr) +} + +// optional bool is_ref = 16; +inline void OpDef_ArgDef::clear_is_ref() { + is_ref_ = false; +} +inline bool OpDef_ArgDef::is_ref() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.ArgDef.is_ref) + return is_ref_; +} +inline void OpDef_ArgDef::set_is_ref(bool value) { + + is_ref_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.ArgDef.is_ref) +} + +inline const OpDef_ArgDef* OpDef_ArgDef::internal_default_instance() { + return &OpDef_ArgDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// OpDef_AttrDef + +// optional string name = 1; +inline void OpDef_AttrDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_AttrDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_AttrDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.name) +} +inline void OpDef_AttrDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.AttrDef.name) +} +inline void OpDef_AttrDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.AttrDef.name) +} +inline ::std::string* OpDef_AttrDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.name) +} +inline void OpDef_AttrDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.name) +} + +// optional string type = 2; +inline void OpDef_AttrDef::clear_type() { + type_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_AttrDef::type() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.type) + return type_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_AttrDef::set_type(const ::std::string& value) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.type) +} +inline void OpDef_AttrDef::set_type(const char* value) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.AttrDef.type) +} +inline void OpDef_AttrDef::set_type(const char* value, + size_t size) { + + type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.AttrDef.type) +} +inline ::std::string* OpDef_AttrDef::mutable_type() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.type) + return type_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::release_type() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.type) + + return type_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::unsafe_arena_release_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.type) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::set_allocated_type(::std::string* type) { + if (type != NULL) { + + } else { + + } + type_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.type) +} +inline void OpDef_AttrDef::unsafe_arena_set_allocated_type( + ::std::string* type) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (type != NULL) { + + } else { + + } + type_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + type, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.type) +} + +// optional .tensorflow.AttrValue default_value = 3; +inline bool OpDef_AttrDef::has_default_value() const { + return this != internal_default_instance() && default_value_ != NULL; +} +inline void OpDef_AttrDef::clear_default_value() { + if (GetArenaNoVirtual() == NULL && default_value_ != NULL) delete default_value_; + default_value_ = NULL; +} +inline const ::tensorflow::AttrValue& OpDef_AttrDef::default_value() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.default_value) + return default_value_ != NULL ? *default_value_ + : *::tensorflow::AttrValue::internal_default_instance(); +} +inline ::tensorflow::AttrValue* OpDef_AttrDef::mutable_default_value() { + + if (default_value_ == NULL) { + _slow_mutable_default_value(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.default_value) + return default_value_; +} +inline ::tensorflow::AttrValue* OpDef_AttrDef::release_default_value() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.default_value) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_default_value(); + } else { + ::tensorflow::AttrValue* temp = default_value_; + default_value_ = NULL; + return temp; + } +} +inline void OpDef_AttrDef::set_allocated_default_value(::tensorflow::AttrValue* default_value) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete default_value_; + } + if (default_value != NULL) { + _slow_set_allocated_default_value(message_arena, &default_value); + } + default_value_ = default_value; + if (default_value) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.default_value) +} + +// optional string description = 4; +inline void OpDef_AttrDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef_AttrDef::description() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.description) + return description_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef_AttrDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.description) +} +inline void OpDef_AttrDef::set_description(const char* value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.AttrDef.description) +} +inline void OpDef_AttrDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.AttrDef.description) +} +inline ::std::string* OpDef_AttrDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::release_description() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef_AttrDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.AttrDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef_AttrDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.description) +} +inline void OpDef_AttrDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.AttrDef.description) +} + +// optional bool has_minimum = 5; +inline void OpDef_AttrDef::clear_has_minimum() { + has_minimum_ = false; +} +inline bool OpDef_AttrDef::has_minimum() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.has_minimum) + return has_minimum_; +} +inline void OpDef_AttrDef::set_has_minimum(bool value) { + + has_minimum_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.has_minimum) +} + +// optional int64 minimum = 6; +inline void OpDef_AttrDef::clear_minimum() { + minimum_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 OpDef_AttrDef::minimum() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.minimum) + return minimum_; +} +inline void OpDef_AttrDef::set_minimum(::google::protobuf::int64 value) { + + minimum_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.AttrDef.minimum) +} + +// optional .tensorflow.AttrValue allowed_values = 7; +inline bool OpDef_AttrDef::has_allowed_values() const { + return this != internal_default_instance() && allowed_values_ != NULL; +} +inline void OpDef_AttrDef::clear_allowed_values() { + if (GetArenaNoVirtual() == NULL && allowed_values_ != NULL) delete allowed_values_; + allowed_values_ = NULL; +} +inline const ::tensorflow::AttrValue& OpDef_AttrDef::allowed_values() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.AttrDef.allowed_values) + return allowed_values_ != NULL ? *allowed_values_ + : *::tensorflow::AttrValue::internal_default_instance(); +} +inline ::tensorflow::AttrValue* OpDef_AttrDef::mutable_allowed_values() { + + if (allowed_values_ == NULL) { + _slow_mutable_allowed_values(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.AttrDef.allowed_values) + return allowed_values_; +} +inline ::tensorflow::AttrValue* OpDef_AttrDef::release_allowed_values() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.AttrDef.allowed_values) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_allowed_values(); + } else { + ::tensorflow::AttrValue* temp = allowed_values_; + allowed_values_ = NULL; + return temp; + } +} +inline void OpDef_AttrDef::set_allocated_allowed_values(::tensorflow::AttrValue* allowed_values) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete allowed_values_; + } + if (allowed_values != NULL) { + _slow_set_allocated_allowed_values(message_arena, &allowed_values); + } + allowed_values_ = allowed_values; + if (allowed_values) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.AttrDef.allowed_values) +} + +inline const OpDef_AttrDef* OpDef_AttrDef::internal_default_instance() { + return &OpDef_AttrDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// OpDef + +// optional string name = 1; +inline void OpDef::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef::name() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.name) +} +inline void OpDef::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.name) +} +inline void OpDef::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.name) +} +inline ::std::string* OpDef::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.name) +} +inline void OpDef::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.name) +} + +// repeated .tensorflow.OpDef.ArgDef input_arg = 2; +inline int OpDef::input_arg_size() const { + return input_arg_.size(); +} +inline void OpDef::clear_input_arg() { + input_arg_.Clear(); +} +inline const ::tensorflow::OpDef_ArgDef& OpDef::input_arg(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.input_arg) + return input_arg_.Get(index); +} +inline ::tensorflow::OpDef_ArgDef* OpDef::mutable_input_arg(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.input_arg) + return input_arg_.Mutable(index); +} +inline ::tensorflow::OpDef_ArgDef* OpDef::add_input_arg() { + // @@protoc_insertion_point(field_add:tensorflow.OpDef.input_arg) + return input_arg_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >* +OpDef::mutable_input_arg() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpDef.input_arg) + return &input_arg_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >& +OpDef::input_arg() const { + // @@protoc_insertion_point(field_list:tensorflow.OpDef.input_arg) + return input_arg_; +} + +// repeated .tensorflow.OpDef.ArgDef output_arg = 3; +inline int OpDef::output_arg_size() const { + return output_arg_.size(); +} +inline void OpDef::clear_output_arg() { + output_arg_.Clear(); +} +inline const ::tensorflow::OpDef_ArgDef& OpDef::output_arg(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.output_arg) + return output_arg_.Get(index); +} +inline ::tensorflow::OpDef_ArgDef* OpDef::mutable_output_arg(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.output_arg) + return output_arg_.Mutable(index); +} +inline ::tensorflow::OpDef_ArgDef* OpDef::add_output_arg() { + // @@protoc_insertion_point(field_add:tensorflow.OpDef.output_arg) + return output_arg_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >* +OpDef::mutable_output_arg() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpDef.output_arg) + return &output_arg_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_ArgDef >& +OpDef::output_arg() const { + // @@protoc_insertion_point(field_list:tensorflow.OpDef.output_arg) + return output_arg_; +} + +// repeated .tensorflow.OpDef.AttrDef attr = 4; +inline int OpDef::attr_size() const { + return attr_.size(); +} +inline void OpDef::clear_attr() { + attr_.Clear(); +} +inline const ::tensorflow::OpDef_AttrDef& OpDef::attr(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.attr) + return attr_.Get(index); +} +inline ::tensorflow::OpDef_AttrDef* OpDef::mutable_attr(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.attr) + return attr_.Mutable(index); +} +inline ::tensorflow::OpDef_AttrDef* OpDef::add_attr() { + // @@protoc_insertion_point(field_add:tensorflow.OpDef.attr) + return attr_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef >* +OpDef::mutable_attr() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpDef.attr) + return &attr_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef_AttrDef >& +OpDef::attr() const { + // @@protoc_insertion_point(field_list:tensorflow.OpDef.attr) + return attr_; +} + +// optional .tensorflow.OpDeprecation deprecation = 8; +inline bool OpDef::has_deprecation() const { + return this != internal_default_instance() && deprecation_ != NULL; +} +inline void OpDef::clear_deprecation() { + if (GetArenaNoVirtual() == NULL && deprecation_ != NULL) delete deprecation_; + deprecation_ = NULL; +} +inline const ::tensorflow::OpDeprecation& OpDef::deprecation() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.deprecation) + return deprecation_ != NULL ? *deprecation_ + : *::tensorflow::OpDeprecation::internal_default_instance(); +} +inline ::tensorflow::OpDeprecation* OpDef::mutable_deprecation() { + + if (deprecation_ == NULL) { + _slow_mutable_deprecation(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.deprecation) + return deprecation_; +} +inline ::tensorflow::OpDeprecation* OpDef::release_deprecation() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.deprecation) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_deprecation(); + } else { + ::tensorflow::OpDeprecation* temp = deprecation_; + deprecation_ = NULL; + return temp; + } +} +inline void OpDef::set_allocated_deprecation(::tensorflow::OpDeprecation* deprecation) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete deprecation_; + } + if (deprecation != NULL) { + _slow_set_allocated_deprecation(message_arena, &deprecation); + } + deprecation_ = deprecation; + if (deprecation) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.deprecation) +} + +// optional string summary = 5; +inline void OpDef::clear_summary() { + summary_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef::summary() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.summary) + return summary_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef::set_summary(const ::std::string& value) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.summary) +} +inline void OpDef::set_summary(const char* value) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.summary) +} +inline void OpDef::set_summary(const char* value, + size_t size) { + + summary_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.summary) +} +inline ::std::string* OpDef::mutable_summary() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.summary) + return summary_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::release_summary() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.summary) + + return summary_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::unsafe_arena_release_summary() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.summary) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return summary_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef::set_allocated_summary(::std::string* summary) { + if (summary != NULL) { + + } else { + + } + summary_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), summary, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.summary) +} +inline void OpDef::unsafe_arena_set_allocated_summary( + ::std::string* summary) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (summary != NULL) { + + } else { + + } + summary_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + summary, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.summary) +} + +// optional string description = 6; +inline void OpDef::clear_description() { + description_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDef::description() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.description) + return description_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDef::set_description(const ::std::string& value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDef.description) +} +inline void OpDef::set_description(const char* value) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDef.description) +} +inline void OpDef::set_description(const char* value, + size_t size) { + + description_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDef.description) +} +inline ::std::string* OpDef::mutable_description() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDef.description) + return description_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::release_description() { + // @@protoc_insertion_point(field_release:tensorflow.OpDef.description) + + return description_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDef::unsafe_arena_release_description() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDef.description) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return description_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDef::set_allocated_description(::std::string* description) { + if (description != NULL) { + + } else { + + } + description_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDef.description) +} +inline void OpDef::unsafe_arena_set_allocated_description( + ::std::string* description) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (description != NULL) { + + } else { + + } + description_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + description, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDef.description) +} + +// optional bool is_commutative = 18; +inline void OpDef::clear_is_commutative() { + is_commutative_ = false; +} +inline bool OpDef::is_commutative() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.is_commutative) + return is_commutative_; +} +inline void OpDef::set_is_commutative(bool value) { + + is_commutative_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.is_commutative) +} + +// optional bool is_aggregate = 16; +inline void OpDef::clear_is_aggregate() { + is_aggregate_ = false; +} +inline bool OpDef::is_aggregate() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.is_aggregate) + return is_aggregate_; +} +inline void OpDef::set_is_aggregate(bool value) { + + is_aggregate_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.is_aggregate) +} + +// optional bool is_stateful = 17; +inline void OpDef::clear_is_stateful() { + is_stateful_ = false; +} +inline bool OpDef::is_stateful() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.is_stateful) + return is_stateful_; +} +inline void OpDef::set_is_stateful(bool value) { + + is_stateful_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.is_stateful) +} + +// optional bool allows_uninitialized_input = 19; +inline void OpDef::clear_allows_uninitialized_input() { + allows_uninitialized_input_ = false; +} +inline bool OpDef::allows_uninitialized_input() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDef.allows_uninitialized_input) + return allows_uninitialized_input_; +} +inline void OpDef::set_allows_uninitialized_input(bool value) { + + allows_uninitialized_input_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDef.allows_uninitialized_input) +} + +inline const OpDef* OpDef::internal_default_instance() { + return &OpDef_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// OpDeprecation + +// optional int32 version = 1; +inline void OpDeprecation::clear_version() { + version_ = 0; +} +inline ::google::protobuf::int32 OpDeprecation::version() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDeprecation.version) + return version_; +} +inline void OpDeprecation::set_version(::google::protobuf::int32 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:tensorflow.OpDeprecation.version) +} + +// optional string explanation = 2; +inline void OpDeprecation::clear_explanation() { + explanation_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& OpDeprecation::explanation() const { + // @@protoc_insertion_point(field_get:tensorflow.OpDeprecation.explanation) + return explanation_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OpDeprecation::set_explanation(const ::std::string& value) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.OpDeprecation.explanation) +} +inline void OpDeprecation::set_explanation(const char* value) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.OpDeprecation.explanation) +} +inline void OpDeprecation::set_explanation(const char* value, + size_t size) { + + explanation_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.OpDeprecation.explanation) +} +inline ::std::string* OpDeprecation::mutable_explanation() { + + // @@protoc_insertion_point(field_mutable:tensorflow.OpDeprecation.explanation) + return explanation_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDeprecation::release_explanation() { + // @@protoc_insertion_point(field_release:tensorflow.OpDeprecation.explanation) + + return explanation_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* OpDeprecation::unsafe_arena_release_explanation() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.OpDeprecation.explanation) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return explanation_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void OpDeprecation::set_allocated_explanation(::std::string* explanation) { + if (explanation != NULL) { + + } else { + + } + explanation_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), explanation, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.OpDeprecation.explanation) +} +inline void OpDeprecation::unsafe_arena_set_allocated_explanation( + ::std::string* explanation) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (explanation != NULL) { + + } else { + + } + explanation_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + explanation, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.OpDeprecation.explanation) +} + +inline const OpDeprecation* OpDeprecation::internal_default_instance() { + return &OpDeprecation_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// OpList + +// repeated .tensorflow.OpDef op = 1; +inline int OpList::op_size() const { + return op_.size(); +} +inline void OpList::clear_op() { + op_.Clear(); +} +inline const ::tensorflow::OpDef& OpList::op(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.OpList.op) + return op_.Get(index); +} +inline ::tensorflow::OpDef* OpList::mutable_op(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.OpList.op) + return op_.Mutable(index); +} +inline ::tensorflow::OpDef* OpList::add_op() { + // @@protoc_insertion_point(field_add:tensorflow.OpList.op) + return op_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef >* +OpList::mutable_op() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.OpList.op) + return &op_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::OpDef >& +OpList::op() const { + // @@protoc_insertion_point(field_list:tensorflow.OpList.op) + return op_; +} + +inline const OpList* OpList::internal_default_instance() { + return &OpList_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_op_5fdef_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/tensor.pb.cc b/modules/dnn/misc/tensorflow/tensor.pb.cc new file mode 100644 index 0000000000..e9851095be --- /dev/null +++ b/modules/dnn/misc/tensorflow/tensor.pb.cc @@ -0,0 +1,1596 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensor.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "tensor.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* TensorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TensorProto_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_tensor_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_tensor_2eproto() { + protobuf_AddDesc_tensor_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "tensor.proto"); + GOOGLE_CHECK(file != NULL); + TensorProto_descriptor_ = file->message_type(0); + static const int TensorProto_offsets_[13] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, dtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, tensor_shape_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, version_number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, tensor_content_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, half_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, float_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, double_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, int_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, string_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, scomplex_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, int64_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, bool_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, dcomplex_val_), + }; + TensorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TensorProto_descriptor_, + TensorProto::internal_default_instance(), + TensorProto_offsets_, + -1, + -1, + -1, + sizeof(TensorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, _internal_metadata_)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_tensor_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TensorProto_descriptor_, TensorProto::internal_default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_tensor_2eproto() { + TensorProto_default_instance_.Shutdown(); + delete TensorProto_reflection_; +} + +void protobuf_InitDefaults_tensor_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::tensorflow::protobuf_InitDefaults_tensor_5fshape_2eproto(); + ::tensorflow::protobuf_InitDefaults_types_2eproto(); + ::google::protobuf::internal::GetEmptyString(); + TensorProto_default_instance_.DefaultConstruct(); + TensorProto_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_tensor_2eproto_once_); +void protobuf_InitDefaults_tensor_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_tensor_2eproto_once_, + &protobuf_InitDefaults_tensor_2eproto_impl); +} +void protobuf_AddDesc_tensor_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_tensor_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\014tensor.proto\022\ntensorflow\032\022tensor_shape" + ".proto\032\013types.proto\"\345\002\n\013TensorProto\022#\n\005d" + "type\030\001 \001(\0162\024.tensorflow.DataType\0222\n\014tens" + "or_shape\030\002 \001(\0132\034.tensorflow.TensorShapeP" + "roto\022\026\n\016version_number\030\003 \001(\005\022\026\n\016tensor_c" + "ontent\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020\001\022\025\n\tfl" + "oat_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006 \003(\001B\002\020" + "\001\022\023\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_val\030\010 \003" + "(\014\022\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\tint64_va" + "l\030\n \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001\022\030\n\014dco" + "mplex_val\030\014 \003(\001B\002\020\001B-\n\030org.tensorflow.fr" + "ameworkB\014TensorProtosP\001\370\001\001b\006proto3", 474); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "tensor.proto", &protobuf_RegisterTypes); + ::tensorflow::protobuf_AddDesc_tensor_5fshape_2eproto(); + ::tensorflow::protobuf_AddDesc_types_2eproto(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_tensor_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_tensor_2eproto_once_); +void protobuf_AddDesc_tensor_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_tensor_2eproto_once_, + &protobuf_AddDesc_tensor_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_tensor_2eproto { + StaticDescriptorInitializer_tensor_2eproto() { + protobuf_AddDesc_tensor_2eproto(); + } +} static_descriptor_initializer_tensor_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +void TensorProto::_slow_mutable_tensor_shape() { + tensor_shape_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >( + GetArenaNoVirtual()); +} +::tensorflow::TensorShapeProto* TensorProto::_slow_release_tensor_shape() { + if (tensor_shape_ == NULL) { + return NULL; + } else { + ::tensorflow::TensorShapeProto* temp = new ::tensorflow::TensorShapeProto(*tensor_shape_); + tensor_shape_ = NULL; + return temp; + } +} +::tensorflow::TensorShapeProto* TensorProto::unsafe_arena_release_tensor_shape() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorProto.tensor_shape) + + ::tensorflow::TensorShapeProto* temp = tensor_shape_; + tensor_shape_ = NULL; + return temp; +} +void TensorProto::_slow_set_allocated_tensor_shape( + ::google::protobuf::Arena* message_arena, ::tensorflow::TensorShapeProto** tensor_shape) { + if (message_arena != NULL && + ::google::protobuf::Arena::GetArena(*tensor_shape) == NULL) { + message_arena->Own(*tensor_shape); + } else if (message_arena != + ::google::protobuf::Arena::GetArena(*tensor_shape)) { + ::tensorflow::TensorShapeProto* new_tensor_shape = + ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >( + message_arena); + new_tensor_shape->CopyFrom(**tensor_shape); + *tensor_shape = new_tensor_shape; + } +} +void TensorProto::unsafe_arena_set_allocated_tensor_shape( + ::tensorflow::TensorShapeProto* tensor_shape) { + if (GetArenaNoVirtual() == NULL) { + delete tensor_shape_; + } + tensor_shape_ = tensor_shape; + if (tensor_shape) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorProto.tensor_shape) +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorProto::kDtypeFieldNumber; +const int TensorProto::kTensorShapeFieldNumber; +const int TensorProto::kVersionNumberFieldNumber; +const int TensorProto::kTensorContentFieldNumber; +const int TensorProto::kHalfValFieldNumber; +const int TensorProto::kFloatValFieldNumber; +const int TensorProto::kDoubleValFieldNumber; +const int TensorProto::kIntValFieldNumber; +const int TensorProto::kStringValFieldNumber; +const int TensorProto::kScomplexValFieldNumber; +const int TensorProto::kInt64ValFieldNumber; +const int TensorProto::kBoolValFieldNumber; +const int TensorProto::kDcomplexValFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorProto::TensorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_tensor_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.TensorProto) +} +TensorProto::TensorProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + half_val_(arena), + float_val_(arena), + double_val_(arena), + int_val_(arena), + string_val_(arena), + scomplex_val_(arena), + int64_val_(arena), + bool_val_(arena), + dcomplex_val_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_tensor_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.TensorProto) +} + +void TensorProto::InitAsDefaultInstance() { + tensor_shape_ = const_cast< ::tensorflow::TensorShapeProto*>( + ::tensorflow::TensorShapeProto::internal_default_instance()); +} + +TensorProto::TensorProto(const TensorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.TensorProto) +} + +void TensorProto::SharedCtor() { + tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + tensor_shape_ = NULL; + ::memset(&dtype_, 0, reinterpret_cast(&version_number_) - + reinterpret_cast(&dtype_) + sizeof(version_number_)); + _cached_size_ = 0; +} + +TensorProto::~TensorProto() { + // @@protoc_insertion_point(destructor:tensorflow.TensorProto) + SharedDtor(); +} + +void TensorProto::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + tensor_content_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); + if (this != &TensorProto_default_instance_.get()) { + delete tensor_shape_; + } +} + +void TensorProto::ArenaDtor(void* object) { + TensorProto* _this = reinterpret_cast< TensorProto* >(object); + (void)_this; +} +void TensorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TensorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TensorProto_descriptor_; +} + +const TensorProto& TensorProto::default_instance() { + protobuf_InitDefaults_tensor_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed TensorProto_default_instance_; + +TensorProto* TensorProto::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void TensorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.TensorProto) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(TensorProto, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(dtype_, version_number_); + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) delete tensor_shape_; + tensor_shape_ = NULL; + tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); + +#undef ZR_HELPER_ +#undef ZR_ + + half_val_.Clear(); + float_val_.Clear(); + double_val_.Clear(); + int_val_.Clear(); + string_val_.Clear(); + scomplex_val_.Clear(); + int64_val_.Clear(); + bool_val_.Clear(); + dcomplex_val_.Clear(); +} + +bool TensorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.TensorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .tensorflow.DataType dtype = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_dtype(static_cast< ::tensorflow::DataType >(value)); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_tensor_shape; + break; + } + + // optional .tensorflow.TensorShapeProto tensor_shape = 2; + case 2: { + if (tag == 18) { + parse_tensor_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tensor_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_version_number; + break; + } + + // optional int32 version_number = 3; + case 3: { + if (tag == 24) { + parse_version_number: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_number_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_tensor_content; + break; + } + + // optional bytes tensor_content = 4; + case 4: { + if (tag == 34) { + parse_tensor_content: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_tensor_content())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_float_val; + break; + } + + // repeated float float_val = 5 [packed = true]; + case 5: { + if (tag == 42) { + parse_float_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_float_val()))); + } else if (tag == 45) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 42, input, this->mutable_float_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_double_val; + break; + } + + // repeated double double_val = 6 [packed = true]; + case 6: { + if (tag == 50) { + parse_double_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_double_val()))); + } else if (tag == 49) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 50, input, this->mutable_double_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_int_val; + break; + } + + // repeated int32 int_val = 7 [packed = true]; + case 7: { + if (tag == 58) { + parse_int_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_int_val()))); + } else if (tag == 56) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 58, input, this->mutable_int_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_string_val; + break; + } + + // repeated bytes string_val = 8; + case 8: { + if (tag == 66) { + parse_string_val: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_string_val())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_string_val; + if (input->ExpectTag(74)) goto parse_scomplex_val; + break; + } + + // repeated float scomplex_val = 9 [packed = true]; + case 9: { + if (tag == 74) { + parse_scomplex_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_scomplex_val()))); + } else if (tag == 77) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 74, input, this->mutable_scomplex_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_int64_val; + break; + } + + // repeated int64 int64_val = 10 [packed = true]; + case 10: { + if (tag == 82) { + parse_int64_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_int64_val()))); + } else if (tag == 80) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 82, input, this->mutable_int64_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_bool_val; + break; + } + + // repeated bool bool_val = 11 [packed = true]; + case 11: { + if (tag == 90) { + parse_bool_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_bool_val()))); + } else if (tag == 88) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 90, input, this->mutable_bool_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(98)) goto parse_dcomplex_val; + break; + } + + // repeated double dcomplex_val = 12 [packed = true]; + case 12: { + if (tag == 98) { + parse_dcomplex_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, this->mutable_dcomplex_val()))); + } else if (tag == 97) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + 1, 98, input, this->mutable_dcomplex_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(106)) goto parse_half_val; + break; + } + + // repeated int32 half_val = 13 [packed = true]; + case 13: { + if (tag == 106) { + parse_half_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_half_val()))); + } else if (tag == 104) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 106, input, this->mutable_half_val()))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.TensorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.TensorProto) + return false; +#undef DO_ +} + +void TensorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.TensorProto) + // optional .tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->dtype(), output); + } + + // optional .tensorflow.TensorShapeProto tensor_shape = 2; + if (this->has_tensor_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *this->tensor_shape_, output); + } + + // optional int32 version_number = 3; + if (this->version_number() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version_number(), output); + } + + // optional bytes tensor_content = 4; + if (this->tensor_content().size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->tensor_content(), output); + } + + // repeated float float_val = 5 [packed = true]; + if (this->float_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_float_val_cached_byte_size_); + } + for (int i = 0; i < this->float_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloatNoTag( + this->float_val(i), output); + } + + // repeated double double_val = 6 [packed = true]; + if (this->double_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_double_val_cached_byte_size_); + } + for (int i = 0; i < this->double_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteDoubleNoTag( + this->double_val(i), output); + } + + // repeated int32 int_val = 7 [packed = true]; + if (this->int_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_int_val_cached_byte_size_); + } + for (int i = 0; i < this->int_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->int_val(i), output); + } + + // repeated bytes string_val = 8; + for (int i = 0; i < this->string_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 8, this->string_val(i), output); + } + + // repeated float scomplex_val = 9 [packed = true]; + if (this->scomplex_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_scomplex_val_cached_byte_size_); + } + for (int i = 0; i < this->scomplex_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloatNoTag( + this->scomplex_val(i), output); + } + + // repeated int64 int64_val = 10 [packed = true]; + if (this->int64_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_int64_val_cached_byte_size_); + } + for (int i = 0; i < this->int64_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( + this->int64_val(i), output); + } + + // repeated bool bool_val = 11 [packed = true]; + if (this->bool_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_bool_val_cached_byte_size_); + } + for (int i = 0; i < this->bool_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBoolNoTag( + this->bool_val(i), output); + } + + // repeated double dcomplex_val = 12 [packed = true]; + if (this->dcomplex_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_dcomplex_val_cached_byte_size_); + } + for (int i = 0; i < this->dcomplex_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteDoubleNoTag( + this->dcomplex_val(i), output); + } + + // repeated int32 half_val = 13 [packed = true]; + if (this->half_val_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(13, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_val_cached_byte_size_); + } + for (int i = 0; i < this->half_val_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->half_val(i), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.TensorProto) +} + +::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorProto) + // optional .tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->dtype(), target); + } + + // optional .tensorflow.TensorShapeProto tensor_shape = 2; + if (this->has_tensor_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, *this->tensor_shape_, false, target); + } + + // optional int32 version_number = 3; + if (this->version_number() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version_number(), target); + } + + // optional bytes tensor_content = 4; + if (this->tensor_content().size() > 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->tensor_content(), target); + } + + // repeated float float_val = 5 [packed = true]; + if (this->float_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _float_val_cached_byte_size_, target); + } + for (int i = 0; i < this->float_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->float_val(i), target); + } + + // repeated double double_val = 6 [packed = true]; + if (this->double_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 6, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _double_val_cached_byte_size_, target); + } + for (int i = 0; i < this->double_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->double_val(i), target); + } + + // repeated int32 int_val = 7 [packed = true]; + if (this->int_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 7, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _int_val_cached_byte_size_, target); + } + for (int i = 0; i < this->int_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->int_val(i), target); + } + + // repeated bytes string_val = 8; + for (int i = 0; i < this->string_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(8, this->string_val(i), target); + } + + // repeated float scomplex_val = 9 [packed = true]; + if (this->scomplex_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _scomplex_val_cached_byte_size_, target); + } + for (int i = 0; i < this->scomplex_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteFloatNoTagToArray(this->scomplex_val(i), target); + } + + // repeated int64 int64_val = 10 [packed = true]; + if (this->int64_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _int64_val_cached_byte_size_, target); + } + for (int i = 0; i < this->int64_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt64NoTagToArray(this->int64_val(i), target); + } + + // repeated bool bool_val = 11 [packed = true]; + if (this->bool_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 11, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _bool_val_cached_byte_size_, target); + } + for (int i = 0; i < this->bool_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBoolNoTagToArray(this->bool_val(i), target); + } + + // repeated double dcomplex_val = 12 [packed = true]; + if (this->dcomplex_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 12, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _dcomplex_val_cached_byte_size_, target); + } + for (int i = 0; i < this->dcomplex_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteDoubleNoTagToArray(this->dcomplex_val(i), target); + } + + // repeated int32 half_val = 13 [packed = true]; + if (this->half_val_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 13, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _half_val_cached_byte_size_, target); + } + for (int i = 0; i < this->half_val_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->half_val(i), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorProto) + return target; +} + +size_t TensorProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorProto) + size_t total_size = 0; + + // optional .tensorflow.DataType dtype = 1; + if (this->dtype() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype()); + } + + // optional .tensorflow.TensorShapeProto tensor_shape = 2; + if (this->has_tensor_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tensor_shape_); + } + + // optional int32 version_number = 3; + if (this->version_number() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version_number()); + } + + // optional bytes tensor_content = 4; + if (this->tensor_content().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->tensor_content()); + } + + // repeated int32 half_val = 13 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->half_val_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->half_val(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float float_val = 5 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->float_val_size(); + data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _float_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_val = 6 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->double_val_size(); + data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 int_val = 7 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->int_val_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->int_val(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _int_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated bytes string_val = 8; + total_size += 1 * + ::google::protobuf::internal::FromIntSize(this->string_val_size()); + for (int i = 0; i < this->string_val_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->string_val(i)); + } + + // repeated float scomplex_val = 9 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->scomplex_val_size(); + data_size = 4UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _scomplex_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int64 int64_val = 10 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->int64_val_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int64Size(this->int64_val(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _int64_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated bool bool_val = 11 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->bool_val_size(); + data_size = 1UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _bool_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double dcomplex_val = 12 [packed = true]; + { + size_t data_size = 0; + unsigned int count = this->dcomplex_val_size(); + data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dcomplex_val_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TensorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const TensorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorProto) + UnsafeMergeFrom(*source); + } +} + +void TensorProto::MergeFrom(const TensorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorProto) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void TensorProto::UnsafeMergeFrom(const TensorProto& from) { + GOOGLE_DCHECK(&from != this); + half_val_.UnsafeMergeFrom(from.half_val_); + float_val_.UnsafeMergeFrom(from.float_val_); + double_val_.UnsafeMergeFrom(from.double_val_); + int_val_.UnsafeMergeFrom(from.int_val_); + string_val_.UnsafeMergeFrom(from.string_val_); + scomplex_val_.UnsafeMergeFrom(from.scomplex_val_); + int64_val_.UnsafeMergeFrom(from.int64_val_); + bool_val_.UnsafeMergeFrom(from.bool_val_); + dcomplex_val_.UnsafeMergeFrom(from.dcomplex_val_); + if (from.dtype() != 0) { + set_dtype(from.dtype()); + } + if (from.has_tensor_shape()) { + mutable_tensor_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape()); + } + if (from.version_number() != 0) { + set_version_number(from.version_number()); + } + if (from.tensor_content().size() > 0) { + set_tensor_content(from.tensor_content()); + } +} + +void TensorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorProto::CopyFrom(const TensorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorProto) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool TensorProto::IsInitialized() const { + + return true; +} + +void TensorProto::Swap(TensorProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorProto temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void TensorProto::UnsafeArenaSwap(TensorProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorProto::InternalSwap(TensorProto* other) { + std::swap(dtype_, other->dtype_); + std::swap(tensor_shape_, other->tensor_shape_); + std::swap(version_number_, other->version_number_); + tensor_content_.Swap(&other->tensor_content_); + half_val_.UnsafeArenaSwap(&other->half_val_); + float_val_.UnsafeArenaSwap(&other->float_val_); + double_val_.UnsafeArenaSwap(&other->double_val_); + int_val_.UnsafeArenaSwap(&other->int_val_); + string_val_.UnsafeArenaSwap(&other->string_val_); + scomplex_val_.UnsafeArenaSwap(&other->scomplex_val_); + int64_val_.UnsafeArenaSwap(&other->int64_val_); + bool_val_.UnsafeArenaSwap(&other->bool_val_); + dcomplex_val_.UnsafeArenaSwap(&other->dcomplex_val_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata TensorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TensorProto_descriptor_; + metadata.reflection = TensorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// TensorProto + +// optional .tensorflow.DataType dtype = 1; +void TensorProto::clear_dtype() { + dtype_ = 0; +} +::tensorflow::DataType TensorProto::dtype() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.dtype) + return static_cast< ::tensorflow::DataType >(dtype_); +} +void TensorProto::set_dtype(::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.dtype) +} + +// optional .tensorflow.TensorShapeProto tensor_shape = 2; +bool TensorProto::has_tensor_shape() const { + return this != internal_default_instance() && tensor_shape_ != NULL; +} +void TensorProto::clear_tensor_shape() { + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) delete tensor_shape_; + tensor_shape_ = NULL; +} +const ::tensorflow::TensorShapeProto& TensorProto::tensor_shape() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.tensor_shape) + return tensor_shape_ != NULL ? *tensor_shape_ + : *::tensorflow::TensorShapeProto::internal_default_instance(); +} +::tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() { + + if (tensor_shape_ == NULL) { + _slow_mutable_tensor_shape(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.tensor_shape) + return tensor_shape_; +} +::tensorflow::TensorShapeProto* TensorProto::release_tensor_shape() { + // @@protoc_insertion_point(field_release:tensorflow.TensorProto.tensor_shape) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_tensor_shape(); + } else { + ::tensorflow::TensorShapeProto* temp = tensor_shape_; + tensor_shape_ = NULL; + return temp; + } +} + void TensorProto::set_allocated_tensor_shape(::tensorflow::TensorShapeProto* tensor_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete tensor_shape_; + } + if (tensor_shape != NULL) { + _slow_set_allocated_tensor_shape(message_arena, &tensor_shape); + } + tensor_shape_ = tensor_shape; + if (tensor_shape) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.TensorProto.tensor_shape) +} + +// optional int32 version_number = 3; +void TensorProto::clear_version_number() { + version_number_ = 0; +} +::google::protobuf::int32 TensorProto::version_number() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.version_number) + return version_number_; +} +void TensorProto::set_version_number(::google::protobuf::int32 value) { + + version_number_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.version_number) +} + +// optional bytes tensor_content = 4; +void TensorProto::clear_tensor_content() { + tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& TensorProto::tensor_content() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.tensor_content) + return tensor_content_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void TensorProto::set_tensor_content(const ::std::string& value) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.tensor_content) +} +void TensorProto::set_tensor_content(const char* value) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.TensorProto.tensor_content) +} +void TensorProto::set_tensor_content(const void* value, + size_t size) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.TensorProto.tensor_content) +} +::std::string* TensorProto::mutable_tensor_content() { + + // @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.tensor_content) + return tensor_content_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* TensorProto::release_tensor_content() { + // @@protoc_insertion_point(field_release:tensorflow.TensorProto.tensor_content) + + return tensor_content_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* TensorProto::unsafe_arena_release_tensor_content() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorProto.tensor_content) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return tensor_content_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void TensorProto::set_allocated_tensor_content(::std::string* tensor_content) { + if (tensor_content != NULL) { + + } else { + + } + tensor_content_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_content, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.TensorProto.tensor_content) +} +void TensorProto::unsafe_arena_set_allocated_tensor_content( + ::std::string* tensor_content) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (tensor_content != NULL) { + + } else { + + } + tensor_content_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + tensor_content, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorProto.tensor_content) +} + +// repeated int32 half_val = 13 [packed = true]; +int TensorProto::half_val_size() const { + return half_val_.size(); +} +void TensorProto::clear_half_val() { + half_val_.Clear(); +} +::google::protobuf::int32 TensorProto::half_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.half_val) + return half_val_.Get(index); +} +void TensorProto::set_half_val(int index, ::google::protobuf::int32 value) { + half_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.half_val) +} +void TensorProto::add_half_val(::google::protobuf::int32 value) { + half_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.half_val) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TensorProto::half_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.half_val) + return half_val_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TensorProto::mutable_half_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.half_val) + return &half_val_; +} + +// repeated float float_val = 5 [packed = true]; +int TensorProto::float_val_size() const { + return float_val_.size(); +} +void TensorProto::clear_float_val() { + float_val_.Clear(); +} +float TensorProto::float_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.float_val) + return float_val_.Get(index); +} +void TensorProto::set_float_val(int index, float value) { + float_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.float_val) +} +void TensorProto::add_float_val(float value) { + float_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.float_val) +} +const ::google::protobuf::RepeatedField< float >& +TensorProto::float_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.float_val) + return float_val_; +} +::google::protobuf::RepeatedField< float >* +TensorProto::mutable_float_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.float_val) + return &float_val_; +} + +// repeated double double_val = 6 [packed = true]; +int TensorProto::double_val_size() const { + return double_val_.size(); +} +void TensorProto::clear_double_val() { + double_val_.Clear(); +} +double TensorProto::double_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.double_val) + return double_val_.Get(index); +} +void TensorProto::set_double_val(int index, double value) { + double_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.double_val) +} +void TensorProto::add_double_val(double value) { + double_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.double_val) +} +const ::google::protobuf::RepeatedField< double >& +TensorProto::double_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.double_val) + return double_val_; +} +::google::protobuf::RepeatedField< double >* +TensorProto::mutable_double_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.double_val) + return &double_val_; +} + +// repeated int32 int_val = 7 [packed = true]; +int TensorProto::int_val_size() const { + return int_val_.size(); +} +void TensorProto::clear_int_val() { + int_val_.Clear(); +} +::google::protobuf::int32 TensorProto::int_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.int_val) + return int_val_.Get(index); +} +void TensorProto::set_int_val(int index, ::google::protobuf::int32 value) { + int_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.int_val) +} +void TensorProto::add_int_val(::google::protobuf::int32 value) { + int_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.int_val) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TensorProto::int_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.int_val) + return int_val_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TensorProto::mutable_int_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.int_val) + return &int_val_; +} + +// repeated bytes string_val = 8; +int TensorProto::string_val_size() const { + return string_val_.size(); +} +void TensorProto::clear_string_val() { + string_val_.Clear(); +} +const ::std::string& TensorProto::string_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.string_val) + return string_val_.Get(index); +} +::std::string* TensorProto::mutable_string_val(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.string_val) + return string_val_.Mutable(index); +} +void TensorProto::set_string_val(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.string_val) + string_val_.Mutable(index)->assign(value); +} +void TensorProto::set_string_val(int index, const char* value) { + string_val_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.TensorProto.string_val) +} +void TensorProto::set_string_val(int index, const void* value, size_t size) { + string_val_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.TensorProto.string_val) +} +::std::string* TensorProto::add_string_val() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.TensorProto.string_val) + return string_val_.Add(); +} +void TensorProto::add_string_val(const ::std::string& value) { + string_val_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.string_val) +} +void TensorProto::add_string_val(const char* value) { + string_val_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.TensorProto.string_val) +} +void TensorProto::add_string_val(const void* value, size_t size) { + string_val_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.TensorProto.string_val) +} +const ::google::protobuf::RepeatedPtrField< ::std::string>& +TensorProto::string_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.string_val) + return string_val_; +} +::google::protobuf::RepeatedPtrField< ::std::string>* +TensorProto::mutable_string_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.string_val) + return &string_val_; +} + +// repeated float scomplex_val = 9 [packed = true]; +int TensorProto::scomplex_val_size() const { + return scomplex_val_.size(); +} +void TensorProto::clear_scomplex_val() { + scomplex_val_.Clear(); +} +float TensorProto::scomplex_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.scomplex_val) + return scomplex_val_.Get(index); +} +void TensorProto::set_scomplex_val(int index, float value) { + scomplex_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.scomplex_val) +} +void TensorProto::add_scomplex_val(float value) { + scomplex_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.scomplex_val) +} +const ::google::protobuf::RepeatedField< float >& +TensorProto::scomplex_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.scomplex_val) + return scomplex_val_; +} +::google::protobuf::RepeatedField< float >* +TensorProto::mutable_scomplex_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.scomplex_val) + return &scomplex_val_; +} + +// repeated int64 int64_val = 10 [packed = true]; +int TensorProto::int64_val_size() const { + return int64_val_.size(); +} +void TensorProto::clear_int64_val() { + int64_val_.Clear(); +} +::google::protobuf::int64 TensorProto::int64_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.int64_val) + return int64_val_.Get(index); +} +void TensorProto::set_int64_val(int index, ::google::protobuf::int64 value) { + int64_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.int64_val) +} +void TensorProto::add_int64_val(::google::protobuf::int64 value) { + int64_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.int64_val) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +TensorProto::int64_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.int64_val) + return int64_val_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +TensorProto::mutable_int64_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.int64_val) + return &int64_val_; +} + +// repeated bool bool_val = 11 [packed = true]; +int TensorProto::bool_val_size() const { + return bool_val_.size(); +} +void TensorProto::clear_bool_val() { + bool_val_.Clear(); +} +bool TensorProto::bool_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.bool_val) + return bool_val_.Get(index); +} +void TensorProto::set_bool_val(int index, bool value) { + bool_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.bool_val) +} +void TensorProto::add_bool_val(bool value) { + bool_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.bool_val) +} +const ::google::protobuf::RepeatedField< bool >& +TensorProto::bool_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.bool_val) + return bool_val_; +} +::google::protobuf::RepeatedField< bool >* +TensorProto::mutable_bool_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.bool_val) + return &bool_val_; +} + +// repeated double dcomplex_val = 12 [packed = true]; +int TensorProto::dcomplex_val_size() const { + return dcomplex_val_.size(); +} +void TensorProto::clear_dcomplex_val() { + dcomplex_val_.Clear(); +} +double TensorProto::dcomplex_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.dcomplex_val) + return dcomplex_val_.Get(index); +} +void TensorProto::set_dcomplex_val(int index, double value) { + dcomplex_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.dcomplex_val) +} +void TensorProto::add_dcomplex_val(double value) { + dcomplex_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.dcomplex_val) +} +const ::google::protobuf::RepeatedField< double >& +TensorProto::dcomplex_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.dcomplex_val) + return dcomplex_val_; +} +::google::protobuf::RepeatedField< double >* +TensorProto::mutable_dcomplex_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.dcomplex_val) + return &dcomplex_val_; +} + +inline const TensorProto* TensorProto::internal_default_instance() { + return &TensorProto_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/tensor.pb.h b/modules/dnn/misc/tensorflow/tensor.pb.h new file mode 100644 index 0000000000..362821f563 --- /dev/null +++ b/modules/dnn/misc/tensorflow/tensor.pb.h @@ -0,0 +1,770 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensor.proto + +#ifndef PROTOBUF_tensor_2eproto__INCLUDED +#define PROTOBUF_tensor_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "tensor_shape.pb.h" +#include "types.pb.h" +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_tensor_2eproto(); +void protobuf_InitDefaults_tensor_2eproto(); +void protobuf_AssignDesc_tensor_2eproto(); +void protobuf_ShutdownFile_tensor_2eproto(); + +class TensorProto; + +// =================================================================== + +class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.TensorProto) */ { + public: + TensorProto(); + virtual ~TensorProto(); + + TensorProto(const TensorProto& from); + + inline TensorProto& operator=(const TensorProto& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorProto& default_instance(); + + static const TensorProto* internal_default_instance(); + + void UnsafeArenaSwap(TensorProto* other); + void Swap(TensorProto* other); + + // implements Message ---------------------------------------------- + + inline TensorProto* New() const { return New(NULL); } + + TensorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TensorProto& from); + void MergeFrom(const TensorProto& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TensorProto* other); + void UnsafeMergeFrom(const TensorProto& from); + protected: + explicit TensorProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .tensorflow.DataType dtype = 1; + void clear_dtype(); + static const int kDtypeFieldNumber = 1; + ::tensorflow::DataType dtype() const; + void set_dtype(::tensorflow::DataType value); + + // optional .tensorflow.TensorShapeProto tensor_shape = 2; + bool has_tensor_shape() const; + void clear_tensor_shape(); + static const int kTensorShapeFieldNumber = 2; + private: + void _slow_mutable_tensor_shape(); + void _slow_set_allocated_tensor_shape( + ::google::protobuf::Arena* message_arena, ::tensorflow::TensorShapeProto** tensor_shape); + ::tensorflow::TensorShapeProto* _slow_release_tensor_shape(); + public: + const ::tensorflow::TensorShapeProto& tensor_shape() const; + ::tensorflow::TensorShapeProto* mutable_tensor_shape(); + ::tensorflow::TensorShapeProto* release_tensor_shape(); + void set_allocated_tensor_shape(::tensorflow::TensorShapeProto* tensor_shape); + ::tensorflow::TensorShapeProto* unsafe_arena_release_tensor_shape(); + void unsafe_arena_set_allocated_tensor_shape( + ::tensorflow::TensorShapeProto* tensor_shape); + + // optional int32 version_number = 3; + void clear_version_number(); + static const int kVersionNumberFieldNumber = 3; + ::google::protobuf::int32 version_number() const; + void set_version_number(::google::protobuf::int32 value); + + // optional bytes tensor_content = 4; + void clear_tensor_content(); + static const int kTensorContentFieldNumber = 4; + const ::std::string& tensor_content() const; + void set_tensor_content(const ::std::string& value); + void set_tensor_content(const char* value); + void set_tensor_content(const void* value, size_t size); + ::std::string* mutable_tensor_content(); + ::std::string* release_tensor_content(); + void set_allocated_tensor_content(::std::string* tensor_content); + ::std::string* unsafe_arena_release_tensor_content(); + void unsafe_arena_set_allocated_tensor_content( + ::std::string* tensor_content); + + // repeated int32 half_val = 13 [packed = true]; + int half_val_size() const; + void clear_half_val(); + static const int kHalfValFieldNumber = 13; + ::google::protobuf::int32 half_val(int index) const; + void set_half_val(int index, ::google::protobuf::int32 value); + void add_half_val(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + half_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_half_val(); + + // repeated float float_val = 5 [packed = true]; + int float_val_size() const; + void clear_float_val(); + static const int kFloatValFieldNumber = 5; + float float_val(int index) const; + void set_float_val(int index, float value); + void add_float_val(float value); + const ::google::protobuf::RepeatedField< float >& + float_val() const; + ::google::protobuf::RepeatedField< float >* + mutable_float_val(); + + // repeated double double_val = 6 [packed = true]; + int double_val_size() const; + void clear_double_val(); + static const int kDoubleValFieldNumber = 6; + double double_val(int index) const; + void set_double_val(int index, double value); + void add_double_val(double value); + const ::google::protobuf::RepeatedField< double >& + double_val() const; + ::google::protobuf::RepeatedField< double >* + mutable_double_val(); + + // repeated int32 int_val = 7 [packed = true]; + int int_val_size() const; + void clear_int_val(); + static const int kIntValFieldNumber = 7; + ::google::protobuf::int32 int_val(int index) const; + void set_int_val(int index, ::google::protobuf::int32 value); + void add_int_val(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + int_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_int_val(); + + // repeated bytes string_val = 8; + int string_val_size() const; + void clear_string_val(); + static const int kStringValFieldNumber = 8; + const ::std::string& string_val(int index) const; + ::std::string* mutable_string_val(int index); + void set_string_val(int index, const ::std::string& value); + void set_string_val(int index, const char* value); + void set_string_val(int index, const void* value, size_t size); + ::std::string* add_string_val(); + void add_string_val(const ::std::string& value); + void add_string_val(const char* value); + void add_string_val(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& string_val() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_string_val(); + + // repeated float scomplex_val = 9 [packed = true]; + int scomplex_val_size() const; + void clear_scomplex_val(); + static const int kScomplexValFieldNumber = 9; + float scomplex_val(int index) const; + void set_scomplex_val(int index, float value); + void add_scomplex_val(float value); + const ::google::protobuf::RepeatedField< float >& + scomplex_val() const; + ::google::protobuf::RepeatedField< float >* + mutable_scomplex_val(); + + // repeated int64 int64_val = 10 [packed = true]; + int int64_val_size() const; + void clear_int64_val(); + static const int kInt64ValFieldNumber = 10; + ::google::protobuf::int64 int64_val(int index) const; + void set_int64_val(int index, ::google::protobuf::int64 value); + void add_int64_val(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + int64_val() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_int64_val(); + + // repeated bool bool_val = 11 [packed = true]; + int bool_val_size() const; + void clear_bool_val(); + static const int kBoolValFieldNumber = 11; + bool bool_val(int index) const; + void set_bool_val(int index, bool value); + void add_bool_val(bool value); + const ::google::protobuf::RepeatedField< bool >& + bool_val() const; + ::google::protobuf::RepeatedField< bool >* + mutable_bool_val(); + + // repeated double dcomplex_val = 12 [packed = true]; + int dcomplex_val_size() const; + void clear_dcomplex_val(); + static const int kDcomplexValFieldNumber = 12; + double dcomplex_val(int index) const; + void set_dcomplex_val(int index, double value); + void add_dcomplex_val(double value); + const ::google::protobuf::RepeatedField< double >& + dcomplex_val() const; + ::google::protobuf::RepeatedField< double >* + mutable_dcomplex_val(); + + // @@protoc_insertion_point(class_scope:tensorflow.TensorProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > half_val_; + mutable int _half_val_cached_byte_size_; + ::google::protobuf::RepeatedField< float > float_val_; + mutable int _float_val_cached_byte_size_; + ::google::protobuf::RepeatedField< double > double_val_; + mutable int _double_val_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > int_val_; + mutable int _int_val_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> string_val_; + ::google::protobuf::RepeatedField< float > scomplex_val_; + mutable int _scomplex_val_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > int64_val_; + mutable int _int64_val_cached_byte_size_; + ::google::protobuf::RepeatedField< bool > bool_val_; + mutable int _bool_val_cached_byte_size_; + ::google::protobuf::RepeatedField< double > dcomplex_val_; + mutable int _dcomplex_val_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr tensor_content_; + ::tensorflow::TensorShapeProto* tensor_shape_; + int dtype_; + ::google::protobuf::int32 version_number_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_tensor_2eproto_impl(); + friend void protobuf_AddDesc_tensor_2eproto_impl(); + friend void protobuf_AssignDesc_tensor_2eproto(); + friend void protobuf_ShutdownFile_tensor_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed TensorProto_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// TensorProto + +// optional .tensorflow.DataType dtype = 1; +inline void TensorProto::clear_dtype() { + dtype_ = 0; +} +inline ::tensorflow::DataType TensorProto::dtype() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.dtype) + return static_cast< ::tensorflow::DataType >(dtype_); +} +inline void TensorProto::set_dtype(::tensorflow::DataType value) { + + dtype_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.dtype) +} + +// optional .tensorflow.TensorShapeProto tensor_shape = 2; +inline bool TensorProto::has_tensor_shape() const { + return this != internal_default_instance() && tensor_shape_ != NULL; +} +inline void TensorProto::clear_tensor_shape() { + if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) delete tensor_shape_; + tensor_shape_ = NULL; +} +inline const ::tensorflow::TensorShapeProto& TensorProto::tensor_shape() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.tensor_shape) + return tensor_shape_ != NULL ? *tensor_shape_ + : *::tensorflow::TensorShapeProto::internal_default_instance(); +} +inline ::tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() { + + if (tensor_shape_ == NULL) { + _slow_mutable_tensor_shape(); + } + // @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.tensor_shape) + return tensor_shape_; +} +inline ::tensorflow::TensorShapeProto* TensorProto::release_tensor_shape() { + // @@protoc_insertion_point(field_release:tensorflow.TensorProto.tensor_shape) + + if (GetArenaNoVirtual() != NULL) { + return _slow_release_tensor_shape(); + } else { + ::tensorflow::TensorShapeProto* temp = tensor_shape_; + tensor_shape_ = NULL; + return temp; + } +} +inline void TensorProto::set_allocated_tensor_shape(::tensorflow::TensorShapeProto* tensor_shape) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete tensor_shape_; + } + if (tensor_shape != NULL) { + _slow_set_allocated_tensor_shape(message_arena, &tensor_shape); + } + tensor_shape_ = tensor_shape; + if (tensor_shape) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:tensorflow.TensorProto.tensor_shape) +} + +// optional int32 version_number = 3; +inline void TensorProto::clear_version_number() { + version_number_ = 0; +} +inline ::google::protobuf::int32 TensorProto::version_number() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.version_number) + return version_number_; +} +inline void TensorProto::set_version_number(::google::protobuf::int32 value) { + + version_number_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.version_number) +} + +// optional bytes tensor_content = 4; +inline void TensorProto::clear_tensor_content() { + tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& TensorProto::tensor_content() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.tensor_content) + return tensor_content_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TensorProto::set_tensor_content(const ::std::string& value) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.tensor_content) +} +inline void TensorProto::set_tensor_content(const char* value) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.TensorProto.tensor_content) +} +inline void TensorProto::set_tensor_content(const void* value, + size_t size) { + + tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.TensorProto.tensor_content) +} +inline ::std::string* TensorProto::mutable_tensor_content() { + + // @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.tensor_content) + return tensor_content_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorProto::release_tensor_content() { + // @@protoc_insertion_point(field_release:tensorflow.TensorProto.tensor_content) + + return tensor_content_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorProto::unsafe_arena_release_tensor_content() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorProto.tensor_content) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return tensor_content_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void TensorProto::set_allocated_tensor_content(::std::string* tensor_content) { + if (tensor_content != NULL) { + + } else { + + } + tensor_content_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_content, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.TensorProto.tensor_content) +} +inline void TensorProto::unsafe_arena_set_allocated_tensor_content( + ::std::string* tensor_content) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (tensor_content != NULL) { + + } else { + + } + tensor_content_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + tensor_content, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorProto.tensor_content) +} + +// repeated int32 half_val = 13 [packed = true]; +inline int TensorProto::half_val_size() const { + return half_val_.size(); +} +inline void TensorProto::clear_half_val() { + half_val_.Clear(); +} +inline ::google::protobuf::int32 TensorProto::half_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.half_val) + return half_val_.Get(index); +} +inline void TensorProto::set_half_val(int index, ::google::protobuf::int32 value) { + half_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.half_val) +} +inline void TensorProto::add_half_val(::google::protobuf::int32 value) { + half_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.half_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TensorProto::half_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.half_val) + return half_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TensorProto::mutable_half_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.half_val) + return &half_val_; +} + +// repeated float float_val = 5 [packed = true]; +inline int TensorProto::float_val_size() const { + return float_val_.size(); +} +inline void TensorProto::clear_float_val() { + float_val_.Clear(); +} +inline float TensorProto::float_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.float_val) + return float_val_.Get(index); +} +inline void TensorProto::set_float_val(int index, float value) { + float_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.float_val) +} +inline void TensorProto::add_float_val(float value) { + float_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.float_val) +} +inline const ::google::protobuf::RepeatedField< float >& +TensorProto::float_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.float_val) + return float_val_; +} +inline ::google::protobuf::RepeatedField< float >* +TensorProto::mutable_float_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.float_val) + return &float_val_; +} + +// repeated double double_val = 6 [packed = true]; +inline int TensorProto::double_val_size() const { + return double_val_.size(); +} +inline void TensorProto::clear_double_val() { + double_val_.Clear(); +} +inline double TensorProto::double_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.double_val) + return double_val_.Get(index); +} +inline void TensorProto::set_double_val(int index, double value) { + double_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.double_val) +} +inline void TensorProto::add_double_val(double value) { + double_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.double_val) +} +inline const ::google::protobuf::RepeatedField< double >& +TensorProto::double_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.double_val) + return double_val_; +} +inline ::google::protobuf::RepeatedField< double >* +TensorProto::mutable_double_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.double_val) + return &double_val_; +} + +// repeated int32 int_val = 7 [packed = true]; +inline int TensorProto::int_val_size() const { + return int_val_.size(); +} +inline void TensorProto::clear_int_val() { + int_val_.Clear(); +} +inline ::google::protobuf::int32 TensorProto::int_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.int_val) + return int_val_.Get(index); +} +inline void TensorProto::set_int_val(int index, ::google::protobuf::int32 value) { + int_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.int_val) +} +inline void TensorProto::add_int_val(::google::protobuf::int32 value) { + int_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.int_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +TensorProto::int_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.int_val) + return int_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +TensorProto::mutable_int_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.int_val) + return &int_val_; +} + +// repeated bytes string_val = 8; +inline int TensorProto::string_val_size() const { + return string_val_.size(); +} +inline void TensorProto::clear_string_val() { + string_val_.Clear(); +} +inline const ::std::string& TensorProto::string_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.string_val) + return string_val_.Get(index); +} +inline ::std::string* TensorProto::mutable_string_val(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.string_val) + return string_val_.Mutable(index); +} +inline void TensorProto::set_string_val(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.string_val) + string_val_.Mutable(index)->assign(value); +} +inline void TensorProto::set_string_val(int index, const char* value) { + string_val_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:tensorflow.TensorProto.string_val) +} +inline void TensorProto::set_string_val(int index, const void* value, size_t size) { + string_val_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:tensorflow.TensorProto.string_val) +} +inline ::std::string* TensorProto::add_string_val() { + // @@protoc_insertion_point(field_add_mutable:tensorflow.TensorProto.string_val) + return string_val_.Add(); +} +inline void TensorProto::add_string_val(const ::std::string& value) { + string_val_.Add()->assign(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.string_val) +} +inline void TensorProto::add_string_val(const char* value) { + string_val_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:tensorflow.TensorProto.string_val) +} +inline void TensorProto::add_string_val(const void* value, size_t size) { + string_val_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:tensorflow.TensorProto.string_val) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +TensorProto::string_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.string_val) + return string_val_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +TensorProto::mutable_string_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.string_val) + return &string_val_; +} + +// repeated float scomplex_val = 9 [packed = true]; +inline int TensorProto::scomplex_val_size() const { + return scomplex_val_.size(); +} +inline void TensorProto::clear_scomplex_val() { + scomplex_val_.Clear(); +} +inline float TensorProto::scomplex_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.scomplex_val) + return scomplex_val_.Get(index); +} +inline void TensorProto::set_scomplex_val(int index, float value) { + scomplex_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.scomplex_val) +} +inline void TensorProto::add_scomplex_val(float value) { + scomplex_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.scomplex_val) +} +inline const ::google::protobuf::RepeatedField< float >& +TensorProto::scomplex_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.scomplex_val) + return scomplex_val_; +} +inline ::google::protobuf::RepeatedField< float >* +TensorProto::mutable_scomplex_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.scomplex_val) + return &scomplex_val_; +} + +// repeated int64 int64_val = 10 [packed = true]; +inline int TensorProto::int64_val_size() const { + return int64_val_.size(); +} +inline void TensorProto::clear_int64_val() { + int64_val_.Clear(); +} +inline ::google::protobuf::int64 TensorProto::int64_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.int64_val) + return int64_val_.Get(index); +} +inline void TensorProto::set_int64_val(int index, ::google::protobuf::int64 value) { + int64_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.int64_val) +} +inline void TensorProto::add_int64_val(::google::protobuf::int64 value) { + int64_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.int64_val) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +TensorProto::int64_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.int64_val) + return int64_val_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +TensorProto::mutable_int64_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.int64_val) + return &int64_val_; +} + +// repeated bool bool_val = 11 [packed = true]; +inline int TensorProto::bool_val_size() const { + return bool_val_.size(); +} +inline void TensorProto::clear_bool_val() { + bool_val_.Clear(); +} +inline bool TensorProto::bool_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.bool_val) + return bool_val_.Get(index); +} +inline void TensorProto::set_bool_val(int index, bool value) { + bool_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.bool_val) +} +inline void TensorProto::add_bool_val(bool value) { + bool_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.bool_val) +} +inline const ::google::protobuf::RepeatedField< bool >& +TensorProto::bool_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.bool_val) + return bool_val_; +} +inline ::google::protobuf::RepeatedField< bool >* +TensorProto::mutable_bool_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.bool_val) + return &bool_val_; +} + +// repeated double dcomplex_val = 12 [packed = true]; +inline int TensorProto::dcomplex_val_size() const { + return dcomplex_val_.size(); +} +inline void TensorProto::clear_dcomplex_val() { + dcomplex_val_.Clear(); +} +inline double TensorProto::dcomplex_val(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorProto.dcomplex_val) + return dcomplex_val_.Get(index); +} +inline void TensorProto::set_dcomplex_val(int index, double value) { + dcomplex_val_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.TensorProto.dcomplex_val) +} +inline void TensorProto::add_dcomplex_val(double value) { + dcomplex_val_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.TensorProto.dcomplex_val) +} +inline const ::google::protobuf::RepeatedField< double >& +TensorProto::dcomplex_val() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorProto.dcomplex_val) + return dcomplex_val_; +} +inline ::google::protobuf::RepeatedField< double >* +TensorProto::mutable_dcomplex_val() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.dcomplex_val) + return &dcomplex_val_; +} + +inline const TensorProto* TensorProto::internal_default_instance() { + return &TensorProto_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_tensor_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/tensor_shape.pb.cc b/modules/dnn/misc/tensorflow/tensor_shape.pb.cc new file mode 100644 index 0000000000..1e92ff8842 --- /dev/null +++ b/modules/dnn/misc/tensorflow/tensor_shape.pb.cc @@ -0,0 +1,895 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensor_shape.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "tensor_shape.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* TensorShapeProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TensorShapeProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* TensorShapeProto_Dim_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TensorShapeProto_Dim_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_tensor_5fshape_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_tensor_5fshape_2eproto() { + protobuf_AddDesc_tensor_5fshape_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "tensor_shape.proto"); + GOOGLE_CHECK(file != NULL); + TensorShapeProto_descriptor_ = file->message_type(0); + static const int TensorShapeProto_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapeProto, dim_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapeProto, unknown_rank_), + }; + TensorShapeProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TensorShapeProto_descriptor_, + TensorShapeProto::internal_default_instance(), + TensorShapeProto_offsets_, + -1, + -1, + -1, + sizeof(TensorShapeProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapeProto, _internal_metadata_)); + TensorShapeProto_Dim_descriptor_ = TensorShapeProto_descriptor_->nested_type(0); + static const int TensorShapeProto_Dim_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapeProto_Dim, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapeProto_Dim, name_), + }; + TensorShapeProto_Dim_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TensorShapeProto_Dim_descriptor_, + TensorShapeProto_Dim::internal_default_instance(), + TensorShapeProto_Dim_offsets_, + -1, + -1, + -1, + sizeof(TensorShapeProto_Dim), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapeProto_Dim, _internal_metadata_)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_tensor_5fshape_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TensorShapeProto_descriptor_, TensorShapeProto::internal_default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TensorShapeProto_Dim_descriptor_, TensorShapeProto_Dim::internal_default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_tensor_5fshape_2eproto() { + TensorShapeProto_default_instance_.Shutdown(); + delete TensorShapeProto_reflection_; + TensorShapeProto_Dim_default_instance_.Shutdown(); + delete TensorShapeProto_Dim_reflection_; +} + +void protobuf_InitDefaults_tensor_5fshape_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + TensorShapeProto_default_instance_.DefaultConstruct(); + ::google::protobuf::internal::GetEmptyString(); + TensorShapeProto_Dim_default_instance_.DefaultConstruct(); + TensorShapeProto_default_instance_.get_mutable()->InitAsDefaultInstance(); + TensorShapeProto_Dim_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_tensor_5fshape_2eproto_once_); +void protobuf_InitDefaults_tensor_5fshape_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_tensor_5fshape_2eproto_once_, + &protobuf_InitDefaults_tensor_5fshape_2eproto_impl); +} +void protobuf_AddDesc_tensor_5fshape_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_tensor_5fshape_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\022tensor_shape.proto\022\ntensorflow\"z\n\020Tens" + "orShapeProto\022-\n\003dim\030\002 \003(\0132 .tensorflow.T" + "ensorShapeProto.Dim\022\024\n\014unknown_rank\030\003 \001(" + "\010\032!\n\003Dim\022\014\n\004size\030\001 \001(\003\022\014\n\004name\030\002 \001(\tB2\n\030" + "org.tensorflow.frameworkB\021TensorShapePro" + "tosP\001\370\001\001b\006proto3", 216); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "tensor_shape.proto", &protobuf_RegisterTypes); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_tensor_5fshape_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_tensor_5fshape_2eproto_once_); +void protobuf_AddDesc_tensor_5fshape_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_tensor_5fshape_2eproto_once_, + &protobuf_AddDesc_tensor_5fshape_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_tensor_5fshape_2eproto { + StaticDescriptorInitializer_tensor_5fshape_2eproto() { + protobuf_AddDesc_tensor_5fshape_2eproto(); + } +} static_descriptor_initializer_tensor_5fshape_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorShapeProto_Dim::kSizeFieldNumber; +const int TensorShapeProto_Dim::kNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorShapeProto_Dim::TensorShapeProto_Dim() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_tensor_5fshape_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.TensorShapeProto.Dim) +} +TensorShapeProto_Dim::TensorShapeProto_Dim(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_tensor_5fshape_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.TensorShapeProto.Dim) +} + +void TensorShapeProto_Dim::InitAsDefaultInstance() { +} + +TensorShapeProto_Dim::TensorShapeProto_Dim(const TensorShapeProto_Dim& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.TensorShapeProto.Dim) +} + +void TensorShapeProto_Dim::SharedCtor() { + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + size_ = GOOGLE_LONGLONG(0); + _cached_size_ = 0; +} + +TensorShapeProto_Dim::~TensorShapeProto_Dim() { + // @@protoc_insertion_point(destructor:tensorflow.TensorShapeProto.Dim) + SharedDtor(); +} + +void TensorShapeProto_Dim::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + + name_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), arena); +} + +void TensorShapeProto_Dim::ArenaDtor(void* object) { + TensorShapeProto_Dim* _this = reinterpret_cast< TensorShapeProto_Dim* >(object); + (void)_this; +} +void TensorShapeProto_Dim::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorShapeProto_Dim::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TensorShapeProto_Dim::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TensorShapeProto_Dim_descriptor_; +} + +const TensorShapeProto_Dim& TensorShapeProto_Dim::default_instance() { + protobuf_InitDefaults_tensor_5fshape_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed TensorShapeProto_Dim_default_instance_; + +TensorShapeProto_Dim* TensorShapeProto_Dim::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void TensorShapeProto_Dim::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.TensorShapeProto.Dim) + size_ = GOOGLE_LONGLONG(0); + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} + +bool TensorShapeProto_Dim::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.TensorShapeProto.Dim) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int64 size = 1; + case 1: { + if (tag == 8) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &size_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_name; + break; + } + + // optional string name = 2; + case 2: { + if (tag == 18) { + parse_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "tensorflow.TensorShapeProto.Dim.name")); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.TensorShapeProto.Dim) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.TensorShapeProto.Dim) + return false; +#undef DO_ +} + +void TensorShapeProto_Dim::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.TensorShapeProto.Dim) + // optional int64 size = 1; + if (this->size() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->size(), output); + } + + // optional string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.TensorShapeProto.Dim.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->name(), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.TensorShapeProto.Dim) +} + +::google::protobuf::uint8* TensorShapeProto_Dim::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorShapeProto.Dim) + // optional int64 size = 1; + if (this->size() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->size(), target); + } + + // optional string name = 2; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "tensorflow.TensorShapeProto.Dim.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->name(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorShapeProto.Dim) + return target; +} + +size_t TensorShapeProto_Dim::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorShapeProto.Dim) + size_t total_size = 0; + + // optional int64 size = 1; + if (this->size() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->size()); + } + + // optional string name = 2; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TensorShapeProto_Dim::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorShapeProto.Dim) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const TensorShapeProto_Dim* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorShapeProto.Dim) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorShapeProto.Dim) + UnsafeMergeFrom(*source); + } +} + +void TensorShapeProto_Dim::MergeFrom(const TensorShapeProto_Dim& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorShapeProto.Dim) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void TensorShapeProto_Dim::UnsafeMergeFrom(const TensorShapeProto_Dim& from) { + GOOGLE_DCHECK(&from != this); + if (from.size() != 0) { + set_size(from.size()); + } + if (from.name().size() > 0) { + set_name(from.name()); + } +} + +void TensorShapeProto_Dim::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorShapeProto.Dim) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorShapeProto_Dim::CopyFrom(const TensorShapeProto_Dim& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorShapeProto.Dim) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool TensorShapeProto_Dim::IsInitialized() const { + + return true; +} + +void TensorShapeProto_Dim::Swap(TensorShapeProto_Dim* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorShapeProto_Dim temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void TensorShapeProto_Dim::UnsafeArenaSwap(TensorShapeProto_Dim* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorShapeProto_Dim::InternalSwap(TensorShapeProto_Dim* other) { + std::swap(size_, other->size_); + name_.Swap(&other->name_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata TensorShapeProto_Dim::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TensorShapeProto_Dim_descriptor_; + metadata.reflection = TensorShapeProto_Dim_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int TensorShapeProto::kDimFieldNumber; +const int TensorShapeProto::kUnknownRankFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +TensorShapeProto::TensorShapeProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_tensor_5fshape_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.TensorShapeProto) +} +TensorShapeProto::TensorShapeProto(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + dim_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_tensor_5fshape_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.TensorShapeProto) +} + +void TensorShapeProto::InitAsDefaultInstance() { +} + +TensorShapeProto::TensorShapeProto(const TensorShapeProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.TensorShapeProto) +} + +void TensorShapeProto::SharedCtor() { + unknown_rank_ = false; + _cached_size_ = 0; +} + +TensorShapeProto::~TensorShapeProto() { + // @@protoc_insertion_point(destructor:tensorflow.TensorShapeProto) + SharedDtor(); +} + +void TensorShapeProto::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + +} + +void TensorShapeProto::ArenaDtor(void* object) { + TensorShapeProto* _this = reinterpret_cast< TensorShapeProto* >(object); + (void)_this; +} +void TensorShapeProto::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void TensorShapeProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TensorShapeProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TensorShapeProto_descriptor_; +} + +const TensorShapeProto& TensorShapeProto::default_instance() { + protobuf_InitDefaults_tensor_5fshape_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed TensorShapeProto_default_instance_; + +TensorShapeProto* TensorShapeProto::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void TensorShapeProto::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.TensorShapeProto) + unknown_rank_ = false; + dim_.Clear(); +} + +bool TensorShapeProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.TensorShapeProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .tensorflow.TensorShapeProto.Dim dim = 2; + case 2: { + if (tag == 18) { + DO_(input->IncrementRecursionDepth()); + parse_loop_dim: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_dim())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_dim; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(24)) goto parse_unknown_rank; + break; + } + + // optional bool unknown_rank = 3; + case 3: { + if (tag == 24) { + parse_unknown_rank: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &unknown_rank_))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.TensorShapeProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.TensorShapeProto) + return false; +#undef DO_ +} + +void TensorShapeProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.TensorShapeProto) + // repeated .tensorflow.TensorShapeProto.Dim dim = 2; + for (unsigned int i = 0, n = this->dim_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->dim(i), output); + } + + // optional bool unknown_rank = 3; + if (this->unknown_rank() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->unknown_rank(), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.TensorShapeProto) +} + +::google::protobuf::uint8* TensorShapeProto::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorShapeProto) + // repeated .tensorflow.TensorShapeProto.Dim dim = 2; + for (unsigned int i = 0, n = this->dim_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageNoVirtualToArray( + 2, this->dim(i), false, target); + } + + // optional bool unknown_rank = 3; + if (this->unknown_rank() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->unknown_rank(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorShapeProto) + return target; +} + +size_t TensorShapeProto::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorShapeProto) + size_t total_size = 0; + + // optional bool unknown_rank = 3; + if (this->unknown_rank() != 0) { + total_size += 1 + 1; + } + + // repeated .tensorflow.TensorShapeProto.Dim dim = 2; + { + unsigned int count = this->dim_size(); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dim(i)); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TensorShapeProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorShapeProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const TensorShapeProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorShapeProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorShapeProto) + UnsafeMergeFrom(*source); + } +} + +void TensorShapeProto::MergeFrom(const TensorShapeProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorShapeProto) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void TensorShapeProto::UnsafeMergeFrom(const TensorShapeProto& from) { + GOOGLE_DCHECK(&from != this); + dim_.MergeFrom(from.dim_); + if (from.unknown_rank() != 0) { + set_unknown_rank(from.unknown_rank()); + } +} + +void TensorShapeProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorShapeProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TensorShapeProto::CopyFrom(const TensorShapeProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorShapeProto) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool TensorShapeProto::IsInitialized() const { + + return true; +} + +void TensorShapeProto::Swap(TensorShapeProto* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + TensorShapeProto temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void TensorShapeProto::UnsafeArenaSwap(TensorShapeProto* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void TensorShapeProto::InternalSwap(TensorShapeProto* other) { + dim_.UnsafeArenaSwap(&other->dim_); + std::swap(unknown_rank_, other->unknown_rank_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata TensorShapeProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TensorShapeProto_descriptor_; + metadata.reflection = TensorShapeProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// TensorShapeProto_Dim + +// optional int64 size = 1; +void TensorShapeProto_Dim::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +::google::protobuf::int64 TensorShapeProto_Dim::size() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.Dim.size) + return size_; +} +void TensorShapeProto_Dim::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.Dim.size) +} + +// optional string name = 2; +void TensorShapeProto_Dim::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +const ::std::string& TensorShapeProto_Dim::name() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.Dim.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +void TensorShapeProto_Dim::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.Dim.name) +} +void TensorShapeProto_Dim::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.TensorShapeProto.Dim.name) +} +void TensorShapeProto_Dim::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.TensorShapeProto.Dim.name) +} +::std::string* TensorShapeProto_Dim::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.TensorShapeProto.Dim.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* TensorShapeProto_Dim::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.TensorShapeProto.Dim.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +::std::string* TensorShapeProto_Dim::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorShapeProto.Dim.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +void TensorShapeProto_Dim::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.TensorShapeProto.Dim.name) +} +void TensorShapeProto_Dim::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorShapeProto.Dim.name) +} + +inline const TensorShapeProto_Dim* TensorShapeProto_Dim::internal_default_instance() { + return &TensorShapeProto_Dim_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// TensorShapeProto + +// repeated .tensorflow.TensorShapeProto.Dim dim = 2; +int TensorShapeProto::dim_size() const { + return dim_.size(); +} +void TensorShapeProto::clear_dim() { + dim_.Clear(); +} +const ::tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.dim) + return dim_.Get(index); +} +::tensorflow::TensorShapeProto_Dim* TensorShapeProto::mutable_dim(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.TensorShapeProto.dim) + return dim_.Mutable(index); +} +::tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() { + // @@protoc_insertion_point(field_add:tensorflow.TensorShapeProto.dim) + return dim_.Add(); +} +::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >* +TensorShapeProto::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorShapeProto.dim) + return &dim_; +} +const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >& +TensorShapeProto::dim() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorShapeProto.dim) + return dim_; +} + +// optional bool unknown_rank = 3; +void TensorShapeProto::clear_unknown_rank() { + unknown_rank_ = false; +} +bool TensorShapeProto::unknown_rank() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.unknown_rank) + return unknown_rank_; +} +void TensorShapeProto::set_unknown_rank(bool value) { + + unknown_rank_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.unknown_rank) +} + +inline const TensorShapeProto* TensorShapeProto::internal_default_instance() { + return &TensorShapeProto_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/tensor_shape.pb.h b/modules/dnn/misc/tensorflow/tensor_shape.pb.h new file mode 100644 index 0000000000..df66bfccae --- /dev/null +++ b/modules/dnn/misc/tensorflow/tensor_shape.pb.h @@ -0,0 +1,423 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensor_shape.proto + +#ifndef PROTOBUF_tensor_5fshape_2eproto__INCLUDED +#define PROTOBUF_tensor_5fshape_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_tensor_5fshape_2eproto(); +void protobuf_InitDefaults_tensor_5fshape_2eproto(); +void protobuf_AssignDesc_tensor_5fshape_2eproto(); +void protobuf_ShutdownFile_tensor_5fshape_2eproto(); + +class TensorShapeProto; +class TensorShapeProto_Dim; + +// =================================================================== + +class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.TensorShapeProto.Dim) */ { + public: + TensorShapeProto_Dim(); + virtual ~TensorShapeProto_Dim(); + + TensorShapeProto_Dim(const TensorShapeProto_Dim& from); + + inline TensorShapeProto_Dim& operator=(const TensorShapeProto_Dim& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorShapeProto_Dim& default_instance(); + + static const TensorShapeProto_Dim* internal_default_instance(); + + void UnsafeArenaSwap(TensorShapeProto_Dim* other); + void Swap(TensorShapeProto_Dim* other); + + // implements Message ---------------------------------------------- + + inline TensorShapeProto_Dim* New() const { return New(NULL); } + + TensorShapeProto_Dim* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TensorShapeProto_Dim& from); + void MergeFrom(const TensorShapeProto_Dim& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TensorShapeProto_Dim* other); + void UnsafeMergeFrom(const TensorShapeProto_Dim& from); + protected: + explicit TensorShapeProto_Dim(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int64 size = 1; + void clear_size(); + static const int kSizeFieldNumber = 1; + ::google::protobuf::int64 size() const; + void set_size(::google::protobuf::int64 value); + + // optional string name = 2; + void clear_name(); + static const int kNameFieldNumber = 2; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + ::std::string* unsafe_arena_release_name(); + void unsafe_arena_set_allocated_name( + ::std::string* name); + + // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto.Dim) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::int64 size_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_tensor_5fshape_2eproto_impl(); + friend void protobuf_AddDesc_tensor_5fshape_2eproto_impl(); + friend void protobuf_AssignDesc_tensor_5fshape_2eproto(); + friend void protobuf_ShutdownFile_tensor_5fshape_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed TensorShapeProto_Dim_default_instance_; + +// ------------------------------------------------------------------- + +class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.TensorShapeProto) */ { + public: + TensorShapeProto(); + virtual ~TensorShapeProto(); + + TensorShapeProto(const TensorShapeProto& from); + + inline TensorShapeProto& operator=(const TensorShapeProto& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const TensorShapeProto& default_instance(); + + static const TensorShapeProto* internal_default_instance(); + + void UnsafeArenaSwap(TensorShapeProto* other); + void Swap(TensorShapeProto* other); + + // implements Message ---------------------------------------------- + + inline TensorShapeProto* New() const { return New(NULL); } + + TensorShapeProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TensorShapeProto& from); + void MergeFrom(const TensorShapeProto& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TensorShapeProto* other); + void UnsafeMergeFrom(const TensorShapeProto& from); + protected: + explicit TensorShapeProto(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef TensorShapeProto_Dim Dim; + + // accessors ------------------------------------------------------- + + // repeated .tensorflow.TensorShapeProto.Dim dim = 2; + int dim_size() const; + void clear_dim(); + static const int kDimFieldNumber = 2; + const ::tensorflow::TensorShapeProto_Dim& dim(int index) const; + ::tensorflow::TensorShapeProto_Dim* mutable_dim(int index); + ::tensorflow::TensorShapeProto_Dim* add_dim(); + ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >* + mutable_dim(); + const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >& + dim() const; + + // optional bool unknown_rank = 3; + void clear_unknown_rank(); + static const int kUnknownRankFieldNumber = 3; + bool unknown_rank() const; + void set_unknown_rank(bool value); + + // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim > dim_; + bool unknown_rank_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_tensor_5fshape_2eproto_impl(); + friend void protobuf_AddDesc_tensor_5fshape_2eproto_impl(); + friend void protobuf_AssignDesc_tensor_5fshape_2eproto(); + friend void protobuf_ShutdownFile_tensor_5fshape_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed TensorShapeProto_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// TensorShapeProto_Dim + +// optional int64 size = 1; +inline void TensorShapeProto_Dim::clear_size() { + size_ = GOOGLE_LONGLONG(0); +} +inline ::google::protobuf::int64 TensorShapeProto_Dim::size() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.Dim.size) + return size_; +} +inline void TensorShapeProto_Dim::set_size(::google::protobuf::int64 value) { + + size_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.Dim.size) +} + +// optional string name = 2; +inline void TensorShapeProto_Dim::clear_name() { + name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline const ::std::string& TensorShapeProto_Dim::name() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.Dim.name) + return name_.Get(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void TensorShapeProto_Dim::set_name(const ::std::string& value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.Dim.name) +} +inline void TensorShapeProto_Dim::set_name(const char* value) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_char:tensorflow.TensorShapeProto.Dim.name) +} +inline void TensorShapeProto_Dim::set_name(const char* value, + size_t size) { + + name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_pointer:tensorflow.TensorShapeProto.Dim.name) +} +inline ::std::string* TensorShapeProto_Dim::mutable_name() { + + // @@protoc_insertion_point(field_mutable:tensorflow.TensorShapeProto.Dim.name) + return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorShapeProto_Dim::release_name() { + // @@protoc_insertion_point(field_release:tensorflow.TensorShapeProto.Dim.name) + + return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); +} +inline ::std::string* TensorShapeProto_Dim::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorShapeProto.Dim.name) + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + + return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} +inline void TensorShapeProto_Dim::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, + GetArenaNoVirtual()); + // @@protoc_insertion_point(field_set_allocated:tensorflow.TensorShapeProto.Dim.name) +} +inline void TensorShapeProto_Dim::unsafe_arena_set_allocated_name( + ::std::string* name) { + GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + if (name != NULL) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + name, GetArenaNoVirtual()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorShapeProto.Dim.name) +} + +inline const TensorShapeProto_Dim* TensorShapeProto_Dim::internal_default_instance() { + return &TensorShapeProto_Dim_default_instance_.get(); +} +// ------------------------------------------------------------------- + +// TensorShapeProto + +// repeated .tensorflow.TensorShapeProto.Dim dim = 2; +inline int TensorShapeProto::dim_size() const { + return dim_.size(); +} +inline void TensorShapeProto::clear_dim() { + dim_.Clear(); +} +inline const ::tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.dim) + return dim_.Get(index); +} +inline ::tensorflow::TensorShapeProto_Dim* TensorShapeProto::mutable_dim(int index) { + // @@protoc_insertion_point(field_mutable:tensorflow.TensorShapeProto.dim) + return dim_.Mutable(index); +} +inline ::tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() { + // @@protoc_insertion_point(field_add:tensorflow.TensorShapeProto.dim) + return dim_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >* +TensorShapeProto::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.TensorShapeProto.dim) + return &dim_; +} +inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >& +TensorShapeProto::dim() const { + // @@protoc_insertion_point(field_list:tensorflow.TensorShapeProto.dim) + return dim_; +} + +// optional bool unknown_rank = 3; +inline void TensorShapeProto::clear_unknown_rank() { + unknown_rank_ = false; +} +inline bool TensorShapeProto::unknown_rank() const { + // @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.unknown_rank) + return unknown_rank_; +} +inline void TensorShapeProto::set_unknown_rank(bool value) { + + unknown_rank_ = value; + // @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.unknown_rank) +} + +inline const TensorShapeProto* TensorShapeProto::internal_default_instance() { + return &TensorShapeProto_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_tensor_5fshape_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/types.pb.cc b/modules/dnn/misc/tensorflow/types.pb.cc new file mode 100644 index 0000000000..0e509cc200 --- /dev/null +++ b/modules/dnn/misc/tensorflow/types.pb.cc @@ -0,0 +1,163 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: types.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "types.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::EnumDescriptor* DataType_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_types_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_types_2eproto() { + protobuf_AddDesc_types_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "types.proto"); + GOOGLE_CHECK(file != NULL); + DataType_descriptor_ = file->enum_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_types_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); +} + +} // namespace + +void protobuf_ShutdownFile_types_2eproto() { +} + +void protobuf_InitDefaults_types_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_types_2eproto_once_); +void protobuf_InitDefaults_types_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_types_2eproto_once_, + &protobuf_InitDefaults_types_2eproto_impl); +} +void protobuf_AddDesc_types_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_types_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\013types.proto\022\ntensorflow*\234\005\n\010DataType\022\016" + "\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tDT_DOUBL" + "E\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014\n\010DT_IN" + "T16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007\022\020\n\014DT_" + "COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_BOOL\020\n\022\014" + "\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT_QINT32" + "\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020\017\022\016\n\nDT" + "_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_COMPLEX1" + "28\020\022\022\013\n\007DT_HALF\020\023\022\020\n\014DT_FLOAT_REF\020e\022\021\n\rD" + "T_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020g\022\020\n\014DT_U" + "INT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n\013DT_INT8_" + "REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_COMPLEX64" + "_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_BOOL_REF\020" + "n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT8_REF\020p\022\021" + "\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT16_REF\020r\022\021" + "\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16_REF\020t\022\021\n" + "\rDT_UINT16_REF\020u\022\025\n\021DT_COMPLEX128_REF\020v\022" + "\017\n\013DT_HALF_REF\020wB,\n\030org.tensorflow.frame" + "workB\013TypesProtosP\001\370\001\001b\006proto3", 750); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "types.proto", &protobuf_RegisterTypes); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_types_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_types_2eproto_once_); +void protobuf_AddDesc_types_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_types_2eproto_once_, + &protobuf_AddDesc_types_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_types_2eproto { + StaticDescriptorInitializer_types_2eproto() { + protobuf_AddDesc_types_2eproto(); + } +} static_descriptor_initializer_types_2eproto_; +const ::google::protobuf::EnumDescriptor* DataType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataType_descriptor_; +} +bool DataType_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: + case 19: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + return true; + default: + return false; + } +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/types.pb.h b/modules/dnn/misc/tensorflow/types.pb.h new file mode 100644 index 0000000000..40ed7b856f --- /dev/null +++ b/modules/dnn/misc/tensorflow/types.pb.h @@ -0,0 +1,129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: types.proto + +#ifndef PROTOBUF_types_2eproto__INCLUDED +#define PROTOBUF_types_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_types_2eproto(); +void protobuf_InitDefaults_types_2eproto(); +void protobuf_AssignDesc_types_2eproto(); +void protobuf_ShutdownFile_types_2eproto(); + + +enum DataType { + DT_INVALID = 0, + DT_FLOAT = 1, + DT_DOUBLE = 2, + DT_INT32 = 3, + DT_UINT8 = 4, + DT_INT16 = 5, + DT_INT8 = 6, + DT_STRING = 7, + DT_COMPLEX64 = 8, + DT_INT64 = 9, + DT_BOOL = 10, + DT_QINT8 = 11, + DT_QUINT8 = 12, + DT_QINT32 = 13, + DT_BFLOAT16 = 14, + DT_QINT16 = 15, + DT_QUINT16 = 16, + DT_UINT16 = 17, + DT_COMPLEX128 = 18, + DT_HALF = 19, + DT_FLOAT_REF = 101, + DT_DOUBLE_REF = 102, + DT_INT32_REF = 103, + DT_UINT8_REF = 104, + DT_INT16_REF = 105, + DT_INT8_REF = 106, + DT_STRING_REF = 107, + DT_COMPLEX64_REF = 108, + DT_INT64_REF = 109, + DT_BOOL_REF = 110, + DT_QINT8_REF = 111, + DT_QUINT8_REF = 112, + DT_QINT32_REF = 113, + DT_BFLOAT16_REF = 114, + DT_QINT16_REF = 115, + DT_QUINT16_REF = 116, + DT_UINT16_REF = 117, + DT_COMPLEX128_REF = 118, + DT_HALF_REF = 119, + DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, + DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max +}; +bool DataType_IsValid(int value); +const DataType DataType_MIN = DT_INVALID; +const DataType DataType_MAX = DT_HALF_REF; +const int DataType_ARRAYSIZE = DataType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* DataType_descriptor(); +inline const ::std::string& DataType_Name(DataType value) { + return ::google::protobuf::internal::NameOfEnum( + DataType_descriptor(), value); +} +inline bool DataType_Parse( + const ::std::string& name, DataType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + DataType_descriptor(), name, value); +} +// =================================================================== + + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::tensorflow::DataType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::tensorflow::DataType>() { + return ::tensorflow::DataType_descriptor(); +} + +} // namespace protobuf +} // namespace google +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_types_2eproto__INCLUDED diff --git a/modules/dnn/misc/tensorflow/versions.pb.cc b/modules/dnn/misc/tensorflow/versions.pb.cc new file mode 100644 index 0000000000..a4556a0ff7 --- /dev/null +++ b/modules/dnn/misc/tensorflow/versions.pb.cc @@ -0,0 +1,572 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: versions.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "versions.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +namespace { + +const ::google::protobuf::Descriptor* VersionDef_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + VersionDef_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_versions_2eproto() GOOGLE_ATTRIBUTE_COLD; +void protobuf_AssignDesc_versions_2eproto() { + protobuf_AddDesc_versions_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "versions.proto"); + GOOGLE_CHECK(file != NULL); + VersionDef_descriptor_ = file->message_type(0); + static const int VersionDef_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(VersionDef, producer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(VersionDef, min_consumer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(VersionDef, bad_consumers_), + }; + VersionDef_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + VersionDef_descriptor_, + VersionDef::internal_default_instance(), + VersionDef_offsets_, + -1, + -1, + -1, + sizeof(VersionDef), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(VersionDef, _internal_metadata_)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_versions_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + VersionDef_descriptor_, VersionDef::internal_default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_versions_2eproto() { + VersionDef_default_instance_.Shutdown(); + delete VersionDef_reflection_; +} + +void protobuf_InitDefaults_versions_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + VersionDef_default_instance_.DefaultConstruct(); + VersionDef_default_instance_.get_mutable()->InitAsDefaultInstance(); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_versions_2eproto_once_); +void protobuf_InitDefaults_versions_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_versions_2eproto_once_, + &protobuf_InitDefaults_versions_2eproto_impl); +} +void protobuf_AddDesc_versions_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + protobuf_InitDefaults_versions_2eproto(); + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\016versions.proto\022\ntensorflow\"K\n\nVersionD" + "ef\022\020\n\010producer\030\001 \001(\005\022\024\n\014min_consumer\030\002 \001" + "(\005\022\025\n\rbad_consumers\030\003 \003(\005B/\n\030org.tensorf" + "low.frameworkB\016VersionsProtosP\001\370\001\001b\006prot" + "o3", 162); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "versions.proto", &protobuf_RegisterTypes); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_versions_2eproto); +} + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_versions_2eproto_once_); +void protobuf_AddDesc_versions_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_versions_2eproto_once_, + &protobuf_AddDesc_versions_2eproto_impl); +} +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_versions_2eproto { + StaticDescriptorInitializer_versions_2eproto() { + protobuf_AddDesc_versions_2eproto(); + } +} static_descriptor_initializer_versions_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; +static void MergeFromFail(int line) { + ::google::protobuf::internal::MergeFromFail(__FILE__, line); +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int VersionDef::kProducerFieldNumber; +const int VersionDef::kMinConsumerFieldNumber; +const int VersionDef::kBadConsumersFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +VersionDef::VersionDef() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + if (this != internal_default_instance()) protobuf_InitDefaults_versions_2eproto(); + SharedCtor(); + // @@protoc_insertion_point(constructor:tensorflow.VersionDef) +} +VersionDef::VersionDef(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(), + _internal_metadata_(arena), + bad_consumers_(arena) { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_InitDefaults_versions_2eproto(); +#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:tensorflow.VersionDef) +} + +void VersionDef::InitAsDefaultInstance() { +} + +VersionDef::VersionDef(const VersionDef& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + UnsafeMergeFrom(from); + // @@protoc_insertion_point(copy_constructor:tensorflow.VersionDef) +} + +void VersionDef::SharedCtor() { + ::memset(&producer_, 0, reinterpret_cast(&min_consumer_) - + reinterpret_cast(&producer_) + sizeof(min_consumer_)); + _cached_size_ = 0; +} + +VersionDef::~VersionDef() { + // @@protoc_insertion_point(destructor:tensorflow.VersionDef) + SharedDtor(); +} + +void VersionDef::SharedDtor() { + ::google::protobuf::Arena* arena = GetArenaNoVirtual(); + if (arena != NULL) { + return; + } + +} + +void VersionDef::ArenaDtor(void* object) { + VersionDef* _this = reinterpret_cast< VersionDef* >(object); + (void)_this; +} +void VersionDef::RegisterArenaDtor(::google::protobuf::Arena* arena) { +} +void VersionDef::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* VersionDef::descriptor() { + protobuf_AssignDescriptorsOnce(); + return VersionDef_descriptor_; +} + +const VersionDef& VersionDef::default_instance() { + protobuf_InitDefaults_versions_2eproto(); + return *internal_default_instance(); +} + +::google::protobuf::internal::ExplicitlyConstructed VersionDef_default_instance_; + +VersionDef* VersionDef::New(::google::protobuf::Arena* arena) const { + return ::google::protobuf::Arena::CreateMessage(arena); +} + +void VersionDef::Clear() { +// @@protoc_insertion_point(message_clear_start:tensorflow.VersionDef) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(VersionDef, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&(first), 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(producer_, min_consumer_); + +#undef ZR_HELPER_ +#undef ZR_ + + bad_consumers_.Clear(); +} + +bool VersionDef::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:tensorflow.VersionDef) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 producer = 1; + case 1: { + if (tag == 8) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &producer_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_min_consumer; + break; + } + + // optional int32 min_consumer = 2; + case 2: { + if (tag == 16) { + parse_min_consumer: + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_consumer_))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_bad_consumers; + break; + } + + // repeated int32 bad_consumers = 3; + case 3: { + if (tag == 26) { + parse_bad_consumers: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_bad_consumers()))); + } else if (tag == 24) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 26, input, this->mutable_bad_consumers()))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:tensorflow.VersionDef) + return true; +failure: + // @@protoc_insertion_point(parse_failure:tensorflow.VersionDef) + return false; +#undef DO_ +} + +void VersionDef::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:tensorflow.VersionDef) + // optional int32 producer = 1; + if (this->producer() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->producer(), output); + } + + // optional int32 min_consumer = 2; + if (this->min_consumer() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->min_consumer(), output); + } + + // repeated int32 bad_consumers = 3; + if (this->bad_consumers_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_bad_consumers_cached_byte_size_); + } + for (int i = 0; i < this->bad_consumers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->bad_consumers(i), output); + } + + // @@protoc_insertion_point(serialize_end:tensorflow.VersionDef) +} + +::google::protobuf::uint8* VersionDef::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:tensorflow.VersionDef) + // optional int32 producer = 1; + if (this->producer() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->producer(), target); + } + + // optional int32 min_consumer = 2; + if (this->min_consumer() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->min_consumer(), target); + } + + // repeated int32 bad_consumers = 3; + if (this->bad_consumers_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _bad_consumers_cached_byte_size_, target); + } + for (int i = 0; i < this->bad_consumers_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->bad_consumers(i), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:tensorflow.VersionDef) + return target; +} + +size_t VersionDef::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:tensorflow.VersionDef) + size_t total_size = 0; + + // optional int32 producer = 1; + if (this->producer() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->producer()); + } + + // optional int32 min_consumer = 2; + if (this->min_consumer() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->min_consumer()); + } + + // repeated int32 bad_consumers = 3; + { + size_t data_size = 0; + unsigned int count = this->bad_consumers_size(); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->bad_consumers(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _bad_consumers_cached_byte_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void VersionDef::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.VersionDef) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const VersionDef* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.VersionDef) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.VersionDef) + UnsafeMergeFrom(*source); + } +} + +void VersionDef::MergeFrom(const VersionDef& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.VersionDef) + if (GOOGLE_PREDICT_TRUE(&from != this)) { + UnsafeMergeFrom(from); + } else { + MergeFromFail(__LINE__); + } +} + +void VersionDef::UnsafeMergeFrom(const VersionDef& from) { + GOOGLE_DCHECK(&from != this); + bad_consumers_.UnsafeMergeFrom(from.bad_consumers_); + if (from.producer() != 0) { + set_producer(from.producer()); + } + if (from.min_consumer() != 0) { + set_min_consumer(from.min_consumer()); + } +} + +void VersionDef::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.VersionDef) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void VersionDef::CopyFrom(const VersionDef& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.VersionDef) + if (&from == this) return; + Clear(); + UnsafeMergeFrom(from); +} + +bool VersionDef::IsInitialized() const { + + return true; +} + +void VersionDef::Swap(VersionDef* other) { + if (other == this) return; + if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { + InternalSwap(other); + } else { + VersionDef temp; + temp.UnsafeMergeFrom(*this); + CopyFrom(*other); + other->CopyFrom(temp); + } +} +void VersionDef::UnsafeArenaSwap(VersionDef* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); + InternalSwap(other); +} +void VersionDef::InternalSwap(VersionDef* other) { + std::swap(producer_, other->producer_); + std::swap(min_consumer_, other->min_consumer_); + bad_consumers_.UnsafeArenaSwap(&other->bad_consumers_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata VersionDef::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = VersionDef_descriptor_; + metadata.reflection = VersionDef_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// VersionDef + +// optional int32 producer = 1; +void VersionDef::clear_producer() { + producer_ = 0; +} +::google::protobuf::int32 VersionDef::producer() const { + // @@protoc_insertion_point(field_get:tensorflow.VersionDef.producer) + return producer_; +} +void VersionDef::set_producer(::google::protobuf::int32 value) { + + producer_ = value; + // @@protoc_insertion_point(field_set:tensorflow.VersionDef.producer) +} + +// optional int32 min_consumer = 2; +void VersionDef::clear_min_consumer() { + min_consumer_ = 0; +} +::google::protobuf::int32 VersionDef::min_consumer() const { + // @@protoc_insertion_point(field_get:tensorflow.VersionDef.min_consumer) + return min_consumer_; +} +void VersionDef::set_min_consumer(::google::protobuf::int32 value) { + + min_consumer_ = value; + // @@protoc_insertion_point(field_set:tensorflow.VersionDef.min_consumer) +} + +// repeated int32 bad_consumers = 3; +int VersionDef::bad_consumers_size() const { + return bad_consumers_.size(); +} +void VersionDef::clear_bad_consumers() { + bad_consumers_.Clear(); +} +::google::protobuf::int32 VersionDef::bad_consumers(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.VersionDef.bad_consumers) + return bad_consumers_.Get(index); +} +void VersionDef::set_bad_consumers(int index, ::google::protobuf::int32 value) { + bad_consumers_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.VersionDef.bad_consumers) +} +void VersionDef::add_bad_consumers(::google::protobuf::int32 value) { + bad_consumers_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.VersionDef.bad_consumers) +} +const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +VersionDef::bad_consumers() const { + // @@protoc_insertion_point(field_list:tensorflow.VersionDef.bad_consumers) + return bad_consumers_; +} +::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +VersionDef::mutable_bad_consumers() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.VersionDef.bad_consumers) + return &bad_consumers_; +} + +inline const VersionDef* VersionDef::internal_default_instance() { + return &VersionDef_default_instance_.get(); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) diff --git a/modules/dnn/misc/tensorflow/versions.pb.h b/modules/dnn/misc/tensorflow/versions.pb.h new file mode 100644 index 0000000000..ce099cbf48 --- /dev/null +++ b/modules/dnn/misc/tensorflow/versions.pb.h @@ -0,0 +1,239 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: versions.proto + +#ifndef PROTOBUF_versions_2eproto__INCLUDED +#define PROTOBUF_versions_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3001000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace tensorflow { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_versions_2eproto(); +void protobuf_InitDefaults_versions_2eproto(); +void protobuf_AssignDesc_versions_2eproto(); +void protobuf_ShutdownFile_versions_2eproto(); + +class VersionDef; + +// =================================================================== + +class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.VersionDef) */ { + public: + VersionDef(); + virtual ~VersionDef(); + + VersionDef(const VersionDef& from); + + inline VersionDef& operator=(const VersionDef& from) { + CopyFrom(from); + return *this; + } + + inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } + inline void* GetMaybeArenaPointer() const { + return MaybeArenaPtr(); + } + static const ::google::protobuf::Descriptor* descriptor(); + static const VersionDef& default_instance(); + + static const VersionDef* internal_default_instance(); + + void UnsafeArenaSwap(VersionDef* other); + void Swap(VersionDef* other); + + // implements Message ---------------------------------------------- + + inline VersionDef* New() const { return New(NULL); } + + VersionDef* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const VersionDef& from); + void MergeFrom(const VersionDef& from); + void Clear(); + bool IsInitialized() const; + + size_t ByteSizeLong() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { + return InternalSerializeWithCachedSizesToArray(false, output); + } + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VersionDef* other); + void UnsafeMergeFrom(const VersionDef& from); + protected: + explicit VersionDef(::google::protobuf::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::google::protobuf::Arena* arena); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 producer = 1; + void clear_producer(); + static const int kProducerFieldNumber = 1; + ::google::protobuf::int32 producer() const; + void set_producer(::google::protobuf::int32 value); + + // optional int32 min_consumer = 2; + void clear_min_consumer(); + static const int kMinConsumerFieldNumber = 2; + ::google::protobuf::int32 min_consumer() const; + void set_min_consumer(::google::protobuf::int32 value); + + // repeated int32 bad_consumers = 3; + int bad_consumers_size() const; + void clear_bad_consumers(); + static const int kBadConsumersFieldNumber = 3; + ::google::protobuf::int32 bad_consumers(int index) const; + void set_bad_consumers(int index, ::google::protobuf::int32 value); + void add_bad_consumers(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + bad_consumers() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_bad_consumers(); + + // @@protoc_insertion_point(class_scope:tensorflow.VersionDef) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + friend class ::google::protobuf::Arena; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > bad_consumers_; + mutable int _bad_consumers_cached_byte_size_; + ::google::protobuf::int32 producer_; + ::google::protobuf::int32 min_consumer_; + mutable int _cached_size_; + friend void protobuf_InitDefaults_versions_2eproto_impl(); + friend void protobuf_AddDesc_versions_2eproto_impl(); + friend void protobuf_AssignDesc_versions_2eproto(); + friend void protobuf_ShutdownFile_versions_2eproto(); + + void InitAsDefaultInstance(); +}; +extern ::google::protobuf::internal::ExplicitlyConstructed VersionDef_default_instance_; + +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// VersionDef + +// optional int32 producer = 1; +inline void VersionDef::clear_producer() { + producer_ = 0; +} +inline ::google::protobuf::int32 VersionDef::producer() const { + // @@protoc_insertion_point(field_get:tensorflow.VersionDef.producer) + return producer_; +} +inline void VersionDef::set_producer(::google::protobuf::int32 value) { + + producer_ = value; + // @@protoc_insertion_point(field_set:tensorflow.VersionDef.producer) +} + +// optional int32 min_consumer = 2; +inline void VersionDef::clear_min_consumer() { + min_consumer_ = 0; +} +inline ::google::protobuf::int32 VersionDef::min_consumer() const { + // @@protoc_insertion_point(field_get:tensorflow.VersionDef.min_consumer) + return min_consumer_; +} +inline void VersionDef::set_min_consumer(::google::protobuf::int32 value) { + + min_consumer_ = value; + // @@protoc_insertion_point(field_set:tensorflow.VersionDef.min_consumer) +} + +// repeated int32 bad_consumers = 3; +inline int VersionDef::bad_consumers_size() const { + return bad_consumers_.size(); +} +inline void VersionDef::clear_bad_consumers() { + bad_consumers_.Clear(); +} +inline ::google::protobuf::int32 VersionDef::bad_consumers(int index) const { + // @@protoc_insertion_point(field_get:tensorflow.VersionDef.bad_consumers) + return bad_consumers_.Get(index); +} +inline void VersionDef::set_bad_consumers(int index, ::google::protobuf::int32 value) { + bad_consumers_.Set(index, value); + // @@protoc_insertion_point(field_set:tensorflow.VersionDef.bad_consumers) +} +inline void VersionDef::add_bad_consumers(::google::protobuf::int32 value) { + bad_consumers_.Add(value); + // @@protoc_insertion_point(field_add:tensorflow.VersionDef.bad_consumers) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +VersionDef::bad_consumers() const { + // @@protoc_insertion_point(field_list:tensorflow.VersionDef.bad_consumers) + return bad_consumers_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +VersionDef::mutable_bad_consumers() { + // @@protoc_insertion_point(field_mutable_list:tensorflow.VersionDef.bad_consumers) + return &bad_consumers_; +} + +inline const VersionDef* VersionDef::internal_default_instance() { + return &VersionDef_default_instance_.get(); +} +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace tensorflow + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_versions_2eproto__INCLUDED diff --git a/modules/dnn/perf/perf_convolution.cpp b/modules/dnn/perf/perf_convolution.cpp new file mode 100644 index 0000000000..502c5ef822 --- /dev/null +++ b/modules/dnn/perf/perf_convolution.cpp @@ -0,0 +1,106 @@ +#include "perf_precomp.hpp" +#include + +namespace cvtest +{ + +using std::tr1::tuple; +using std::tr1::get; +using std::tr1::make_tuple; +using std::make_pair; +using namespace perf; +using namespace testing; +using namespace cv; +using namespace cv::dnn; + +enum {STRIDE_OFF = 1, STRIDE_ON = 2}; +CV_ENUM(StrideSize, STRIDE_OFF, STRIDE_ON); + +enum {GROUP_OFF = 1, GROUP_2 = 2}; +CV_ENUM(GroupSize, GROUP_OFF, GROUP_2); + +//Squared Size +#define SSZ(n) cv::Size(n, n) + +typedef std::pair InpShapeNumOut; +typedef tuple ConvParam; //kernel_size, inp shape, groups, stride +typedef TestBaseWithParam ConvolutionPerfTest; + +static inline MatShape blobShape(int count, int nplanes, int height, int width) +{ + int data[] = {count, nplanes, height, width}; + return MatShape(data, data+4); +} + +PERF_TEST_P( ConvolutionPerfTest, perf, Combine( + Values(Size(1, 1), Size(3, 3), Size(5, 5), Size(11, 11)), + Values(make_pair(blobShape(1, 4, 224, 224), 64), + make_pair(blobShape(1, 64, 112, 122), 128), + make_pair(blobShape(1, 256, 28, 28), 512)), + GroupSize::all(), + StrideSize::all()) +) +{ + RNG rng(0); + + ConvParam params = GetParam(); + int ksz = get<0>(params).width; + MatShape inpShape = get<1>(params).first; + int outCn = get<1>(params).second; + int groups = get<2>(params); + int stride = (ksz >= 11) ? 4 : (int)get<3>(params); + + int inpCn = inpShape[1]; + int wgtSize[] = { outCn, inpCn/groups, ksz, ksz }; + int biasSize[] = { outCn, 1, 1, 1 }; + const int wtype = CV_32F; + Mat wgtBlob(4, wgtSize, wtype), biasBlob(4, biasSize, wtype); + Mat inpBlob(4, &inpShape[0], wtype); + rng.fill(biasBlob, RNG::UNIFORM, -1, +1); + rng.fill(wgtBlob, RNG::UNIFORM, -1, +1); + rng.fill(inpBlob, RNG::UNIFORM, -1, +1); + + LayerParams lp; + lp.set("num_output", outCn); + lp.set("group", groups); + lp.set("stride", stride); + lp.set("kernel_size", ksz); + lp.blobs.reserve(2); + lp.blobs.push_back(wgtBlob); + lp.blobs.push_back(biasBlob); + + std::vector inpBlobs(1, &inpBlob); + std::vector outBlobs, internalBlobs; + + cv::setNumThreads(cv::getNumberOfCPUs()); + + Ptr layer = cv::dnn::LayerFactory::createLayerInstance("Convolution", lp); + std::vector inputShapes(1, shape(inpBlob)), outShapes, internals; + layer->getMemoryShapes(inputShapes, 0, outShapes, internals); + for (int i = 0; i < outShapes.size(); i++) + { + outBlobs.push_back(Mat(outShapes[i], CV_32F)); + } + for (int i = 0; i < internals.size(); i++) + { + internalBlobs.push_back(Mat()); + if (total(internals[i])) + internalBlobs.back().create(internals[i], CV_32F); + } + + layer->finalize(inpBlobs, outBlobs); + + Mat inpBlob2D = inpBlob.reshape(1, outCn); + Mat wgtBlob2D = wgtBlob.reshape(1, outCn*(inpCn/groups)); + Mat outBlob2D = outBlobs[0].reshape(1, outBlobs[0].size[0]); + declare.in(inpBlob2D, wgtBlob2D, WARMUP_RNG).out(outBlob2D).tbb_threads(cv::getNumThreads()); + + TEST_CYCLE_N(10) + { + layer->forward(inpBlobs, outBlobs, internalBlobs); + } + + SANITY_CHECK_NOTHING(); +} + +} diff --git a/modules/dnn/perf/perf_halide_net.cpp b/modules/dnn/perf/perf_halide_net.cpp new file mode 100644 index 0000000000..5631da6384 --- /dev/null +++ b/modules/dnn/perf/perf_halide_net.cpp @@ -0,0 +1,172 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +namespace cvtest +{ + +#ifdef HAVE_HALIDE +using namespace cv; +using namespace dnn; + +static void loadNet(std::string weights, std::string proto, std::string scheduler, + int inWidth, int inHeight, const std::string& outputLayer, + const std::string& framework, int targetId, Net* net) +{ + Mat input(inHeight, inWidth, CV_32FC3); + randu(input, 0.0f, 1.0f); + + weights = findDataFile(weights, false); + if (!proto.empty()) + proto = findDataFile(proto, false); + if (!scheduler.empty()) + scheduler = findDataFile(scheduler, false); + if (framework == "caffe") + { + *net = cv::dnn::readNetFromCaffe(proto, weights); + } + else if (framework == "torch") + { + *net = cv::dnn::readNetFromTorch(weights); + } + else if (framework == "tensorflow") + { + *net = cv::dnn::readNetFromTensorflow(weights); + } + else + CV_Error(Error::StsNotImplemented, "Unknown framework " + framework); + + net->setInput(blobFromImage(input, 1.0, Size(), Scalar(), false)); + net->setPreferableBackend(DNN_BACKEND_HALIDE); + net->setPreferableTarget(targetId); + net->setHalideScheduler(scheduler); + net->forward(outputLayer); +} + +//////////////////////////////////////////////////////////////////////////////// +// CPU target +//////////////////////////////////////////////////////////////////////////////// +PERF_TEST(GoogLeNet, HalidePerfTest) +{ + Net net; + loadNet("dnn/bvlc_googlenet.caffemodel", "dnn/bvlc_googlenet.prototxt", + "", 227, 227, "prob", "caffe", DNN_TARGET_CPU, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(AlexNet, HalidePerfTest) +{ + Net net; + loadNet("dnn/bvlc_alexnet.caffemodel", "dnn/bvlc_alexnet.prototxt", + "dnn/halide_scheduler_alexnet.yml", 227, 227, "prob", "caffe", + DNN_TARGET_CPU, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(ResNet50, HalidePerfTest) +{ + Net net; + loadNet("dnn/ResNet-50-model.caffemodel", "dnn/ResNet-50-deploy.prototxt", + "dnn/halide_scheduler_resnet_50.yml", 224, 224, "prob", "caffe", + DNN_TARGET_CPU, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(SqueezeNet_v1_1, HalidePerfTest) +{ + Net net; + loadNet("dnn/squeezenet_v1_1.caffemodel", "dnn/squeezenet_v1_1.prototxt", + "dnn/halide_scheduler_squeezenet_v1_1.yml", 227, 227, "prob", + "caffe", DNN_TARGET_CPU, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(Inception_5h, HalidePerfTest) +{ + Net net; + loadNet("dnn/tensorflow_inception_graph.pb", "", + "dnn/halide_scheduler_inception_5h.yml", + 224, 224, "softmax2", "tensorflow", DNN_TARGET_CPU, &net); + TEST_CYCLE() net.forward("softmax2"); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(ENet, HalidePerfTest) +{ + Net net; + loadNet("dnn/Enet-model-best.net", "", "dnn/halide_scheduler_enet.yml", + 512, 256, "l367_Deconvolution", "torch", DNN_TARGET_CPU, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} +//////////////////////////////////////////////////////////////////////////////// +// OpenCL target +//////////////////////////////////////////////////////////////////////////////// +PERF_TEST(GoogLeNet_opencl, HalidePerfTest) +{ + Net net; + loadNet("dnn/bvlc_googlenet.caffemodel", "dnn/bvlc_googlenet.prototxt", + "", 227, 227, "prob", "caffe", DNN_TARGET_OPENCL, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(AlexNet_opencl, HalidePerfTest) +{ + Net net; + loadNet("dnn/bvlc_alexnet.caffemodel", "dnn/bvlc_alexnet.prototxt", + "dnn/halide_scheduler_opencl_alexnet.yml", 227, 227, "prob", "caffe", + DNN_TARGET_OPENCL, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(ResNet50_opencl, HalidePerfTest) +{ + Net net; + loadNet("dnn/ResNet-50-model.caffemodel", "dnn/ResNet-50-deploy.prototxt", + "dnn/halide_scheduler_opencl_resnet_50.yml", 224, 224, "prob", "caffe", + DNN_TARGET_OPENCL, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + + +PERF_TEST(SqueezeNet_v1_1_opencl, HalidePerfTest) +{ + Net net; + loadNet("dnn/squeezenet_v1_1.caffemodel", "dnn/squeezenet_v1_1.prototxt", + "dnn/halide_scheduler_opencl_squeezenet_v1_1.yml", 227, 227, "prob", + "caffe", DNN_TARGET_OPENCL, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(Inception_5h_opencl, HalidePerfTest) +{ + Net net; + loadNet("dnn/tensorflow_inception_graph.pb", "", + "dnn/halide_scheduler_opencl_inception_5h.yml", + 224, 224, "softmax2", "tensorflow", DNN_TARGET_OPENCL, &net); + TEST_CYCLE() net.forward("softmax2"); + SANITY_CHECK_NOTHING(); +} + +PERF_TEST(ENet_opencl, HalidePerfTest) +{ + Net net; + loadNet("dnn/Enet-model-best.net", "", "dnn/halide_scheduler_opencl_enet.yml", + 512, 256, "l367_Deconvolution", "torch", DNN_TARGET_OPENCL, &net); + TEST_CYCLE() net.forward(); + SANITY_CHECK_NOTHING(); +} +#endif // HAVE_HALIDE + +} // namespace cvtest diff --git a/modules/dnn/perf/perf_main.cpp b/modules/dnn/perf/perf_main.cpp new file mode 100644 index 0000000000..d66f19c9dd --- /dev/null +++ b/modules/dnn/perf/perf_main.cpp @@ -0,0 +1,12 @@ +#include "perf_precomp.hpp" + +static const char* extraTestDataPath = +#ifdef WINRT + NULL; +#else + getenv("OPENCV_DNN_TEST_DATA_PATH"); +#endif + +CV_PERF_TEST_MAIN(dnn, + extraTestDataPath ? (void)cvtest::addDataSearchPath(extraTestDataPath) : (void)0 +) diff --git a/modules/dnn/perf/perf_precomp.hpp b/modules/dnn/perf/perf_precomp.hpp new file mode 100644 index 0000000000..5cdbc6d179 --- /dev/null +++ b/modules/dnn/perf/perf_precomp.hpp @@ -0,0 +1,17 @@ +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wmissing-declarations" +# if defined __clang__ || defined __APPLE__ +# pragma GCC diagnostic ignored "-Wmissing-prototypes" +# pragma GCC diagnostic ignored "-Wextra" +# endif +#endif + +#ifndef __OPENCV_PERF_PRECOMP_HPP__ +#define __OPENCV_PERF_PRECOMP_HPP__ + +#include +#include +#include +#include + +#endif diff --git a/modules/dnn/samples/.gitignore b/modules/dnn/samples/.gitignore new file mode 100644 index 0000000000..be7186603d --- /dev/null +++ b/modules/dnn/samples/.gitignore @@ -0,0 +1 @@ +*.caffemodel diff --git a/modules/dnn/samples/VGG_VOC0712_SSD_300x300_iter_60000.prototxt b/modules/dnn/samples/VGG_VOC0712_SSD_300x300_iter_60000.prototxt new file mode 100644 index 0000000000..77a2365553 --- /dev/null +++ b/modules/dnn/samples/VGG_VOC0712_SSD_300x300_iter_60000.prototxt @@ -0,0 +1,1546 @@ +name: "VGG_VOC0712_SSD_300x300_deploy" +input: "data" +input_dim: 1 +input_dim: 3 +input_dim: 300 +input_dim: 300 +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 0 + decay_mult: 0 + } + param { + lr_mult: 0 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 1024 + pad: 6 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + dilation: 6 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "conv6_1" + type: "Convolution" + bottom: "fc7" + top: "conv6_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv6_1_relu" + type: "ReLU" + bottom: "conv6_1" + top: "conv6_1" +} +layer { + name: "conv6_2" + type: "Convolution" + bottom: "conv6_1" + top: "conv6_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv6_2_relu" + type: "ReLU" + bottom: "conv6_2" + top: "conv6_2" +} +layer { + name: "conv7_1" + type: "Convolution" + bottom: "conv6_2" + top: "conv7_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv7_1_relu" + type: "ReLU" + bottom: "conv7_1" + top: "conv7_1" +} +layer { + name: "conv7_2" + type: "Convolution" + bottom: "conv7_1" + top: "conv7_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv7_2_relu" + type: "ReLU" + bottom: "conv7_2" + top: "conv7_2" +} +layer { + name: "conv8_1" + type: "Convolution" + bottom: "conv7_2" + top: "conv8_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv8_1_relu" + type: "ReLU" + bottom: "conv8_1" + top: "conv8_1" +} +layer { + name: "conv8_2" + type: "Convolution" + bottom: "conv8_1" + top: "conv8_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv8_2_relu" + type: "ReLU" + bottom: "conv8_2" + top: "conv8_2" +} +layer { + name: "pool6" + type: "Pooling" + bottom: "conv8_2" + top: "pool6" + pooling_param { + pool: AVE + global_pooling: true + } +} +layer { + name: "conv4_3_norm" + type: "NormalizeBBox" + bottom: "conv4_3" + top: "conv4_3_norm" + normalize_bbox_param { + across_spatial: false + scale_filler { + type: "constant" + value: 20 + } + channel_shared: false + } +} +layer { + name: "conv4_3_norm_mbox_loc" + type: "Convolution" + bottom: "conv4_3_norm" + top: "conv4_3_norm_mbox_loc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 12 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv4_3_norm_mbox_loc_perm" + type: "Permute" + bottom: "conv4_3_norm_mbox_loc" + top: "conv4_3_norm_mbox_loc_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv4_3_norm_mbox_loc_flat" + type: "Flatten" + bottom: "conv4_3_norm_mbox_loc_perm" + top: "conv4_3_norm_mbox_loc_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv4_3_norm_mbox_conf" + type: "Convolution" + bottom: "conv4_3_norm" + top: "conv4_3_norm_mbox_conf" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 63 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv4_3_norm_mbox_conf_perm" + type: "Permute" + bottom: "conv4_3_norm_mbox_conf" + top: "conv4_3_norm_mbox_conf_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv4_3_norm_mbox_conf_flat" + type: "Flatten" + bottom: "conv4_3_norm_mbox_conf_perm" + top: "conv4_3_norm_mbox_conf_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv4_3_norm_mbox_priorbox" + type: "PriorBox" + bottom: "conv4_3_norm" + bottom: "data" + top: "conv4_3_norm_mbox_priorbox" + prior_box_param { + min_size: 30.0 + aspect_ratio: 2 + flip: true + clip: true + variance: 0.1 + variance: 0.1 + variance: 0.2 + variance: 0.2 + } +} +layer { + name: "fc7_mbox_loc" + type: "Convolution" + bottom: "fc7" + top: "fc7_mbox_loc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "fc7_mbox_loc_perm" + type: "Permute" + bottom: "fc7_mbox_loc" + top: "fc7_mbox_loc_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "fc7_mbox_loc_flat" + type: "Flatten" + bottom: "fc7_mbox_loc_perm" + top: "fc7_mbox_loc_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "fc7_mbox_conf" + type: "Convolution" + bottom: "fc7" + top: "fc7_mbox_conf" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 126 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "fc7_mbox_conf_perm" + type: "Permute" + bottom: "fc7_mbox_conf" + top: "fc7_mbox_conf_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "fc7_mbox_conf_flat" + type: "Flatten" + bottom: "fc7_mbox_conf_perm" + top: "fc7_mbox_conf_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "fc7_mbox_priorbox" + type: "PriorBox" + bottom: "fc7" + bottom: "data" + top: "fc7_mbox_priorbox" + prior_box_param { + min_size: 60.0 + max_size: 114.0 + aspect_ratio: 2 + aspect_ratio: 3 + flip: true + clip: true + variance: 0.1 + variance: 0.1 + variance: 0.2 + variance: 0.2 + } +} +layer { + name: "conv6_2_mbox_loc" + type: "Convolution" + bottom: "conv6_2" + top: "conv6_2_mbox_loc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv6_2_mbox_loc_perm" + type: "Permute" + bottom: "conv6_2_mbox_loc" + top: "conv6_2_mbox_loc_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv6_2_mbox_loc_flat" + type: "Flatten" + bottom: "conv6_2_mbox_loc_perm" + top: "conv6_2_mbox_loc_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv6_2_mbox_conf" + type: "Convolution" + bottom: "conv6_2" + top: "conv6_2_mbox_conf" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 126 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv6_2_mbox_conf_perm" + type: "Permute" + bottom: "conv6_2_mbox_conf" + top: "conv6_2_mbox_conf_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv6_2_mbox_conf_flat" + type: "Flatten" + bottom: "conv6_2_mbox_conf_perm" + top: "conv6_2_mbox_conf_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv6_2_mbox_priorbox" + type: "PriorBox" + bottom: "conv6_2" + bottom: "data" + top: "conv6_2_mbox_priorbox" + prior_box_param { + min_size: 114.0 + max_size: 168.0 + aspect_ratio: 2 + aspect_ratio: 3 + flip: true + clip: true + variance: 0.1 + variance: 0.1 + variance: 0.2 + variance: 0.2 + } +} +layer { + name: "conv7_2_mbox_loc" + type: "Convolution" + bottom: "conv7_2" + top: "conv7_2_mbox_loc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv7_2_mbox_loc_perm" + type: "Permute" + bottom: "conv7_2_mbox_loc" + top: "conv7_2_mbox_loc_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv7_2_mbox_loc_flat" + type: "Flatten" + bottom: "conv7_2_mbox_loc_perm" + top: "conv7_2_mbox_loc_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv7_2_mbox_conf" + type: "Convolution" + bottom: "conv7_2" + top: "conv7_2_mbox_conf" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 126 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv7_2_mbox_conf_perm" + type: "Permute" + bottom: "conv7_2_mbox_conf" + top: "conv7_2_mbox_conf_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv7_2_mbox_conf_flat" + type: "Flatten" + bottom: "conv7_2_mbox_conf_perm" + top: "conv7_2_mbox_conf_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv7_2_mbox_priorbox" + type: "PriorBox" + bottom: "conv7_2" + bottom: "data" + top: "conv7_2_mbox_priorbox" + prior_box_param { + min_size: 168.0 + max_size: 222.0 + aspect_ratio: 2 + aspect_ratio: 3 + flip: true + clip: true + variance: 0.1 + variance: 0.1 + variance: 0.2 + variance: 0.2 + } +} +layer { + name: "conv8_2_mbox_loc" + type: "Convolution" + bottom: "conv8_2" + top: "conv8_2_mbox_loc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv8_2_mbox_loc_perm" + type: "Permute" + bottom: "conv8_2_mbox_loc" + top: "conv8_2_mbox_loc_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv8_2_mbox_loc_flat" + type: "Flatten" + bottom: "conv8_2_mbox_loc_perm" + top: "conv8_2_mbox_loc_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv8_2_mbox_conf" + type: "Convolution" + bottom: "conv8_2" + top: "conv8_2_mbox_conf" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 126 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "conv8_2_mbox_conf_perm" + type: "Permute" + bottom: "conv8_2_mbox_conf" + top: "conv8_2_mbox_conf_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "conv8_2_mbox_conf_flat" + type: "Flatten" + bottom: "conv8_2_mbox_conf_perm" + top: "conv8_2_mbox_conf_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "conv8_2_mbox_priorbox" + type: "PriorBox" + bottom: "conv8_2" + bottom: "data" + top: "conv8_2_mbox_priorbox" + prior_box_param { + min_size: 222.0 + max_size: 276.0 + aspect_ratio: 2 + aspect_ratio: 3 + flip: true + clip: true + variance: 0.1 + variance: 0.1 + variance: 0.2 + variance: 0.2 + } +} +layer { + name: "pool6_mbox_loc" + type: "Convolution" + bottom: "pool6" + top: "pool6_mbox_loc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "pool6_mbox_loc_perm" + type: "Permute" + bottom: "pool6_mbox_loc" + top: "pool6_mbox_loc_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "pool6_mbox_loc_flat" + type: "Flatten" + bottom: "pool6_mbox_loc_perm" + top: "pool6_mbox_loc_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "pool6_mbox_conf" + type: "Convolution" + bottom: "pool6" + top: "pool6_mbox_conf" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 126 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "pool6_mbox_conf_perm" + type: "Permute" + bottom: "pool6_mbox_conf" + top: "pool6_mbox_conf_perm" + permute_param { + order: 0 + order: 2 + order: 3 + order: 1 + } +} +layer { + name: "pool6_mbox_conf_flat" + type: "Flatten" + bottom: "pool6_mbox_conf_perm" + top: "pool6_mbox_conf_flat" + flatten_param { + axis: 1 + } +} +layer { + name: "pool6_mbox_priorbox" + type: "PriorBox" + bottom: "pool6" + bottom: "data" + top: "pool6_mbox_priorbox" + prior_box_param { + min_size: 276.0 + max_size: 330.0 + aspect_ratio: 2 + aspect_ratio: 3 + flip: true + clip: true + variance: 0.1 + variance: 0.1 + variance: 0.2 + variance: 0.2 + } +} +layer { + name: "mbox_loc" + type: "Concat" + bottom: "conv4_3_norm_mbox_loc_flat" + bottom: "fc7_mbox_loc_flat" + bottom: "conv6_2_mbox_loc_flat" + bottom: "conv7_2_mbox_loc_flat" + bottom: "conv8_2_mbox_loc_flat" + bottom: "pool6_mbox_loc_flat" + top: "mbox_loc" + concat_param { + axis: 1 + } +} +layer { + name: "mbox_conf" + type: "Concat" + bottom: "conv4_3_norm_mbox_conf_flat" + bottom: "fc7_mbox_conf_flat" + bottom: "conv6_2_mbox_conf_flat" + bottom: "conv7_2_mbox_conf_flat" + bottom: "conv8_2_mbox_conf_flat" + bottom: "pool6_mbox_conf_flat" + top: "mbox_conf" + concat_param { + axis: 1 + } +} +layer { + name: "mbox_priorbox" + type: "Concat" + bottom: "conv4_3_norm_mbox_priorbox" + bottom: "fc7_mbox_priorbox" + bottom: "conv6_2_mbox_priorbox" + bottom: "conv7_2_mbox_priorbox" + bottom: "conv8_2_mbox_priorbox" + bottom: "pool6_mbox_priorbox" + top: "mbox_priorbox" + concat_param { + axis: 2 + } +} +layer { + name: "mbox_conf_reshape" + type: "Reshape" + bottom: "mbox_conf" + top: "mbox_conf_reshape" + reshape_param { + shape { + dim: 0 + dim: -1 + dim: 21 + } + } +} +layer { + name: "mbox_conf_softmax" + type: "Softmax" + bottom: "mbox_conf_reshape" + top: "mbox_conf_softmax" + softmax_param { + axis: 2 + } +} +layer { + name: "mbox_conf_flatten" + type: "Flatten" + bottom: "mbox_conf_softmax" + top: "mbox_conf_flatten" + flatten_param { + axis: 1 + } +} +layer { + name: "detection_out" + type: "DetectionOutput" + bottom: "mbox_loc" + bottom: "mbox_conf_flatten" + bottom: "mbox_priorbox" + top: "detection_out" + include { + phase: TEST + } + detection_output_param { + num_classes: 21 + share_location: true + background_label_id: 0 + nms_threshold: 0.45 + top_k: 400 + code_type: CENTER_SIZE + keep_top_k: 200 + confidence_threshold: 0.01 + } +} diff --git a/modules/dnn/samples/bvlc_googlenet.prototxt b/modules/dnn/samples/bvlc_googlenet.prototxt new file mode 100644 index 0000000000..4648bf26ef --- /dev/null +++ b/modules/dnn/samples/bvlc_googlenet.prototxt @@ -0,0 +1,2156 @@ +name: "GoogleNet" +input: "data" +input_dim: 10 +input_dim: 3 +input_dim: 224 +input_dim: 224 +layer { + name: "conv1/7x7_s2" + type: "Convolution" + bottom: "data" + top: "conv1/7x7_s2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "conv1/relu_7x7" + type: "ReLU" + bottom: "conv1/7x7_s2" + top: "conv1/7x7_s2" +} +layer { + name: "pool1/3x3_s2" + type: "Pooling" + bottom: "conv1/7x7_s2" + top: "pool1/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "pool1/norm1" + type: "LRN" + bottom: "pool1/3x3_s2" + top: "pool1/norm1" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "conv2/3x3_reduce" + type: "Convolution" + bottom: "pool1/norm1" + top: "conv2/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "conv2/relu_3x3_reduce" + type: "ReLU" + bottom: "conv2/3x3_reduce" + top: "conv2/3x3_reduce" +} +layer { + name: "conv2/3x3" + type: "Convolution" + bottom: "conv2/3x3_reduce" + top: "conv2/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "conv2/relu_3x3" + type: "ReLU" + bottom: "conv2/3x3" + top: "conv2/3x3" +} +layer { + name: "conv2/norm2" + type: "LRN" + bottom: "conv2/3x3" + top: "conv2/norm2" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "pool2/3x3_s2" + type: "Pooling" + bottom: "conv2/norm2" + top: "pool2/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_3a/1x1" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3a/relu_1x1" + type: "ReLU" + bottom: "inception_3a/1x1" + top: "inception_3a/1x1" +} +layer { + name: "inception_3a/3x3_reduce" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_3a/3x3_reduce" + top: "inception_3a/3x3_reduce" +} +layer { + name: "inception_3a/3x3" + type: "Convolution" + bottom: "inception_3a/3x3_reduce" + top: "inception_3a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3a/relu_3x3" + type: "ReLU" + bottom: "inception_3a/3x3" + top: "inception_3a/3x3" +} +layer { + name: "inception_3a/5x5_reduce" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 16 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_3a/5x5_reduce" + top: "inception_3a/5x5_reduce" +} +layer { + name: "inception_3a/5x5" + type: "Convolution" + bottom: "inception_3a/5x5_reduce" + top: "inception_3a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3a/relu_5x5" + type: "ReLU" + bottom: "inception_3a/5x5" + top: "inception_3a/5x5" +} +layer { + name: "inception_3a/pool" + type: "Pooling" + bottom: "pool2/3x3_s2" + top: "inception_3a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_3a/pool_proj" + type: "Convolution" + bottom: "inception_3a/pool" + top: "inception_3a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3a/relu_pool_proj" + type: "ReLU" + bottom: "inception_3a/pool_proj" + top: "inception_3a/pool_proj" +} +layer { + name: "inception_3a/output" + type: "Concat" + bottom: "inception_3a/1x1" + bottom: "inception_3a/3x3" + bottom: "inception_3a/5x5" + bottom: "inception_3a/pool_proj" + top: "inception_3a/output" +} +layer { + name: "inception_3b/1x1" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3b/relu_1x1" + type: "ReLU" + bottom: "inception_3b/1x1" + top: "inception_3b/1x1" +} +layer { + name: "inception_3b/3x3_reduce" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_3b/3x3_reduce" + top: "inception_3b/3x3_reduce" +} +layer { + name: "inception_3b/3x3" + type: "Convolution" + bottom: "inception_3b/3x3_reduce" + top: "inception_3b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3b/relu_3x3" + type: "ReLU" + bottom: "inception_3b/3x3" + top: "inception_3b/3x3" +} +layer { + name: "inception_3b/5x5_reduce" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_3b/5x5_reduce" + top: "inception_3b/5x5_reduce" +} +layer { + name: "inception_3b/5x5" + type: "Convolution" + bottom: "inception_3b/5x5_reduce" + top: "inception_3b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3b/relu_5x5" + type: "ReLU" + bottom: "inception_3b/5x5" + top: "inception_3b/5x5" +} +layer { + name: "inception_3b/pool" + type: "Pooling" + bottom: "inception_3a/output" + top: "inception_3b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_3b/pool_proj" + type: "Convolution" + bottom: "inception_3b/pool" + top: "inception_3b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_3b/relu_pool_proj" + type: "ReLU" + bottom: "inception_3b/pool_proj" + top: "inception_3b/pool_proj" +} +layer { + name: "inception_3b/output" + type: "Concat" + bottom: "inception_3b/1x1" + bottom: "inception_3b/3x3" + bottom: "inception_3b/5x5" + bottom: "inception_3b/pool_proj" + top: "inception_3b/output" +} +layer { + name: "pool3/3x3_s2" + type: "Pooling" + bottom: "inception_3b/output" + top: "pool3/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_4a/1x1" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4a/relu_1x1" + type: "ReLU" + bottom: "inception_4a/1x1" + top: "inception_4a/1x1" +} +layer { + name: "inception_4a/3x3_reduce" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4a/3x3_reduce" + top: "inception_4a/3x3_reduce" +} +layer { + name: "inception_4a/3x3" + type: "Convolution" + bottom: "inception_4a/3x3_reduce" + top: "inception_4a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 208 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4a/relu_3x3" + type: "ReLU" + bottom: "inception_4a/3x3" + top: "inception_4a/3x3" +} +layer { + name: "inception_4a/5x5_reduce" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 16 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4a/5x5_reduce" + top: "inception_4a/5x5_reduce" +} +layer { + name: "inception_4a/5x5" + type: "Convolution" + bottom: "inception_4a/5x5_reduce" + top: "inception_4a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 48 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4a/relu_5x5" + type: "ReLU" + bottom: "inception_4a/5x5" + top: "inception_4a/5x5" +} +layer { + name: "inception_4a/pool" + type: "Pooling" + bottom: "pool3/3x3_s2" + top: "inception_4a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4a/pool_proj" + type: "Convolution" + bottom: "inception_4a/pool" + top: "inception_4a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4a/relu_pool_proj" + type: "ReLU" + bottom: "inception_4a/pool_proj" + top: "inception_4a/pool_proj" +} +layer { + name: "inception_4a/output" + type: "Concat" + bottom: "inception_4a/1x1" + bottom: "inception_4a/3x3" + bottom: "inception_4a/5x5" + bottom: "inception_4a/pool_proj" + top: "inception_4a/output" +} +layer { + name: "inception_4b/1x1" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4b/relu_1x1" + type: "ReLU" + bottom: "inception_4b/1x1" + top: "inception_4b/1x1" +} +layer { + name: "inception_4b/3x3_reduce" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 112 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4b/3x3_reduce" + top: "inception_4b/3x3_reduce" +} +layer { + name: "inception_4b/3x3" + type: "Convolution" + bottom: "inception_4b/3x3_reduce" + top: "inception_4b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 224 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4b/relu_3x3" + type: "ReLU" + bottom: "inception_4b/3x3" + top: "inception_4b/3x3" +} +layer { + name: "inception_4b/5x5_reduce" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4b/5x5_reduce" + top: "inception_4b/5x5_reduce" +} +layer { + name: "inception_4b/5x5" + type: "Convolution" + bottom: "inception_4b/5x5_reduce" + top: "inception_4b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4b/relu_5x5" + type: "ReLU" + bottom: "inception_4b/5x5" + top: "inception_4b/5x5" +} +layer { + name: "inception_4b/pool" + type: "Pooling" + bottom: "inception_4a/output" + top: "inception_4b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4b/pool_proj" + type: "Convolution" + bottom: "inception_4b/pool" + top: "inception_4b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4b/relu_pool_proj" + type: "ReLU" + bottom: "inception_4b/pool_proj" + top: "inception_4b/pool_proj" +} +layer { + name: "inception_4b/output" + type: "Concat" + bottom: "inception_4b/1x1" + bottom: "inception_4b/3x3" + bottom: "inception_4b/5x5" + bottom: "inception_4b/pool_proj" + top: "inception_4b/output" +} +layer { + name: "inception_4c/1x1" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4c/relu_1x1" + type: "ReLU" + bottom: "inception_4c/1x1" + top: "inception_4c/1x1" +} +layer { + name: "inception_4c/3x3_reduce" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4c/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4c/3x3_reduce" + top: "inception_4c/3x3_reduce" +} +layer { + name: "inception_4c/3x3" + type: "Convolution" + bottom: "inception_4c/3x3_reduce" + top: "inception_4c/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4c/relu_3x3" + type: "ReLU" + bottom: "inception_4c/3x3" + top: "inception_4c/3x3" +} +layer { + name: "inception_4c/5x5_reduce" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4c/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4c/5x5_reduce" + top: "inception_4c/5x5_reduce" +} +layer { + name: "inception_4c/5x5" + type: "Convolution" + bottom: "inception_4c/5x5_reduce" + top: "inception_4c/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4c/relu_5x5" + type: "ReLU" + bottom: "inception_4c/5x5" + top: "inception_4c/5x5" +} +layer { + name: "inception_4c/pool" + type: "Pooling" + bottom: "inception_4b/output" + top: "inception_4c/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4c/pool_proj" + type: "Convolution" + bottom: "inception_4c/pool" + top: "inception_4c/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4c/relu_pool_proj" + type: "ReLU" + bottom: "inception_4c/pool_proj" + top: "inception_4c/pool_proj" +} +layer { + name: "inception_4c/output" + type: "Concat" + bottom: "inception_4c/1x1" + bottom: "inception_4c/3x3" + bottom: "inception_4c/5x5" + bottom: "inception_4c/pool_proj" + top: "inception_4c/output" +} +layer { + name: "inception_4d/1x1" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 112 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4d/relu_1x1" + type: "ReLU" + bottom: "inception_4d/1x1" + top: "inception_4d/1x1" +} +layer { + name: "inception_4d/3x3_reduce" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 144 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4d/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4d/3x3_reduce" + top: "inception_4d/3x3_reduce" +} +layer { + name: "inception_4d/3x3" + type: "Convolution" + bottom: "inception_4d/3x3_reduce" + top: "inception_4d/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 288 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4d/relu_3x3" + type: "ReLU" + bottom: "inception_4d/3x3" + top: "inception_4d/3x3" +} +layer { + name: "inception_4d/5x5_reduce" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4d/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4d/5x5_reduce" + top: "inception_4d/5x5_reduce" +} +layer { + name: "inception_4d/5x5" + type: "Convolution" + bottom: "inception_4d/5x5_reduce" + top: "inception_4d/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4d/relu_5x5" + type: "ReLU" + bottom: "inception_4d/5x5" + top: "inception_4d/5x5" +} +layer { + name: "inception_4d/pool" + type: "Pooling" + bottom: "inception_4c/output" + top: "inception_4d/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4d/pool_proj" + type: "Convolution" + bottom: "inception_4d/pool" + top: "inception_4d/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4d/relu_pool_proj" + type: "ReLU" + bottom: "inception_4d/pool_proj" + top: "inception_4d/pool_proj" +} +layer { + name: "inception_4d/output" + type: "Concat" + bottom: "inception_4d/1x1" + bottom: "inception_4d/3x3" + bottom: "inception_4d/5x5" + bottom: "inception_4d/pool_proj" + top: "inception_4d/output" +} +layer { + name: "inception_4e/1x1" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4e/relu_1x1" + type: "ReLU" + bottom: "inception_4e/1x1" + top: "inception_4e/1x1" +} +layer { + name: "inception_4e/3x3_reduce" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4e/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4e/3x3_reduce" + top: "inception_4e/3x3_reduce" +} +layer { + name: "inception_4e/3x3" + type: "Convolution" + bottom: "inception_4e/3x3_reduce" + top: "inception_4e/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 320 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4e/relu_3x3" + type: "ReLU" + bottom: "inception_4e/3x3" + top: "inception_4e/3x3" +} +layer { + name: "inception_4e/5x5_reduce" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4e/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4e/5x5_reduce" + top: "inception_4e/5x5_reduce" +} +layer { + name: "inception_4e/5x5" + type: "Convolution" + bottom: "inception_4e/5x5_reduce" + top: "inception_4e/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4e/relu_5x5" + type: "ReLU" + bottom: "inception_4e/5x5" + top: "inception_4e/5x5" +} +layer { + name: "inception_4e/pool" + type: "Pooling" + bottom: "inception_4d/output" + top: "inception_4e/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4e/pool_proj" + type: "Convolution" + bottom: "inception_4e/pool" + top: "inception_4e/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_4e/relu_pool_proj" + type: "ReLU" + bottom: "inception_4e/pool_proj" + top: "inception_4e/pool_proj" +} +layer { + name: "inception_4e/output" + type: "Concat" + bottom: "inception_4e/1x1" + bottom: "inception_4e/3x3" + bottom: "inception_4e/5x5" + bottom: "inception_4e/pool_proj" + top: "inception_4e/output" +} +layer { + name: "pool4/3x3_s2" + type: "Pooling" + bottom: "inception_4e/output" + top: "pool4/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_5a/1x1" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5a/relu_1x1" + type: "ReLU" + bottom: "inception_5a/1x1" + top: "inception_5a/1x1" +} +layer { + name: "inception_5a/3x3_reduce" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_5a/3x3_reduce" + top: "inception_5a/3x3_reduce" +} +layer { + name: "inception_5a/3x3" + type: "Convolution" + bottom: "inception_5a/3x3_reduce" + top: "inception_5a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 320 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5a/relu_3x3" + type: "ReLU" + bottom: "inception_5a/3x3" + top: "inception_5a/3x3" +} +layer { + name: "inception_5a/5x5_reduce" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_5a/5x5_reduce" + top: "inception_5a/5x5_reduce" +} +layer { + name: "inception_5a/5x5" + type: "Convolution" + bottom: "inception_5a/5x5_reduce" + top: "inception_5a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5a/relu_5x5" + type: "ReLU" + bottom: "inception_5a/5x5" + top: "inception_5a/5x5" +} +layer { + name: "inception_5a/pool" + type: "Pooling" + bottom: "pool4/3x3_s2" + top: "inception_5a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_5a/pool_proj" + type: "Convolution" + bottom: "inception_5a/pool" + top: "inception_5a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5a/relu_pool_proj" + type: "ReLU" + bottom: "inception_5a/pool_proj" + top: "inception_5a/pool_proj" +} +layer { + name: "inception_5a/output" + type: "Concat" + bottom: "inception_5a/1x1" + bottom: "inception_5a/3x3" + bottom: "inception_5a/5x5" + bottom: "inception_5a/pool_proj" + top: "inception_5a/output" +} +layer { + name: "inception_5b/1x1" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5b/relu_1x1" + type: "ReLU" + bottom: "inception_5b/1x1" + top: "inception_5b/1x1" +} +layer { + name: "inception_5b/3x3_reduce" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.09 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_5b/3x3_reduce" + top: "inception_5b/3x3_reduce" +} +layer { + name: "inception_5b/3x3" + type: "Convolution" + bottom: "inception_5b/3x3_reduce" + top: "inception_5b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5b/relu_3x3" + type: "ReLU" + bottom: "inception_5b/3x3" + top: "inception_5b/3x3" +} +layer { + name: "inception_5b/5x5_reduce" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 48 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.2 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_5b/5x5_reduce" + top: "inception_5b/5x5_reduce" +} +layer { + name: "inception_5b/5x5" + type: "Convolution" + bottom: "inception_5b/5x5_reduce" + top: "inception_5b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + std: 0.03 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5b/relu_5x5" + type: "ReLU" + bottom: "inception_5b/5x5" + top: "inception_5b/5x5" +} +layer { + name: "inception_5b/pool" + type: "Pooling" + bottom: "inception_5a/output" + top: "inception_5b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_5b/pool_proj" + type: "Convolution" + bottom: "inception_5b/pool" + top: "inception_5b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + std: 0.1 + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} +layer { + name: "inception_5b/relu_pool_proj" + type: "ReLU" + bottom: "inception_5b/pool_proj" + top: "inception_5b/pool_proj" +} +layer { + name: "inception_5b/output" + type: "Concat" + bottom: "inception_5b/1x1" + bottom: "inception_5b/3x3" + bottom: "inception_5b/5x5" + bottom: "inception_5b/pool_proj" + top: "inception_5b/output" +} +layer { + name: "pool5/7x7_s1" + type: "Pooling" + bottom: "inception_5b/output" + top: "pool5/7x7_s1" + pooling_param { + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + name: "pool5/drop_7x7_s1" + type: "Dropout" + bottom: "pool5/7x7_s1" + top: "pool5/7x7_s1" + dropout_param { + dropout_ratio: 0.4 + } +} +layer { + name: "loss3/classifier" + type: "InnerProduct" + bottom: "pool5/7x7_s1" + top: "loss3/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "prob" + type: "Softmax" + bottom: "loss3/classifier" + top: "prob" +} diff --git a/modules/dnn/samples/caffe_googlenet.cpp b/modules/dnn/samples/caffe_googlenet.cpp new file mode 100644 index 0000000000..59579863f3 --- /dev/null +++ b/modules/dnn/samples/caffe_googlenet.cpp @@ -0,0 +1,143 @@ +/**M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ +#include +#include +#include +using namespace cv; +using namespace cv::dnn; + +#include +#include +#include +using namespace std; + +/* Find best class for the blob (i. e. class with maximal probability) */ +void getMaxClass(const Mat &probBlob, int *classId, double *classProb) +{ + Mat probMat = probBlob.reshape(1, 1); //reshape the blob to 1x1000 matrix + Point classNumber; + + minMaxLoc(probMat, NULL, classProb, NULL, &classNumber); + *classId = classNumber.x; +} + +std::vector readClassNames(const char *filename = "synset_words.txt") +{ + std::vector classNames; + + std::ifstream fp(filename); + if (!fp.is_open()) + { + std::cerr << "File with classes labels not found: " << filename << std::endl; + exit(-1); + } + + std::string name; + while (!fp.eof()) + { + std::getline(fp, name); + if (name.length()) + classNames.push_back( name.substr(name.find(' ')+1) ); + } + + fp.close(); + return classNames; +} + +int main(int argc, char **argv) +{ + cv::dnn::initModule(); //Required if OpenCV is built as static libs + + String modelTxt = "bvlc_googlenet.prototxt"; + String modelBin = "bvlc_googlenet.caffemodel"; + String imageFile = (argc > 1) ? argv[1] : "space_shuttle.jpg"; + + //! [Read and initialize network] + Net net = dnn::readNetFromCaffe(modelTxt, modelBin); + //! [Read and initialize network] + + //! [Check that network was read successfully] + if (net.empty()) + { + std::cerr << "Can't load network by using the following files: " << std::endl; + std::cerr << "prototxt: " << modelTxt << std::endl; + std::cerr << "caffemodel: " << modelBin << std::endl; + std::cerr << "bvlc_googlenet.caffemodel can be downloaded here:" << std::endl; + std::cerr << "http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel" << std::endl; + exit(-1); + } + //! [Check that network was read successfully] + + //! [Prepare blob] + Mat img = imread(imageFile); + if (img.empty()) + { + std::cerr << "Can't read image from the file: " << imageFile << std::endl; + exit(-1); + } + + //GoogLeNet accepts only 224x224 RGB-images + Mat inputBlob = blobFromImage(img, 1, Size(224, 224), + Scalar(104, 117, 123)); //Convert Mat to batch of images + //! [Prepare blob] + + //! [Set input blob] + net.setInput(inputBlob, "data"); //set the network input + //! [Set input blob] + + //! [Make forward pass] + Mat prob = net.forward("prob"); //compute output + //! [Make forward pass] + + //! [Gather output] + int classId; + double classProb; + getMaxClass(prob, &classId, &classProb);//find the best class + //! [Gather output] + + //! [Print results] + std::vector classNames = readClassNames(); + std::cout << "Best class: #" << classId << " '" << classNames.at(classId) << "'" << std::endl; + std::cout << "Probability: " << classProb * 100 << "%" << std::endl; + //! [Print results] + + return 0; +} //main diff --git a/modules/dnn/samples/enet-classes.txt b/modules/dnn/samples/enet-classes.txt new file mode 100644 index 0000000000..303bf6f4c5 --- /dev/null +++ b/modules/dnn/samples/enet-classes.txt @@ -0,0 +1,20 @@ +Unlabeled 0 0 0 +Road 128 64 128 +Sidewalk 244 35 232 +Building 70 70 70 +Wall 102 102 156 +Fence 190 153 153 +Pole 153 153 153 +TrafficLight 250 170 30 +TrafficSign 220 220 0 +Vegetation 107 142 35 +Terrain 152 251 152 +Sky 70 130 180 +Person 220 20 60 +Rider 255 0 0 +Car 0 0 142 +Truck 0 0 70 +Bus 0 60 100 +Train 0 80 100 +Motorcycle 0 0 230 +Bicycle 119 11 32 \ No newline at end of file diff --git a/modules/dnn/samples/fcn32s-heavy-pascal.prototxt b/modules/dnn/samples/fcn32s-heavy-pascal.prototxt new file mode 100644 index 0000000000..7b5a0c55ba --- /dev/null +++ b/modules/dnn/samples/fcn32s-heavy-pascal.prototxt @@ -0,0 +1,502 @@ +# +# This prototxt is based on voc-fcn32s/val.prototxt file from +# https://github.com/shelhamer/fcn.berkeleyvision.org, which is distributed under +# Caffe (BSD) license: +# http://caffe.berkeleyvision.org/model_zoo.html#bvlc-model-license +# +name: "voc-fcn32s" +input: "data" +input_dim: 1 +input_dim: 3 +input_dim: 500 +input_dim: 500 +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "score_fr" + type: "Convolution" + bottom: "fc7" + top: "score_fr" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 21 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore" + type: "Deconvolution" + bottom: "score_fr" + top: "upscore" + param { + lr_mult: 0 + } + convolution_param { + num_output: 21 + bias_term: false + kernel_size: 64 + stride: 32 + } +} +layer { + name: "score" + type: "Crop" + bottom: "upscore" + bottom: "data" + top: "score" + crop_param { + axis: 2 + offset: 19 + } +} diff --git a/modules/dnn/samples/fcn8s-heavy-pascal.prototxt b/modules/dnn/samples/fcn8s-heavy-pascal.prototxt new file mode 100644 index 0000000000..426b40f815 --- /dev/null +++ b/modules/dnn/samples/fcn8s-heavy-pascal.prototxt @@ -0,0 +1,612 @@ +# +# This prototxt is based on voc-fcn8s/val.prototxt file from +# https://github.com/shelhamer/fcn.berkeleyvision.org, which is distributed under +# Caffe (BSD) license: +# http://caffe.berkeleyvision.org/model_zoo.html#bvlc-model-license +# +name: "voc-fcn8s" +input: "data" +input_dim: 1 +input_dim: 3 +input_dim: 500 +input_dim: 500 +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "score_fr" + type: "Convolution" + bottom: "fc7" + top: "score_fr" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 21 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2" + type: "Deconvolution" + bottom: "score_fr" + top: "upscore2" + param { + lr_mult: 0 + } + convolution_param { + num_output: 21 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4" + type: "Convolution" + bottom: "pool4" + top: "score_pool4" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 21 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4c" + type: "Crop" + bottom: "score_pool4" + bottom: "upscore2" + top: "score_pool4c" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4" + type: "Eltwise" + bottom: "upscore2" + bottom: "score_pool4c" + top: "fuse_pool4" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore_pool4" + type: "Deconvolution" + bottom: "fuse_pool4" + top: "upscore_pool4" + param { + lr_mult: 0 + } + convolution_param { + num_output: 21 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool3" + type: "Convolution" + bottom: "pool3" + top: "score_pool3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 21 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool3c" + type: "Crop" + bottom: "score_pool3" + bottom: "upscore_pool4" + top: "score_pool3c" + crop_param { + axis: 2 + offset: 9 + } +} +layer { + name: "fuse_pool3" + type: "Eltwise" + bottom: "upscore_pool4" + bottom: "score_pool3c" + top: "fuse_pool3" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore8" + type: "Deconvolution" + bottom: "fuse_pool3" + top: "upscore8" + param { + lr_mult: 0 + } + convolution_param { + num_output: 21 + bias_term: false + kernel_size: 16 + stride: 8 + } +} +layer { + name: "score" + type: "Crop" + bottom: "upscore8" + bottom: "data" + top: "score" + crop_param { + axis: 2 + offset: 31 + } +} diff --git a/modules/dnn/samples/fcn_semsegm.cpp b/modules/dnn/samples/fcn_semsegm.cpp new file mode 100644 index 0000000000..6706050743 --- /dev/null +++ b/modules/dnn/samples/fcn_semsegm.cpp @@ -0,0 +1,154 @@ +#include +#include +#include +using namespace cv; +using namespace cv::dnn; + +#include +#include +#include +using namespace std; + +static const string fcnType = "fcn8s"; + +static vector readColors(const string &filename = "pascal-classes.txt") +{ + vector colors; + + ifstream fp(filename.c_str()); + if (!fp.is_open()) + { + cerr << "File with colors not found: " << filename << endl; + exit(-1); + } + + string line; + while (!fp.eof()) + { + getline(fp, line); + if (line.length()) + { + stringstream ss(line); + + string name; ss >> name; + int temp; + cv::Vec3b color; + ss >> temp; color[0] = temp; + ss >> temp; color[1] = temp; + ss >> temp; color[2] = temp; + colors.push_back(color); + } + } + + fp.close(); + return colors; +} + +static void colorizeSegmentation(const Mat &score, const vector &colors, cv::Mat &segm) +{ + const int rows = score.size[2]; + const int cols = score.size[3]; + const int chns = score.size[1]; + + cv::Mat maxCl(rows, cols, CV_8UC1); + cv::Mat maxVal(rows, cols, CV_32FC1); + for (int ch = 0; ch < chns; ch++) + { + for (int row = 0; row < rows; row++) + { + const float *ptrScore = score.ptr(0, ch, row); + uchar *ptrMaxCl = maxCl.ptr(row); + float *ptrMaxVal = maxVal.ptr(row); + for (int col = 0; col < cols; col++) + { + if (ptrScore[col] > ptrMaxVal[col]) + { + ptrMaxVal[col] = ptrScore[col]; + ptrMaxCl[col] = ch; + } + } + } + } + + segm.create(rows, cols, CV_8UC3); + for (int row = 0; row < rows; row++) + { + const uchar *ptrMaxCl = maxCl.ptr(row); + cv::Vec3b *ptrSegm = segm.ptr(row); + for (int col = 0; col < cols; col++) + { + ptrSegm[col] = colors[ptrMaxCl[col]]; + } + } + +} + +int main(int argc, char **argv) +{ + cv::dnn::initModule(); //Required if OpenCV is built as static libs + + String modelTxt = fcnType + "-heavy-pascal.prototxt"; + String modelBin = fcnType + "-heavy-pascal.caffemodel"; + String imageFile = (argc > 1) ? argv[1] : "rgb.jpg"; + + vector colors = readColors(); + + //! [Create the importer of Caffe model] + Ptr importer; + try //Try to import Caffe GoogleNet model + { + importer = dnn::createCaffeImporter(modelTxt, modelBin); + } + catch (const cv::Exception &err) //Importer can throw errors, we will catch them + { + cerr << err.msg << endl; + } + //! [Create the importer of Caffe model] + + if (!importer) + { + cerr << "Can't load network by using the following files: " << endl; + cerr << "prototxt: " << modelTxt << endl; + cerr << "caffemodel: " << modelBin << endl; + cerr << fcnType << "-heavy-pascal.caffemodel can be downloaded here:" << endl; + cerr << "http://dl.caffe.berkeleyvision.org/" << fcnType << "-heavy-pascal.caffemodel" << endl; + exit(-1); + } + + //! [Initialize network] + dnn::Net net; + importer->populateNet(net); + importer.release(); //We don't need importer anymore + //! [Initialize network] + + //! [Prepare blob] + Mat img = imread(imageFile); + if (img.empty()) + { + cerr << "Can't read image from the file: " << imageFile << endl; + exit(-1); + } + + resize(img, img, Size(500, 500)); //FCN accepts 500x500 RGB-images + Mat inputBlob = blobFromImage(img); //Convert Mat to batch of images + //! [Prepare blob] + + //! [Set input blob] + net.setInput(inputBlob, "data"); //set the network input + //! [Set input blob] + + //! [Make forward pass] + double t = (double)cv::getTickCount(); + Mat score = net.forward("score"); //compute output + t = (double)cv::getTickCount() - t; + printf("processing time: %.1fms\n", t*1000./getTickFrequency()); + //! [Make forward pass] + + Mat colorize; + colorizeSegmentation(score, colors, colorize); + Mat show; + addWeighted(img, 0.4, colorize, 0.6, 0.0, show); + imshow("show", show); + waitKey(0); + return 0; +} //main diff --git a/modules/dnn/samples/googlenet_python.py b/modules/dnn/samples/googlenet_python.py new file mode 100644 index 0000000000..53ccdc5518 --- /dev/null +++ b/modules/dnn/samples/googlenet_python.py @@ -0,0 +1,34 @@ +from __future__ import print_function +import numpy as np +import cv2 +from cv2 import dnn +import timeit + +def prepare_image(img): + img = cv2.resize(img, (224, 224)) + #convert interleaved image (RGBRGB) to planar(RRGGBB) + blob = np.moveaxis(img, 2, 0) + blob = np.reshape(blob.astype(np.float32), (-1, 3, 224, 224)) + return blob + +def timeit_forward(net): + print("OpenCL:", cv2.ocl.useOpenCL()) + print("Runtime:", timeit.timeit(lambda: net.forward(), number=10)) + +def get_class_list(): + with open('synset_words.txt', 'rt') as f: + return [ x[x.find(" ") + 1 :] for x in f ] + +blob = prepare_image(cv2.imread('space_shuttle.jpg')) +print("Input:", blob.shape, blob.dtype) + +cv2.ocl.setUseOpenCL(True) #Disable OCL if you want +net = dnn.readNetFromCaffe('bvlc_googlenet.prototxt', 'bvlc_googlenet.caffemodel') +net.setBlob(".data", blob) +net.forward() +#timeit_forward(net) #Uncomment to check performance + +prob = net.getBlob("prob") +print("Output:", prob.shape, prob.dtype) +classes = get_class_list() +print("Best match", classes[prob.argmax()]) \ No newline at end of file diff --git a/modules/dnn/samples/pascal-classes.txt b/modules/dnn/samples/pascal-classes.txt new file mode 100644 index 0000000000..a3a62c1911 --- /dev/null +++ b/modules/dnn/samples/pascal-classes.txt @@ -0,0 +1,21 @@ +background 0 0 0 +aeroplane 128 0 0 +bicycle 0 128 0 +bird 128 128 0 +boat 0 0 128 +bottle 128 0 128 +bus 0 128 128 +car 128 128 128 +cat 64 0 0 +chair 192 0 0 +cow 64 128 0 +diningtable 192 128 0 +dog 64 0 128 +horse 192 0 128 +motorbike 64 128 128 +person 192 128 128 +pottedplant 0 64 0 +sheep 128 64 0 +sofa 0 192 0 +train 128 192 0 +tvmonitor 0 64 128 diff --git a/modules/dnn/samples/rgb.jpg b/modules/dnn/samples/rgb.jpg new file mode 100644 index 0000000000..f78e6e44e1 Binary files /dev/null and b/modules/dnn/samples/rgb.jpg differ diff --git a/modules/dnn/samples/space_shuttle.jpg b/modules/dnn/samples/space_shuttle.jpg new file mode 100644 index 0000000000..412a919694 Binary files /dev/null and b/modules/dnn/samples/space_shuttle.jpg differ diff --git a/modules/dnn/samples/squeezenet_halide.cpp b/modules/dnn/samples/squeezenet_halide.cpp new file mode 100644 index 0000000000..39f88caae9 --- /dev/null +++ b/modules/dnn/samples/squeezenet_halide.cpp @@ -0,0 +1,120 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +// Sample of using Halide backend in OpenCV deep learning module. +// Based on dnn/samples/caffe_googlenet.cpp. + +#include +#include +#include +using namespace cv; +using namespace cv::dnn; + +#include +#include +#include + +/* Find best class for the blob (i. e. class with maximal probability) */ +void getMaxClass(const Mat &probBlob, int *classId, double *classProb) +{ + Mat probMat = probBlob.reshape(1, 1); //reshape the blob to 1x1000 matrix + Point classNumber; + + minMaxLoc(probMat, NULL, classProb, NULL, &classNumber); + *classId = classNumber.x; +} + +std::vector readClassNames(const char *filename = "synset_words.txt") +{ + std::vector classNames; + + std::ifstream fp(filename); + if (!fp.is_open()) + { + std::cerr << "File with classes labels not found: " << filename << std::endl; + exit(-1); + } + + std::string name; + while (!fp.eof()) + { + std::getline(fp, name); + if (name.length()) + classNames.push_back( name.substr(name.find(' ')+1) ); + } + + fp.close(); + return classNames; +} + +int main(int argc, char **argv) +{ + initModule(); // Required if OpenCV is built as static libs. + + std::string modelTxt = "train_val.prototxt"; + std::string modelBin = "squeezenet_v1.1.caffemodel"; + std::string imageFile = (argc > 1) ? argv[1] : "space_shuttle.jpg"; + + //! [Read and initialize network] + Net net = dnn::readNetFromCaffe(modelTxt, modelBin); + //! [Read and initialize network] + + //! [Check that network was read successfully] + if (net.empty()) + { + std::cerr << "Can't load network by using the following files: " << std::endl; + std::cerr << "prototxt: " << modelTxt << std::endl; + std::cerr << "caffemodel: " << modelBin << std::endl; + std::cerr << "SqueezeNet v1.1 can be downloaded from:" << std::endl; + std::cerr << "https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1" << std::endl; + exit(-1); + } + //! [Check that network was read successfully] + + //! [Prepare blob] + Mat img = imread(imageFile); + if (img.empty()) + { + std::cerr << "Can't read image from the file: " << imageFile << std::endl; + exit(-1); + } + if (img.channels() != 3) + { + std::cerr << "Image " << imageFile << " isn't 3-channel" << std::endl; + exit(-1); + } + + resize(img, img, Size(227, 227)); // SqueezeNet v1.1 predict class by 3x227x227 input image. + Mat inputBlob = blobFromImage(img, 1.0, Size(), Scalar(), false); // Convert Mat to 4-dimensional batch. + //! [Prepare blob] + + //! [Set input blob] + net.setInput(inputBlob); // Set the network input. + //! [Set input blob] + + //! [Enable Halide backend] + net.setPreferableBackend(DNN_BACKEND_HALIDE); // Tell engine to use Halide where it possible. + //! [Enable Halide backend] + + //! [Make forward pass] + Mat prob = net.forward("prob"); // Compute output. + //! [Make forward pass] + + //! [Determine the best class] + int classId; + double classProb; + getMaxClass(prob, &classId, &classProb); // Find the best class. + //! [Determine the best class] + + //! [Print results] + std::vector classNames = readClassNames(); + std::cout << "Best class: #" << classId << " '" << classNames.at(classId) << "'" << std::endl; + std::cout << "Probability: " << classProb * 100 << "%" << std::endl; + //! [Print results] + + return 0; +} //main diff --git a/modules/dnn/samples/ssd_object_detection.cpp b/modules/dnn/samples/ssd_object_detection.cpp new file mode 100644 index 0000000000..016357c4b3 --- /dev/null +++ b/modules/dnn/samples/ssd_object_detection.cpp @@ -0,0 +1,154 @@ +#include +#include +#include +#include +using namespace cv; +using namespace cv::dnn; + +#include +#include +#include +using namespace std; + +const size_t width = 300; +const size_t height = 300; + +Mat getMean(const size_t& imageHeight, const size_t& imageWidth) +{ + Mat mean; + + const int meanValues[3] = {104, 117, 123}; + vector meanChannels; + for(size_t i = 0; i < 3; i++) + { + Mat channel(imageHeight, imageWidth, CV_32F, Scalar(meanValues[i])); + meanChannels.push_back(channel); + } + cv::merge(meanChannels, mean); + return mean; +} + +Mat preprocess(const Mat& frame) +{ + Mat preprocessed; + frame.convertTo(preprocessed, CV_32F); + resize(preprocessed, preprocessed, Size(width, height)); //SSD accepts 300x300 RGB-images + + Mat mean = getMean(width, height); + cv::subtract(preprocessed, mean, preprocessed); + + return preprocessed; +} + +const char* about = "This sample uses Single-Shot Detector " + "(https://arxiv.org/abs/1512.02325)" + "to detect objects on image\n"; // TODO: link + +const char* params + = "{ help | false | print usage }" + "{ proto | | model configuration }" + "{ model | | model weights }" + "{ image | | image for detection }" + "{ min_confidence | 0.5 | min confidence }"; + +int main(int argc, char** argv) +{ + cv::CommandLineParser parser(argc, argv, params); + + if (parser.get("help")) + { + std::cout << about << std::endl; + parser.printMessage(); + return 0; + } + + cv::dnn::initModule(); //Required if OpenCV is built as static libs + + String modelConfiguration = parser.get("proto"); + String modelBinary = parser.get("model"); + + //! [Create the importer of Caffe model] + Ptr importer; + + // Import Caffe SSD model + try + { + importer = dnn::createCaffeImporter(modelConfiguration, modelBinary); + } + catch (const cv::Exception &err) //Importer can throw errors, we will catch them + { + cerr << err.msg << endl; + } + //! [Create the importer of Caffe model] + + if (!importer) + { + cerr << "Can't load network by using the following files: " << endl; + cerr << "prototxt: " << modelConfiguration << endl; + cerr << "caffemodel: " << modelBinary << endl; + cerr << "Models can be downloaded here:" << endl; + cerr << "https://github.com/weiliu89/caffe/tree/ssd#models" << endl; + exit(-1); + } + + //! [Initialize network] + dnn::Net net; + importer->populateNet(net); + importer.release(); //We don't need importer anymore + //! [Initialize network] + + cv::Mat frame = cv::imread(parser.get("image"), -1); + + if (frame.channels() == 4) + cvtColor(frame, frame, COLOR_BGRA2BGR); + //! [Prepare blob] + Mat preprocessedFrame = preprocess(frame); + + Mat inputBlob = blobFromImage(preprocessedFrame); //Convert Mat to batch of images + //! [Prepare blob] + + //! [Set input blob] + net.setInput(inputBlob, "data"); //set the network input + //! [Set input blob] + + //! [Make forward pass] + Mat detection = net.forward("detection_out"); //compute output + //! [Make forward pass] + + Mat detectionMat(detection.size[2], detection.size[3], CV_32F, detection.ptr()); + + float confidenceThreshold = parser.get("min_confidence"); + for(int i = 0; i < detectionMat.rows; i++) + { + float confidence = detectionMat.at(i, 2); + + if(confidence > confidenceThreshold) + { + size_t objectClass = detectionMat.at(i, 1); + + float xLeftBottom = detectionMat.at(i, 3) * frame.cols; + float yLeftBottom = detectionMat.at(i, 4) * frame.rows; + float xRightTop = detectionMat.at(i, 5) * frame.cols; + float yRightTop = detectionMat.at(i, 6) * frame.rows; + + std::cout << "Class: " << objectClass << std::endl; + std::cout << "Confidence: " << confidence << std::endl; + + std::cout << " " << xLeftBottom + << " " << yLeftBottom + << " " << xRightTop + << " " << yRightTop << std::endl; + + Rect object(xLeftBottom, yLeftBottom, + xRightTop - xLeftBottom, + yRightTop - yLeftBottom); + + rectangle(frame, object, Scalar(0, 255, 0)); + } + } + + imshow("detections", frame); + waitKey(); + + return 0; +} // main diff --git a/modules/dnn/samples/synset_words.txt b/modules/dnn/samples/synset_words.txt new file mode 100644 index 0000000000..a9e8c7f50d --- /dev/null +++ b/modules/dnn/samples/synset_words.txt @@ -0,0 +1,1000 @@ +n01440764 tench, Tinca tinca +n01443537 goldfish, Carassius auratus +n01484850 great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias +n01491361 tiger shark, Galeocerdo cuvieri +n01494475 hammerhead, hammerhead shark +n01496331 electric ray, crampfish, numbfish, torpedo +n01498041 stingray +n01514668 cock +n01514859 hen +n01518878 ostrich, Struthio camelus +n01530575 brambling, Fringilla montifringilla +n01531178 goldfinch, Carduelis carduelis +n01532829 house finch, linnet, Carpodacus mexicanus +n01534433 junco, snowbird +n01537544 indigo bunting, indigo finch, indigo bird, Passerina cyanea +n01558993 robin, American robin, Turdus migratorius +n01560419 bulbul +n01580077 jay +n01582220 magpie +n01592084 chickadee +n01601694 water ouzel, dipper +n01608432 kite +n01614925 bald eagle, American eagle, Haliaeetus leucocephalus +n01616318 vulture +n01622779 great grey owl, great gray owl, Strix nebulosa +n01629819 European fire salamander, Salamandra salamandra +n01630670 common newt, Triturus vulgaris +n01631663 eft +n01632458 spotted salamander, Ambystoma maculatum +n01632777 axolotl, mud puppy, Ambystoma mexicanum +n01641577 bullfrog, Rana catesbeiana +n01644373 tree frog, tree-frog +n01644900 tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui +n01664065 loggerhead, loggerhead turtle, Caretta caretta +n01665541 leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea +n01667114 mud turtle +n01667778 terrapin +n01669191 box turtle, box tortoise +n01675722 banded gecko +n01677366 common iguana, iguana, Iguana iguana +n01682714 American chameleon, anole, Anolis carolinensis +n01685808 whiptail, whiptail lizard +n01687978 agama +n01688243 frilled lizard, Chlamydosaurus kingi +n01689811 alligator lizard +n01692333 Gila monster, Heloderma suspectum +n01693334 green lizard, Lacerta viridis +n01694178 African chameleon, Chamaeleo chamaeleon +n01695060 Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis +n01697457 African crocodile, Nile crocodile, Crocodylus niloticus +n01698640 American alligator, Alligator mississipiensis +n01704323 triceratops +n01728572 thunder snake, worm snake, Carphophis amoenus +n01728920 ringneck snake, ring-necked snake, ring snake +n01729322 hognose snake, puff adder, sand viper +n01729977 green snake, grass snake +n01734418 king snake, kingsnake +n01735189 garter snake, grass snake +n01737021 water snake +n01739381 vine snake +n01740131 night snake, Hypsiglena torquata +n01742172 boa constrictor, Constrictor constrictor +n01744401 rock python, rock snake, Python sebae +n01748264 Indian cobra, Naja naja +n01749939 green mamba +n01751748 sea snake +n01753488 horned viper, cerastes, sand viper, horned asp, Cerastes cornutus +n01755581 diamondback, diamondback rattlesnake, Crotalus adamanteus +n01756291 sidewinder, horned rattlesnake, Crotalus cerastes +n01768244 trilobite +n01770081 harvestman, daddy longlegs, Phalangium opilio +n01770393 scorpion +n01773157 black and gold garden spider, Argiope aurantia +n01773549 barn spider, Araneus cavaticus +n01773797 garden spider, Aranea diademata +n01774384 black widow, Latrodectus mactans +n01774750 tarantula +n01775062 wolf spider, hunting spider +n01776313 tick +n01784675 centipede +n01795545 black grouse +n01796340 ptarmigan +n01797886 ruffed grouse, partridge, Bonasa umbellus +n01798484 prairie chicken, prairie grouse, prairie fowl +n01806143 peacock +n01806567 quail +n01807496 partridge +n01817953 African grey, African gray, Psittacus erithacus +n01818515 macaw +n01819313 sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita +n01820546 lorikeet +n01824575 coucal +n01828970 bee eater +n01829413 hornbill +n01833805 hummingbird +n01843065 jacamar +n01843383 toucan +n01847000 drake +n01855032 red-breasted merganser, Mergus serrator +n01855672 goose +n01860187 black swan, Cygnus atratus +n01871265 tusker +n01872401 echidna, spiny anteater, anteater +n01873310 platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus +n01877812 wallaby, brush kangaroo +n01882714 koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus +n01883070 wombat +n01910747 jellyfish +n01914609 sea anemone, anemone +n01917289 brain coral +n01924916 flatworm, platyhelminth +n01930112 nematode, nematode worm, roundworm +n01943899 conch +n01944390 snail +n01945685 slug +n01950731 sea slug, nudibranch +n01955084 chiton, coat-of-mail shell, sea cradle, polyplacophore +n01968897 chambered nautilus, pearly nautilus, nautilus +n01978287 Dungeness crab, Cancer magister +n01978455 rock crab, Cancer irroratus +n01980166 fiddler crab +n01981276 king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica +n01983481 American lobster, Northern lobster, Maine lobster, Homarus americanus +n01984695 spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish +n01985128 crayfish, crawfish, crawdad, crawdaddy +n01986214 hermit crab +n01990800 isopod +n02002556 white stork, Ciconia ciconia +n02002724 black stork, Ciconia nigra +n02006656 spoonbill +n02007558 flamingo +n02009229 little blue heron, Egretta caerulea +n02009912 American egret, great white heron, Egretta albus +n02011460 bittern +n02012849 crane +n02013706 limpkin, Aramus pictus +n02017213 European gallinule, Porphyrio porphyrio +n02018207 American coot, marsh hen, mud hen, water hen, Fulica americana +n02018795 bustard +n02025239 ruddy turnstone, Arenaria interpres +n02027492 red-backed sandpiper, dunlin, Erolia alpina +n02028035 redshank, Tringa totanus +n02033041 dowitcher +n02037110 oystercatcher, oyster catcher +n02051845 pelican +n02056570 king penguin, Aptenodytes patagonica +n02058221 albatross, mollymawk +n02066245 grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus +n02071294 killer whale, killer, orca, grampus, sea wolf, Orcinus orca +n02074367 dugong, Dugong dugon +n02077923 sea lion +n02085620 Chihuahua +n02085782 Japanese spaniel +n02085936 Maltese dog, Maltese terrier, Maltese +n02086079 Pekinese, Pekingese, Peke +n02086240 Shih-Tzu +n02086646 Blenheim spaniel +n02086910 papillon +n02087046 toy terrier +n02087394 Rhodesian ridgeback +n02088094 Afghan hound, Afghan +n02088238 basset, basset hound +n02088364 beagle +n02088466 bloodhound, sleuthhound +n02088632 bluetick +n02089078 black-and-tan coonhound +n02089867 Walker hound, Walker foxhound +n02089973 English foxhound +n02090379 redbone +n02090622 borzoi, Russian wolfhound +n02090721 Irish wolfhound +n02091032 Italian greyhound +n02091134 whippet +n02091244 Ibizan hound, Ibizan Podenco +n02091467 Norwegian elkhound, elkhound +n02091635 otterhound, otter hound +n02091831 Saluki, gazelle hound +n02092002 Scottish deerhound, deerhound +n02092339 Weimaraner +n02093256 Staffordshire bullterrier, Staffordshire bull terrier +n02093428 American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier +n02093647 Bedlington terrier +n02093754 Border terrier +n02093859 Kerry blue terrier +n02093991 Irish terrier +n02094114 Norfolk terrier +n02094258 Norwich terrier +n02094433 Yorkshire terrier +n02095314 wire-haired fox terrier +n02095570 Lakeland terrier +n02095889 Sealyham terrier, Sealyham +n02096051 Airedale, Airedale terrier +n02096177 cairn, cairn terrier +n02096294 Australian terrier +n02096437 Dandie Dinmont, Dandie Dinmont terrier +n02096585 Boston bull, Boston terrier +n02097047 miniature schnauzer +n02097130 giant schnauzer +n02097209 standard schnauzer +n02097298 Scotch terrier, Scottish terrier, Scottie +n02097474 Tibetan terrier, chrysanthemum dog +n02097658 silky terrier, Sydney silky +n02098105 soft-coated wheaten terrier +n02098286 West Highland white terrier +n02098413 Lhasa, Lhasa apso +n02099267 flat-coated retriever +n02099429 curly-coated retriever +n02099601 golden retriever +n02099712 Labrador retriever +n02099849 Chesapeake Bay retriever +n02100236 German short-haired pointer +n02100583 vizsla, Hungarian pointer +n02100735 English setter +n02100877 Irish setter, red setter +n02101006 Gordon setter +n02101388 Brittany spaniel +n02101556 clumber, clumber spaniel +n02102040 English springer, English springer spaniel +n02102177 Welsh springer spaniel +n02102318 cocker spaniel, English cocker spaniel, cocker +n02102480 Sussex spaniel +n02102973 Irish water spaniel +n02104029 kuvasz +n02104365 schipperke +n02105056 groenendael +n02105162 malinois +n02105251 briard +n02105412 kelpie +n02105505 komondor +n02105641 Old English sheepdog, bobtail +n02105855 Shetland sheepdog, Shetland sheep dog, Shetland +n02106030 collie +n02106166 Border collie +n02106382 Bouvier des Flandres, Bouviers des Flandres +n02106550 Rottweiler +n02106662 German shepherd, German shepherd dog, German police dog, alsatian +n02107142 Doberman, Doberman pinscher +n02107312 miniature pinscher +n02107574 Greater Swiss Mountain dog +n02107683 Bernese mountain dog +n02107908 Appenzeller +n02108000 EntleBucher +n02108089 boxer +n02108422 bull mastiff +n02108551 Tibetan mastiff +n02108915 French bulldog +n02109047 Great Dane +n02109525 Saint Bernard, St Bernard +n02109961 Eskimo dog, husky +n02110063 malamute, malemute, Alaskan malamute +n02110185 Siberian husky +n02110341 dalmatian, coach dog, carriage dog +n02110627 affenpinscher, monkey pinscher, monkey dog +n02110806 basenji +n02110958 pug, pug-dog +n02111129 Leonberg +n02111277 Newfoundland, Newfoundland dog +n02111500 Great Pyrenees +n02111889 Samoyed, Samoyede +n02112018 Pomeranian +n02112137 chow, chow chow +n02112350 keeshond +n02112706 Brabancon griffon +n02113023 Pembroke, Pembroke Welsh corgi +n02113186 Cardigan, Cardigan Welsh corgi +n02113624 toy poodle +n02113712 miniature poodle +n02113799 standard poodle +n02113978 Mexican hairless +n02114367 timber wolf, grey wolf, gray wolf, Canis lupus +n02114548 white wolf, Arctic wolf, Canis lupus tundrarum +n02114712 red wolf, maned wolf, Canis rufus, Canis niger +n02114855 coyote, prairie wolf, brush wolf, Canis latrans +n02115641 dingo, warrigal, warragal, Canis dingo +n02115913 dhole, Cuon alpinus +n02116738 African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus +n02117135 hyena, hyaena +n02119022 red fox, Vulpes vulpes +n02119789 kit fox, Vulpes macrotis +n02120079 Arctic fox, white fox, Alopex lagopus +n02120505 grey fox, gray fox, Urocyon cinereoargenteus +n02123045 tabby, tabby cat +n02123159 tiger cat +n02123394 Persian cat +n02123597 Siamese cat, Siamese +n02124075 Egyptian cat +n02125311 cougar, puma, catamount, mountain lion, painter, panther, Felis concolor +n02127052 lynx, catamount +n02128385 leopard, Panthera pardus +n02128757 snow leopard, ounce, Panthera uncia +n02128925 jaguar, panther, Panthera onca, Felis onca +n02129165 lion, king of beasts, Panthera leo +n02129604 tiger, Panthera tigris +n02130308 cheetah, chetah, Acinonyx jubatus +n02132136 brown bear, bruin, Ursus arctos +n02133161 American black bear, black bear, Ursus americanus, Euarctos americanus +n02134084 ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus +n02134418 sloth bear, Melursus ursinus, Ursus ursinus +n02137549 mongoose +n02138441 meerkat, mierkat +n02165105 tiger beetle +n02165456 ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle +n02167151 ground beetle, carabid beetle +n02168699 long-horned beetle, longicorn, longicorn beetle +n02169497 leaf beetle, chrysomelid +n02172182 dung beetle +n02174001 rhinoceros beetle +n02177972 weevil +n02190166 fly +n02206856 bee +n02219486 ant, emmet, pismire +n02226429 grasshopper, hopper +n02229544 cricket +n02231487 walking stick, walkingstick, stick insect +n02233338 cockroach, roach +n02236044 mantis, mantid +n02256656 cicada, cicala +n02259212 leafhopper +n02264363 lacewing, lacewing fly +n02268443 dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk +n02268853 damselfly +n02276258 admiral +n02277742 ringlet, ringlet butterfly +n02279972 monarch, monarch butterfly, milkweed butterfly, Danaus plexippus +n02280649 cabbage butterfly +n02281406 sulphur butterfly, sulfur butterfly +n02281787 lycaenid, lycaenid butterfly +n02317335 starfish, sea star +n02319095 sea urchin +n02321529 sea cucumber, holothurian +n02325366 wood rabbit, cottontail, cottontail rabbit +n02326432 hare +n02328150 Angora, Angora rabbit +n02342885 hamster +n02346627 porcupine, hedgehog +n02356798 fox squirrel, eastern fox squirrel, Sciurus niger +n02361337 marmot +n02363005 beaver +n02364673 guinea pig, Cavia cobaya +n02389026 sorrel +n02391049 zebra +n02395406 hog, pig, grunter, squealer, Sus scrofa +n02396427 wild boar, boar, Sus scrofa +n02397096 warthog +n02398521 hippopotamus, hippo, river horse, Hippopotamus amphibius +n02403003 ox +n02408429 water buffalo, water ox, Asiatic buffalo, Bubalus bubalis +n02410509 bison +n02412080 ram, tup +n02415577 bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis +n02417914 ibex, Capra ibex +n02422106 hartebeest +n02422699 impala, Aepyceros melampus +n02423022 gazelle +n02437312 Arabian camel, dromedary, Camelus dromedarius +n02437616 llama +n02441942 weasel +n02442845 mink +n02443114 polecat, fitch, foulmart, foumart, Mustela putorius +n02443484 black-footed ferret, ferret, Mustela nigripes +n02444819 otter +n02445715 skunk, polecat, wood pussy +n02447366 badger +n02454379 armadillo +n02457408 three-toed sloth, ai, Bradypus tridactylus +n02480495 orangutan, orang, orangutang, Pongo pygmaeus +n02480855 gorilla, Gorilla gorilla +n02481823 chimpanzee, chimp, Pan troglodytes +n02483362 gibbon, Hylobates lar +n02483708 siamang, Hylobates syndactylus, Symphalangus syndactylus +n02484975 guenon, guenon monkey +n02486261 patas, hussar monkey, Erythrocebus patas +n02486410 baboon +n02487347 macaque +n02488291 langur +n02488702 colobus, colobus monkey +n02489166 proboscis monkey, Nasalis larvatus +n02490219 marmoset +n02492035 capuchin, ringtail, Cebus capucinus +n02492660 howler monkey, howler +n02493509 titi, titi monkey +n02493793 spider monkey, Ateles geoffroyi +n02494079 squirrel monkey, Saimiri sciureus +n02497673 Madagascar cat, ring-tailed lemur, Lemur catta +n02500267 indri, indris, Indri indri, Indri brevicaudatus +n02504013 Indian elephant, Elephas maximus +n02504458 African elephant, Loxodonta africana +n02509815 lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens +n02510455 giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca +n02514041 barracouta, snoek +n02526121 eel +n02536864 coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch +n02606052 rock beauty, Holocanthus tricolor +n02607072 anemone fish +n02640242 sturgeon +n02641379 gar, garfish, garpike, billfish, Lepisosteus osseus +n02643566 lionfish +n02655020 puffer, pufferfish, blowfish, globefish +n02666196 abacus +n02667093 abaya +n02669723 academic gown, academic robe, judge's robe +n02672831 accordion, piano accordion, squeeze box +n02676566 acoustic guitar +n02687172 aircraft carrier, carrier, flattop, attack aircraft carrier +n02690373 airliner +n02692877 airship, dirigible +n02699494 altar +n02701002 ambulance +n02704792 amphibian, amphibious vehicle +n02708093 analog clock +n02727426 apiary, bee house +n02730930 apron +n02747177 ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin +n02749479 assault rifle, assault gun +n02769748 backpack, back pack, knapsack, packsack, rucksack, haversack +n02776631 bakery, bakeshop, bakehouse +n02777292 balance beam, beam +n02782093 balloon +n02783161 ballpoint, ballpoint pen, ballpen, Biro +n02786058 Band Aid +n02787622 banjo +n02788148 bannister, banister, balustrade, balusters, handrail +n02790996 barbell +n02791124 barber chair +n02791270 barbershop +n02793495 barn +n02794156 barometer +n02795169 barrel, cask +n02797295 barrow, garden cart, lawn cart, wheelbarrow +n02799071 baseball +n02802426 basketball +n02804414 bassinet +n02804610 bassoon +n02807133 bathing cap, swimming cap +n02808304 bath towel +n02808440 bathtub, bathing tub, bath, tub +n02814533 beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon +n02814860 beacon, lighthouse, beacon light, pharos +n02815834 beaker +n02817516 bearskin, busby, shako +n02823428 beer bottle +n02823750 beer glass +n02825657 bell cote, bell cot +n02834397 bib +n02835271 bicycle-built-for-two, tandem bicycle, tandem +n02837789 bikini, two-piece +n02840245 binder, ring-binder +n02841315 binoculars, field glasses, opera glasses +n02843684 birdhouse +n02859443 boathouse +n02860847 bobsled, bobsleigh, bob +n02865351 bolo tie, bolo, bola tie, bola +n02869837 bonnet, poke bonnet +n02870880 bookcase +n02871525 bookshop, bookstore, bookstall +n02877765 bottlecap +n02879718 bow +n02883205 bow tie, bow-tie, bowtie +n02892201 brass, memorial tablet, plaque +n02892767 brassiere, bra, bandeau +n02894605 breakwater, groin, groyne, mole, bulwark, seawall, jetty +n02895154 breastplate, aegis, egis +n02906734 broom +n02909870 bucket, pail +n02910353 buckle +n02916936 bulletproof vest +n02917067 bullet train, bullet +n02927161 butcher shop, meat market +n02930766 cab, hack, taxi, taxicab +n02939185 caldron, cauldron +n02948072 candle, taper, wax light +n02950826 cannon +n02951358 canoe +n02951585 can opener, tin opener +n02963159 cardigan +n02965783 car mirror +n02966193 carousel, carrousel, merry-go-round, roundabout, whirligig +n02966687 carpenter's kit, tool kit +n02971356 carton +n02974003 car wheel +n02977058 cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM +n02978881 cassette +n02979186 cassette player +n02980441 castle +n02981792 catamaran +n02988304 CD player +n02992211 cello, violoncello +n02992529 cellular telephone, cellular phone, cellphone, cell, mobile phone +n02999410 chain +n03000134 chainlink fence +n03000247 chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour +n03000684 chain saw, chainsaw +n03014705 chest +n03016953 chiffonier, commode +n03017168 chime, bell, gong +n03018349 china cabinet, china closet +n03026506 Christmas stocking +n03028079 church, church building +n03032252 cinema, movie theater, movie theatre, movie house, picture palace +n03041632 cleaver, meat cleaver, chopper +n03042490 cliff dwelling +n03045698 cloak +n03047690 clog, geta, patten, sabot +n03062245 cocktail shaker +n03063599 coffee mug +n03063689 coffeepot +n03065424 coil, spiral, volute, whorl, helix +n03075370 combination lock +n03085013 computer keyboard, keypad +n03089624 confectionery, confectionary, candy store +n03095699 container ship, containership, container vessel +n03100240 convertible +n03109150 corkscrew, bottle screw +n03110669 cornet, horn, trumpet, trump +n03124043 cowboy boot +n03124170 cowboy hat, ten-gallon hat +n03125729 cradle +n03126707 crane +n03127747 crash helmet +n03127925 crate +n03131574 crib, cot +n03133878 Crock Pot +n03134739 croquet ball +n03141823 crutch +n03146219 cuirass +n03160309 dam, dike, dyke +n03179701 desk +n03180011 desktop computer +n03187595 dial telephone, dial phone +n03188531 diaper, nappy, napkin +n03196217 digital clock +n03197337 digital watch +n03201208 dining table, board +n03207743 dishrag, dishcloth +n03207941 dishwasher, dish washer, dishwashing machine +n03208938 disk brake, disc brake +n03216828 dock, dockage, docking facility +n03218198 dogsled, dog sled, dog sleigh +n03220513 dome +n03223299 doormat, welcome mat +n03240683 drilling platform, offshore rig +n03249569 drum, membranophone, tympan +n03250847 drumstick +n03255030 dumbbell +n03259280 Dutch oven +n03271574 electric fan, blower +n03272010 electric guitar +n03272562 electric locomotive +n03290653 entertainment center +n03291819 envelope +n03297495 espresso maker +n03314780 face powder +n03325584 feather boa, boa +n03337140 file, file cabinet, filing cabinet +n03344393 fireboat +n03345487 fire engine, fire truck +n03347037 fire screen, fireguard +n03355925 flagpole, flagstaff +n03372029 flute, transverse flute +n03376595 folding chair +n03379051 football helmet +n03384352 forklift +n03388043 fountain +n03388183 fountain pen +n03388549 four-poster +n03393912 freight car +n03394916 French horn, horn +n03400231 frying pan, frypan, skillet +n03404251 fur coat +n03417042 garbage truck, dustcart +n03424325 gasmask, respirator, gas helmet +n03425413 gas pump, gasoline pump, petrol pump, island dispenser +n03443371 goblet +n03444034 go-kart +n03445777 golf ball +n03445924 golfcart, golf cart +n03447447 gondola +n03447721 gong, tam-tam +n03450230 gown +n03452741 grand piano, grand +n03457902 greenhouse, nursery, glasshouse +n03459775 grille, radiator grille +n03461385 grocery store, grocery, food market, market +n03467068 guillotine +n03476684 hair slide +n03476991 hair spray +n03478589 half track +n03481172 hammer +n03482405 hamper +n03483316 hand blower, blow dryer, blow drier, hair dryer, hair drier +n03485407 hand-held computer, hand-held microcomputer +n03485794 handkerchief, hankie, hanky, hankey +n03492542 hard disc, hard disk, fixed disk +n03494278 harmonica, mouth organ, harp, mouth harp +n03495258 harp +n03496892 harvester, reaper +n03498962 hatchet +n03527444 holster +n03529860 home theater, home theatre +n03530642 honeycomb +n03532672 hook, claw +n03534580 hoopskirt, crinoline +n03535780 horizontal bar, high bar +n03538406 horse cart, horse-cart +n03544143 hourglass +n03584254 iPod +n03584829 iron, smoothing iron +n03590841 jack-o'-lantern +n03594734 jean, blue jean, denim +n03594945 jeep, landrover +n03595614 jersey, T-shirt, tee shirt +n03598930 jigsaw puzzle +n03599486 jinrikisha, ricksha, rickshaw +n03602883 joystick +n03617480 kimono +n03623198 knee pad +n03627232 knot +n03630383 lab coat, laboratory coat +n03633091 ladle +n03637318 lampshade, lamp shade +n03642806 laptop, laptop computer +n03649909 lawn mower, mower +n03657121 lens cap, lens cover +n03658185 letter opener, paper knife, paperknife +n03661043 library +n03662601 lifeboat +n03666591 lighter, light, igniter, ignitor +n03670208 limousine, limo +n03673027 liner, ocean liner +n03676483 lipstick, lip rouge +n03680355 Loafer +n03690938 lotion +n03691459 loudspeaker, speaker, speaker unit, loudspeaker system, speaker system +n03692522 loupe, jeweler's loupe +n03697007 lumbermill, sawmill +n03706229 magnetic compass +n03709823 mailbag, postbag +n03710193 mailbox, letter box +n03710637 maillot +n03710721 maillot, tank suit +n03717622 manhole cover +n03720891 maraca +n03721384 marimba, xylophone +n03724870 mask +n03729826 matchstick +n03733131 maypole +n03733281 maze, labyrinth +n03733805 measuring cup +n03742115 medicine chest, medicine cabinet +n03743016 megalith, megalithic structure +n03759954 microphone, mike +n03761084 microwave, microwave oven +n03763968 military uniform +n03764736 milk can +n03769881 minibus +n03770439 miniskirt, mini +n03770679 minivan +n03773504 missile +n03775071 mitten +n03775546 mixing bowl +n03776460 mobile home, manufactured home +n03777568 Model T +n03777754 modem +n03781244 monastery +n03782006 monitor +n03785016 moped +n03786901 mortar +n03787032 mortarboard +n03788195 mosque +n03788365 mosquito net +n03791053 motor scooter, scooter +n03792782 mountain bike, all-terrain bike, off-roader +n03792972 mountain tent +n03793489 mouse, computer mouse +n03794056 mousetrap +n03796401 moving van +n03803284 muzzle +n03804744 nail +n03814639 neck brace +n03814906 necklace +n03825788 nipple +n03832673 notebook, notebook computer +n03837869 obelisk +n03838899 oboe, hautboy, hautbois +n03840681 ocarina, sweet potato +n03841143 odometer, hodometer, mileometer, milometer +n03843555 oil filter +n03854065 organ, pipe organ +n03857828 oscilloscope, scope, cathode-ray oscilloscope, CRO +n03866082 overskirt +n03868242 oxcart +n03868863 oxygen mask +n03871628 packet +n03873416 paddle, boat paddle +n03874293 paddlewheel, paddle wheel +n03874599 padlock +n03876231 paintbrush +n03877472 pajama, pyjama, pj's, jammies +n03877845 palace +n03884397 panpipe, pandean pipe, syrinx +n03887697 paper towel +n03888257 parachute, chute +n03888605 parallel bars, bars +n03891251 park bench +n03891332 parking meter +n03895866 passenger car, coach, carriage +n03899768 patio, terrace +n03902125 pay-phone, pay-station +n03903868 pedestal, plinth, footstall +n03908618 pencil box, pencil case +n03908714 pencil sharpener +n03916031 perfume, essence +n03920288 Petri dish +n03924679 photocopier +n03929660 pick, plectrum, plectron +n03929855 pickelhaube +n03930313 picket fence, paling +n03930630 pickup, pickup truck +n03933933 pier +n03935335 piggy bank, penny bank +n03937543 pill bottle +n03938244 pillow +n03942813 ping-pong ball +n03944341 pinwheel +n03947888 pirate, pirate ship +n03950228 pitcher, ewer +n03954731 plane, carpenter's plane, woodworking plane +n03956157 planetarium +n03958227 plastic bag +n03961711 plate rack +n03967562 plow, plough +n03970156 plunger, plumber's helper +n03976467 Polaroid camera, Polaroid Land camera +n03976657 pole +n03977966 police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria +n03980874 poncho +n03982430 pool table, billiard table, snooker table +n03983396 pop bottle, soda bottle +n03991062 pot, flowerpot +n03992509 potter's wheel +n03995372 power drill +n03998194 prayer rug, prayer mat +n04004767 printer +n04005630 prison, prison house +n04008634 projectile, missile +n04009552 projector +n04019541 puck, hockey puck +n04023962 punching bag, punch bag, punching ball, punchball +n04026417 purse +n04033901 quill, quill pen +n04033995 quilt, comforter, comfort, puff +n04037443 racer, race car, racing car +n04039381 racket, racquet +n04040759 radiator +n04041544 radio, wireless +n04044716 radio telescope, radio reflector +n04049303 rain barrel +n04065272 recreational vehicle, RV, R.V. +n04067472 reel +n04069434 reflex camera +n04070727 refrigerator, icebox +n04074963 remote control, remote +n04081281 restaurant, eating house, eating place, eatery +n04086273 revolver, six-gun, six-shooter +n04090263 rifle +n04099969 rocking chair, rocker +n04111531 rotisserie +n04116512 rubber eraser, rubber, pencil eraser +n04118538 rugby ball +n04118776 rule, ruler +n04120489 running shoe +n04125021 safe +n04127249 safety pin +n04131690 saltshaker, salt shaker +n04133789 sandal +n04136333 sarong +n04141076 sax, saxophone +n04141327 scabbard +n04141975 scale, weighing machine +n04146614 school bus +n04147183 schooner +n04149813 scoreboard +n04152593 screen, CRT screen +n04153751 screw +n04154565 screwdriver +n04162706 seat belt, seatbelt +n04179913 sewing machine +n04192698 shield, buckler +n04200800 shoe shop, shoe-shop, shoe store +n04201297 shoji +n04204238 shopping basket +n04204347 shopping cart +n04208210 shovel +n04209133 shower cap +n04209239 shower curtain +n04228054 ski +n04229816 ski mask +n04235860 sleeping bag +n04238763 slide rule, slipstick +n04239074 sliding door +n04243546 slot, one-armed bandit +n04251144 snorkel +n04252077 snowmobile +n04252225 snowplow, snowplough +n04254120 soap dispenser +n04254680 soccer ball +n04254777 sock +n04258138 solar dish, solar collector, solar furnace +n04259630 sombrero +n04263257 soup bowl +n04264628 space bar +n04265275 space heater +n04266014 space shuttle +n04270147 spatula +n04273569 speedboat +n04275548 spider web, spider's web +n04277352 spindle +n04285008 sports car, sport car +n04286575 spotlight, spot +n04296562 stage +n04310018 steam locomotive +n04311004 steel arch bridge +n04311174 steel drum +n04317175 stethoscope +n04325704 stole +n04326547 stone wall +n04328186 stopwatch, stop watch +n04330267 stove +n04332243 strainer +n04335435 streetcar, tram, tramcar, trolley, trolley car +n04336792 stretcher +n04344873 studio couch, day bed +n04346328 stupa, tope +n04347754 submarine, pigboat, sub, U-boat +n04350905 suit, suit of clothes +n04355338 sundial +n04355933 sunglass +n04356056 sunglasses, dark glasses, shades +n04357314 sunscreen, sunblock, sun blocker +n04366367 suspension bridge +n04367480 swab, swob, mop +n04370456 sweatshirt +n04371430 swimming trunks, bathing trunks +n04371774 swing +n04372370 switch, electric switch, electrical switch +n04376876 syringe +n04380533 table lamp +n04389033 tank, army tank, armored combat vehicle, armoured combat vehicle +n04392985 tape player +n04398044 teapot +n04399382 teddy, teddy bear +n04404412 television, television system +n04409515 tennis ball +n04417672 thatch, thatched roof +n04418357 theater curtain, theatre curtain +n04423845 thimble +n04428191 thresher, thrasher, threshing machine +n04429376 throne +n04435653 tile roof +n04442312 toaster +n04443257 tobacco shop, tobacconist shop, tobacconist +n04447861 toilet seat +n04456115 torch +n04458633 totem pole +n04461696 tow truck, tow car, wrecker +n04462240 toyshop +n04465501 tractor +n04467665 trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi +n04476259 tray +n04479046 trench coat +n04482393 tricycle, trike, velocipede +n04483307 trimaran +n04485082 tripod +n04486054 triumphal arch +n04487081 trolleybus, trolley coach, trackless trolley +n04487394 trombone +n04493381 tub, vat +n04501370 turnstile +n04505470 typewriter keyboard +n04507155 umbrella +n04509417 unicycle, monocycle +n04515003 upright, upright piano +n04517823 vacuum, vacuum cleaner +n04522168 vase +n04523525 vault +n04525038 velvet +n04525305 vending machine +n04532106 vestment +n04532670 viaduct +n04536866 violin, fiddle +n04540053 volleyball +n04542943 waffle iron +n04548280 wall clock +n04548362 wallet, billfold, notecase, pocketbook +n04550184 wardrobe, closet, press +n04552348 warplane, military plane +n04553703 washbasin, handbasin, washbowl, lavabo, wash-hand basin +n04554684 washer, automatic washer, washing machine +n04557648 water bottle +n04560804 water jug +n04562935 water tower +n04579145 whiskey jug +n04579432 whistle +n04584207 wig +n04589890 window screen +n04590129 window shade +n04591157 Windsor tie +n04591713 wine bottle +n04592741 wing +n04596742 wok +n04597913 wooden spoon +n04599235 wool, woolen, woollen +n04604644 worm fence, snake fence, snake-rail fence, Virginia fence +n04606251 wreck +n04612504 yawl +n04613696 yurt +n06359193 web site, website, internet site, site +n06596364 comic book +n06785654 crossword puzzle, crossword +n06794110 street sign +n06874185 traffic light, traffic signal, stoplight +n07248320 book jacket, dust cover, dust jacket, dust wrapper +n07565083 menu +n07579787 plate +n07583066 guacamole +n07584110 consomme +n07590611 hot pot, hotpot +n07613480 trifle +n07614500 ice cream, icecream +n07615774 ice lolly, lolly, lollipop, popsicle +n07684084 French loaf +n07693725 bagel, beigel +n07695742 pretzel +n07697313 cheeseburger +n07697537 hotdog, hot dog, red hot +n07711569 mashed potato +n07714571 head cabbage +n07714990 broccoli +n07715103 cauliflower +n07716358 zucchini, courgette +n07716906 spaghetti squash +n07717410 acorn squash +n07717556 butternut squash +n07718472 cucumber, cuke +n07718747 artichoke, globe artichoke +n07720875 bell pepper +n07730033 cardoon +n07734744 mushroom +n07742313 Granny Smith +n07745940 strawberry +n07747607 orange +n07749582 lemon +n07753113 fig +n07753275 pineapple, ananas +n07753592 banana +n07754684 jackfruit, jak, jack +n07760859 custard apple +n07768694 pomegranate +n07802026 hay +n07831146 carbonara +n07836838 chocolate sauce, chocolate syrup +n07860988 dough +n07871810 meat loaf, meatloaf +n07873807 pizza, pizza pie +n07875152 potpie +n07880968 burrito +n07892512 red wine +n07920052 espresso +n07930864 cup +n07932039 eggnog +n09193705 alp +n09229709 bubble +n09246464 cliff, drop, drop-off +n09256479 coral reef +n09288635 geyser +n09332890 lakeside, lakeshore +n09399592 promontory, headland, head, foreland +n09421951 sandbar, sand bar +n09428293 seashore, coast, seacoast, sea-coast +n09468604 valley, vale +n09472597 volcano +n09835506 ballplayer, baseball player +n10148035 groom, bridegroom +n10565667 scuba diver +n11879895 rapeseed +n11939491 daisy +n12057211 yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum +n12144580 corn +n12267677 acorn +n12620546 hip, rose hip, rosehip +n12768682 buckeye, horse chestnut, conker +n12985857 coral fungus +n12998815 agaric +n13037406 gyromitra +n13040303 stinkhorn, carrion fungus +n13044778 earthstar +n13052670 hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa +n13054560 bolete +n13133613 ear, spike, capitulum +n15075141 toilet tissue, toilet paper, bathroom tissue diff --git a/modules/dnn/samples/tf_inception.cpp b/modules/dnn/samples/tf_inception.cpp new file mode 100644 index 0000000000..44af4ce8ee --- /dev/null +++ b/modules/dnn/samples/tf_inception.cpp @@ -0,0 +1,173 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Sample of using OpenCV dnn module with Tensorflow Inception model. +*/ + +#include +#include +#include +using namespace cv; +using namespace cv::dnn; + +#include +#include +#include +using namespace std; + +const String keys = + "{help h || Sample app for loading Inception TensorFlow model. " + "The model and class names list can be downloaded here: " + "https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip }" + "{model m |tensorflow_inception_graph.pb| path to TensorFlow .pb model file }" + "{image i || path to image file }" + "{i_blob | input | input blob name) }" + "{o_blob | softmax2 | output blob name) }" + "{c_names c | imagenet_comp_graph_label_strings.txt | path to file with classnames for class id }" + "{result r || path to save output blob (optional, binary format, NCHW order) }" + ; + +void getMaxClass(const Mat &probBlob, int *classId, double *classProb); +std::vector readClassNames(const char *filename); + +int main(int argc, char **argv) +{ + cv::CommandLineParser parser(argc, argv, keys); + + if (parser.has("help")) + { + parser.printMessage(); + return 0; + } + + String modelFile = parser.get("model"); + String imageFile = parser.get("image"); + String inBlobName = parser.get("i_blob"); + String outBlobName = parser.get("o_blob"); + + if (!parser.check()) + { + parser.printErrors(); + return 0; + } + + String classNamesFile = parser.get("c_names"); + String resultFile = parser.get("result"); + + //! [Create the importer of TensorFlow model] + Ptr importer; + try //Try to import TensorFlow AlexNet model + { + importer = dnn::createTensorflowImporter(modelFile); + } + catch (const cv::Exception &err) //Importer can throw errors, we will catch them + { + std::cerr << err.msg << std::endl; + } + //! [Create the importer of Caffe model] + + if (!importer) + { + std::cerr << "Can't load network by using the mode file: " << std::endl; + std::cerr << modelFile << std::endl; + exit(-1); + } + + //! [Initialize network] + dnn::Net net; + importer->populateNet(net); + importer.release(); //We don't need importer anymore + //! [Initialize network] + + //! [Prepare blob] + Mat img = imread(imageFile); + if (img.empty()) + { + std::cerr << "Can't read image from the file: " << imageFile << std::endl; + exit(-1); + } + + cv::Size inputImgSize = cv::Size(224, 224); + + if (inputImgSize != img.size()) + resize(img, img, inputImgSize); //Resize image to input size + + Mat inputBlob = blobFromImage(img); //Convert Mat to image batch + //! [Prepare blob] + inputBlob -= 117.0; + //! [Set input blob] + net.setInput(inputBlob, inBlobName); //set the network input + //! [Set input blob] + + cv::TickMeter tm; + tm.start(); + + //! [Make forward pass] + Mat result = net.forward(outBlobName); //compute output + //! [Make forward pass] + + tm.stop(); + + if (!resultFile.empty()) { + CV_Assert(result.isContinuous()); + + ofstream fout(resultFile.c_str(), ios::out | ios::binary); + fout.write((char*)result.data, result.total() * sizeof(float)); + fout.close(); + } + + std::cout << "Output blob shape " << result.size[0] << " x " << result.size[1] << " x " << result.size[2] << " x " << result.size[3] << std::endl; + std::cout << "Inference time, ms: " << tm.getTimeMilli() << std::endl; + + if (!classNamesFile.empty()) { + std::vector classNames = readClassNames(classNamesFile.c_str()); + + int classId; + double classProb; + getMaxClass(result, &classId, &classProb);//find the best class + + //! [Print results] + std::cout << "Best class: #" << classId << " '" << classNames.at(classId) << "'" << std::endl; + std::cout << "Probability: " << classProb * 100 << "%" << std::endl; + } + return 0; +} //main + + +/* Find best class for the blob (i. e. class with maximal probability) */ +void getMaxClass(const Mat &probBlob, int *classId, double *classProb) +{ + Mat probMat = probBlob.reshape(1, 1); //reshape the blob to 1x1000 matrix + Point classNumber; + + minMaxLoc(probMat, NULL, classProb, NULL, &classNumber); + *classId = classNumber.x; +} + +std::vector readClassNames(const char *filename) +{ + std::vector classNames; + + std::ifstream fp(filename); + if (!fp.is_open()) + { + std::cerr << "File with classes labels not found: " << filename << std::endl; + exit(-1); + } + + std::string name; + while (!fp.eof()) + { + std::getline(fp, name); + if (name.length()) + classNames.push_back( name ); + } + + fp.close(); + return classNames; +} diff --git a/modules/dnn/samples/torch_enet.cpp b/modules/dnn/samples/torch_enet.cpp new file mode 100644 index 0000000000..1b46e5a058 --- /dev/null +++ b/modules/dnn/samples/torch_enet.cpp @@ -0,0 +1,207 @@ +/* +Sample of using OpenCV dnn module with Torch ENet model. +*/ + +#include +#include +#include +using namespace cv; +using namespace cv::dnn; + +#include +#include +#include +#include +using namespace std; + +const String keys = + "{help h || Sample app for loading ENet Torch model. " + "The model and class names list can be downloaded here: " + "https://www.dropbox.com/sh/dywzk3gyb12hpe5/AAD5YkUa8XgMpHs2gCRgmCVCa }" + "{model m || path to Torch .net model file (model_best.net) }" + "{image i || path to image file }" + "{c_names c || path to file with classnames for channels (optional, categories.txt) }" + "{result r || path to save output blob (optional, binary format, NCHW order) }" + "{show s || whether to show all output channels or not}" + "{o_blob || output blob's name. If empty, last blob's name in net is used}" + ; + +static void colorizeSegmentation(const Mat &score, Mat &segm, + Mat &legend, vector &classNames, vector &colors); +static vector readColors(const String &filename, vector& classNames); + +int main(int argc, char **argv) +{ + CommandLineParser parser(argc, argv, keys); + + if (parser.has("help")) + { + parser.printMessage(); + return 0; + } + + String modelFile = parser.get("model"); + String imageFile = parser.get("image"); + + if (!parser.check()) + { + parser.printErrors(); + return 0; + } + + String classNamesFile = parser.get("c_names"); + String resultFile = parser.get("result"); + + //! [Read model and initialize network] + dnn::Net net = dnn::readNetFromTorch(modelFile); + + //! [Prepare blob] + Mat img = imread(imageFile), input; + if (img.empty()) + { + std::cerr << "Can't read image from the file: " << imageFile << std::endl; + exit(-1); + } + + Size origSize = img.size(); + Size inputImgSize = cv::Size(1024, 512); + + if (inputImgSize != origSize) + resize(img, img, inputImgSize); //Resize image to input size + + Mat inputBlob = blobFromImage(img, 1./255); //Convert Mat to image batch + //! [Prepare blob] + + //! [Set input blob] + net.setInput(inputBlob, ""); //set the network input + //! [Set input blob] + + TickMeter tm; + + String oBlob = net.getLayerNames().back(); + if (!parser.get("o_blob").empty()) + { + oBlob = parser.get("o_blob"); + } + + //! [Make forward pass] + Mat result = net.forward(oBlob); + + if (!resultFile.empty()) { + CV_Assert(result.isContinuous()); + + ofstream fout(resultFile.c_str(), ios::out | ios::binary); + fout.write((char*)result.data, result.total() * sizeof(float)); + fout.close(); + } + + std::cout << "Output blob: " << result.size[0] << " x " << result.size[1] << " x " << result.size[2] << " x " << result.size[3] << "\n"; + std::cout << "Inference time, ms: " << tm.getTimeMilli() << std::endl; + + if (parser.has("show")) + { + std::vector classNames; + vector colors; + if(!classNamesFile.empty()) { + colors = readColors(classNamesFile, classNames); + } + Mat segm, legend; + colorizeSegmentation(result, segm, legend, classNames, colors); + + Mat show; + addWeighted(img, 0.1, segm, 0.9, 0.0, show); + + cv::resize(show, show, origSize, 0, 0, cv::INTER_NEAREST); + imshow("Result", show); + if(classNames.size()) + imshow("Legend", legend); + waitKey(); + } + + return 0; +} //main + +static void colorizeSegmentation(const Mat &score, Mat &segm, Mat &legend, vector &classNames, vector &colors) +{ + const int rows = score.size[2]; + const int cols = score.size[3]; + const int chns = score.size[1]; + + cv::Mat maxCl(rows, cols, CV_8UC1); + cv::Mat maxVal(rows, cols, CV_32FC1); + for (int ch = 0; ch < chns; ch++) + { + for (int row = 0; row < rows; row++) + { + const float *ptrScore = score.ptr(0, ch, row); + uchar *ptrMaxCl = maxCl.ptr(row); + float *ptrMaxVal = maxVal.ptr(row); + for (int col = 0; col < cols; col++) + { + if (ptrScore[col] > ptrMaxVal[col]) + { + ptrMaxVal[col] = ptrScore[col]; + ptrMaxCl[col] = ch; + } + } + } + } + + segm.create(rows, cols, CV_8UC3); + for (int row = 0; row < rows; row++) + { + const uchar *ptrMaxCl = maxCl.ptr(row); + cv::Vec3b *ptrSegm = segm.ptr(row); + for (int col = 0; col < cols; col++) + { + ptrSegm[col] = colors[ptrMaxCl[col]]; + } + } + + if (classNames.size() == colors.size()) + { + int blockHeight = 30; + legend.create(blockHeight*classNames.size(), 200, CV_8UC3); + for(int i = 0; i < classNames.size(); i++) + { + cv::Mat block = legend.rowRange(i*blockHeight, (i+1)*blockHeight); + block = colors[i]; + putText(block, classNames[i], Point(0, blockHeight/2), FONT_HERSHEY_SIMPLEX, 0.5, Scalar()); + } + } +} + +static vector readColors(const String &filename, vector& classNames) +{ + vector colors; + classNames.clear(); + + ifstream fp(filename.c_str()); + if (!fp.is_open()) + { + cerr << "File with colors not found: " << filename << endl; + exit(-1); + } + + string line; + while (!fp.eof()) + { + getline(fp, line); + if (line.length()) + { + stringstream ss(line); + + string name; ss >> name; + int temp; + cv::Vec3b color; + ss >> temp; color[0] = temp; + ss >> temp; color[1] = temp; + ss >> temp; color[2] = temp; + classNames.push_back(name); + colors.push_back(color); + } + } + + fp.close(); + return colors; +} diff --git a/modules/dnn/src/caffe/caffe.proto b/modules/dnn/src/caffe/caffe.proto new file mode 100644 index 0000000000..3d23fb48ea --- /dev/null +++ b/modules/dnn/src/caffe/caffe.proto @@ -0,0 +1,1581 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +//COPYRIGHT +// +//All contributions by the University of California: +//Copyright (c) 2014, The Regents of the University of California (Regents) +//All rights reserved. +// +//All other contributions: +//Copyright (c) 2014, the respective contributors +//All rights reserved. +// +//Caffe uses a shared copyright model: each contributor holds copyright over +//their contributions to Caffe. The project versioning records all such +//contribution and copyright details. If a contributor wants to further mark +//their specific copyright on a particular contribution, they should indicate +//their copyright solely in the commit message of the change when it is +//committed. +// +//LICENSE +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions are met: +// +//1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +//2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +//DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +//ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +//ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +//(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//CONTRIBUTION AGREEMENT +// +//By contributing to the BVLC/caffe repository through pull-request, comment, +//or otherwise, the contributor releases their content to the +//license and copyright terms herein. +// +//M*/ + +syntax = "proto2"; + +package caffe; + +// Specifies the shape (dimensions) of a Blob. +message BlobShape { + repeated int64 dim = 1 [packed = true]; +} + +message BlobProto { + optional BlobShape shape = 7; + repeated float data = 5 [packed = true]; + repeated float diff = 6 [packed = true]; + repeated double double_data = 8 [packed = true]; + repeated double double_diff = 9 [packed = true]; + + // 4D dimensions -- deprecated. Use "shape" instead. + optional int32 num = 1 [default = 0]; + optional int32 channels = 2 [default = 0]; + optional int32 height = 3 [default = 0]; + optional int32 width = 4 [default = 0]; +} + +// The BlobProtoVector is simply a way to pass multiple blobproto instances +// around. +message BlobProtoVector { + repeated BlobProto blobs = 1; +} + +message PermuteParameter { + // The new orders of the axes of data. Notice it should be with + // in the same range as the input data, and it starts from 0. + // Do not provide repeated order. + repeated uint32 order = 1; +} + +// Message that stores parameters used by NormalizeBBoxLayer +message NormalizeBBoxParameter { + optional bool across_spatial = 1 [default = true]; + // Initial value of scale. Default is 1.0 for all + optional FillerParameter scale_filler = 2; + // Whether or not scale parameters are shared across channels. + optional bool channel_shared = 3 [default = true]; + // Epsilon for not dividing by zero while normalizing variance + optional float eps = 4 [default = 1e-10]; +} + +// Message that store parameters used by PriorBoxLayer +message PriorBoxParameter { + // Encode/decode type. + enum CodeType { + CORNER = 1; + CENTER_SIZE = 2; + } + // Minimum box size (in pixels). Required! + optional float min_size = 1; + // Maximum box size (in pixels). Required! + optional float max_size = 2; + // Various of aspect ratios. Duplicate ratios will be ignored. + // If none is provided, we use default ratio 1. + repeated float aspect_ratio = 3; + // If true, will flip each aspect ratio. + // For example, if there is aspect ratio "r", + // we will generate aspect ratio "1.0/r" as well. + optional bool flip = 4 [default = true]; + // If true, will clip the prior so that it is within [0, 1] + optional bool clip = 5 [default = true]; + // Variance for adjusting the prior bboxes. + repeated float variance = 6; + // By default, we calculate img_height, img_width, step_x, step_y based on + // bottom[0] (feat) and bottom[1] (img). Unless these values are explicitely + // provided. + // Explicitly provide the img_size. + optional uint32 img_size = 7; + // Either img_size or img_h/img_w should be specified; not both. + optional uint32 img_h = 8; + optional uint32 img_w = 9; + // Explicitly provide the step size. + optional float step = 10; + // Either step or step_h/step_w should be specified; not both. + optional float step_h = 11; + optional float step_w = 12; + // Offset to the top left corner of each cell. + optional float offset = 13 [default = 0.5]; +} + +// Message that store parameters used by DetectionOutputLayer +message DetectionOutputParameter { + // Number of classes to be predicted. Required! + optional uint32 num_classes = 1; + // If true, bounding box are shared among different classes. + optional bool share_location = 2 [default = true]; + // Background label id. If there is no background class, + // set it as -1. + optional int32 background_label_id = 3 [default = 0]; + // Parameters used for non maximum suppression. + optional NonMaximumSuppressionParameter nms_param = 4; + // Parameters used for saving detection results. + optional SaveOutputParameter save_output_param = 5; + // Type of coding method for bbox. + optional PriorBoxParameter.CodeType code_type = 6 [default = CORNER]; + // If true, variance is encoded in target; otherwise we need to adjust the + // predicted offset accordingly. + optional bool variance_encoded_in_target = 8 [default = false]; + // Number of total bboxes to be kept per image after nms step. + // -1 means keeping all bboxes after nms step. + optional int32 keep_top_k = 7 [default = -1]; + // Only consider detections whose confidences are larger than a threshold. + // If not provided, consider all boxes. + optional float confidence_threshold = 9; +} + +message Datum { + optional int32 channels = 1; + optional int32 height = 2; + optional int32 width = 3; + // the actual image data, in bytes + optional bytes data = 4; + optional int32 label = 5; + // Optionally, the datum could also hold float data. + repeated float float_data = 6; + // If true data contains an encoded image that need to be decoded + optional bool encoded = 7 [default = false]; +} + +message FillerParameter { + // The filler type. + optional string type = 1 [default = 'constant']; + optional float value = 2 [default = 0]; // the value in constant filler + optional float min = 3 [default = 0]; // the min value in uniform filler + optional float max = 4 [default = 1]; // the max value in uniform filler + optional float mean = 5 [default = 0]; // the mean value in Gaussian filler + optional float std = 6 [default = 1]; // the std value in Gaussian filler + // The expected number of non-zero output weights for a given input in + // Gaussian filler -- the default -1 means don't perform sparsification. + optional int32 sparse = 7 [default = -1]; + // Normalize the filler variance by fan_in, fan_out, or their average. + // Applies to 'xavier' and 'msra' fillers. + enum VarianceNorm { + FAN_IN = 0; + FAN_OUT = 1; + AVERAGE = 2; + } + optional VarianceNorm variance_norm = 8 [default = FAN_IN]; +} + +message NetParameter { + optional string name = 1; // consider giving the network a name + // DEPRECATED. See InputParameter. The input blobs to the network. + repeated string input = 3; + // DEPRECATED. See InputParameter. The shape of the input blobs. + repeated BlobShape input_shape = 8; + + // 4D input dimensions -- deprecated. Use "input_shape" instead. + // If specified, for each input blob there should be four + // values specifying the num, channels, height and width of the input blob. + // Thus, there should be a total of (4 * #input) numbers. + repeated int32 input_dim = 4; + + // Whether the network will force every layer to carry out backward operation. + // If set False, then whether to carry out backward is determined + // automatically according to the net structure and learning rates. + optional bool force_backward = 5 [default = false]; + // The current "state" of the network, including the phase, level, and stage. + // Some layers may be included/excluded depending on this state and the states + // specified in the layers' include and exclude fields. + optional NetState state = 6; + + // Print debugging information about results while running Net::Forward, + // Net::Backward, and Net::Update. + optional bool debug_info = 7 [default = false]; + + // The layers that make up the net. Each of their configurations, including + // connectivity and behavior, is specified as a LayerParameter. + repeated LayerParameter layer = 100; // ID 100 so layers are printed last. + + // DEPRECATED: use 'layer' instead. + repeated V1LayerParameter layers = 2; +} + +// NOTE +// Update the next available ID when you add a new SolverParameter field. +// +// SolverParameter next available ID: 41 (last added: type) +message SolverParameter { + ////////////////////////////////////////////////////////////////////////////// + // Specifying the train and test networks + // + // Exactly one train net must be specified using one of the following fields: + // train_net_param, train_net, net_param, net + // One or more test nets may be specified using any of the following fields: + // test_net_param, test_net, net_param, net + // If more than one test net field is specified (e.g., both net and + // test_net are specified), they will be evaluated in the field order given + // above: (1) test_net_param, (2) test_net, (3) net_param/net. + // A test_iter must be specified for each test_net. + // A test_level and/or a test_stage may also be specified for each test_net. + ////////////////////////////////////////////////////////////////////////////// + + // Proto filename for the train net, possibly combined with one or more + // test nets. + optional string net = 24; + // Inline train net param, possibly combined with one or more test nets. + optional NetParameter net_param = 25; + + optional string train_net = 1; // Proto filename for the train net. + repeated string test_net = 2; // Proto filenames for the test nets. + optional NetParameter train_net_param = 21; // Inline train net params. + repeated NetParameter test_net_param = 22; // Inline test net params. + + // The states for the train/test nets. Must be unspecified or + // specified once per net. + // + // By default, all states will have solver = true; + // train_state will have phase = TRAIN, + // and all test_state's will have phase = TEST. + // Other defaults are set according to the NetState defaults. + optional NetState train_state = 26; + repeated NetState test_state = 27; + + // The number of iterations for each test net. + repeated int32 test_iter = 3; + + // The number of iterations between two testing phases. + optional int32 test_interval = 4 [default = 0]; + optional bool test_compute_loss = 19 [default = false]; + // If true, run an initial test pass before the first iteration, + // ensuring memory availability and printing the starting value of the loss. + optional bool test_initialization = 32 [default = true]; + optional float base_lr = 5; // The base learning rate + // the number of iterations between displaying info. If display = 0, no info + // will be displayed. + optional int32 display = 6; + // Display the loss averaged over the last average_loss iterations + optional int32 average_loss = 33 [default = 1]; + optional int32 max_iter = 7; // the maximum number of iterations + // accumulate gradients over `iter_size` x `batch_size` instances + optional int32 iter_size = 36 [default = 1]; + + // The learning rate decay policy. The currently implemented learning rate + // policies are as follows: + // - fixed: always return base_lr. + // - step: return base_lr * gamma ^ (floor(iter / step)) + // - exp: return base_lr * gamma ^ iter + // - inv: return base_lr * (1 + gamma * iter) ^ (- power) + // - multistep: similar to step but it allows non uniform steps defined by + // stepvalue + // - poly: the effective learning rate follows a polynomial decay, to be + // zero by the max_iter. return base_lr (1 - iter/max_iter) ^ (power) + // - sigmoid: the effective learning rate follows a sigmod decay + // return base_lr ( 1/(1 + exp(-gamma * (iter - stepsize)))) + // + // where base_lr, max_iter, gamma, step, stepvalue and power are defined + // in the solver parameter protocol buffer, and iter is the current iteration. + optional string lr_policy = 8; + optional float gamma = 9; // The parameter to compute the learning rate. + optional float power = 10; // The parameter to compute the learning rate. + optional float momentum = 11; // The momentum value. + optional float weight_decay = 12; // The weight decay. + // regularization types supported: L1 and L2 + // controlled by weight_decay + optional string regularization_type = 29 [default = "L2"]; + // the stepsize for learning rate policy "step" + optional int32 stepsize = 13; + // the stepsize for learning rate policy "multistep" + repeated int32 stepvalue = 34; + + // Set clip_gradients to >= 0 to clip parameter gradients to that L2 norm, + // whenever their actual L2 norm is larger. + optional float clip_gradients = 35 [default = -1]; + + optional int32 snapshot = 14 [default = 0]; // The snapshot interval + optional string snapshot_prefix = 15; // The prefix for the snapshot. + // whether to snapshot diff in the results or not. Snapshotting diff will help + // debugging but the final protocol buffer size will be much larger. + optional bool snapshot_diff = 16 [default = false]; + enum SnapshotFormat { + HDF5 = 0; + BINARYPROTO = 1; + } + optional SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + // the mode solver will use: 0 for CPU and 1 for GPU. Use GPU in default. + enum SolverMode { + CPU = 0; + GPU = 1; + } + optional SolverMode solver_mode = 17 [default = GPU]; + // the device_id will that be used in GPU mode. Use device_id = 0 in default. + optional int32 device_id = 18 [default = 0]; + // If non-negative, the seed with which the Solver will initialize the Caffe + // random number generator -- useful for reproducible results. Otherwise, + // (and by default) initialize using a seed derived from the system clock. + optional int64 random_seed = 20 [default = -1]; + + // type of the solver + optional string type = 40 [default = "SGD"]; + + // numerical stability for RMSProp, AdaGrad and AdaDelta and Adam + optional float delta = 31 [default = 1e-8]; + // parameters for the Adam solver + optional float momentum2 = 39 [default = 0.999]; + + // RMSProp decay value + // MeanSquare(t) = rms_decay*MeanSquare(t-1) + (1-rms_decay)*SquareGradient(t) + optional float rms_decay = 38 [default = 0.99]; + + // If true, print information about the state of the net that may help with + // debugging learning problems. + optional bool debug_info = 23 [default = false]; + + // If false, don't save a snapshot after training finishes. + optional bool snapshot_after_train = 28 [default = true]; + + // DEPRECATED: old solver enum types, use string instead + enum SolverType { + SGD = 0; + NESTEROV = 1; + ADAGRAD = 2; + RMSPROP = 3; + ADADELTA = 4; + ADAM = 5; + } + // DEPRECATED: use type instead of solver_type + optional SolverType solver_type = 30 [default = SGD]; +} + +// A message that stores the solver snapshots +message SolverState { + optional int32 iter = 1; // The current iteration + optional string learned_net = 2; // The file that stores the learned net. + repeated BlobProto history = 3; // The history for sgd solvers + optional int32 current_step = 4 [default = 0]; // The current step for learning rate +} + +enum Phase { + TRAIN = 0; + TEST = 1; +} + +message NetState { + optional Phase phase = 1 [default = TEST]; + optional int32 level = 2 [default = 0]; + repeated string stage = 3; +} + +message NetStateRule { + // Set phase to require the NetState have a particular phase (TRAIN or TEST) + // to meet this rule. + optional Phase phase = 1; + + // Set the minimum and/or maximum levels in which the layer should be used. + // Leave undefined to meet the rule regardless of level. + optional int32 min_level = 2; + optional int32 max_level = 3; + + // Customizable sets of stages to include or exclude. + // The net must have ALL of the specified stages and NONE of the specified + // "not_stage"s to meet the rule. + // (Use multiple NetStateRules to specify conjunctions of stages.) + repeated string stage = 4; + repeated string not_stage = 5; +} + +// Specifies training parameters (multipliers on global learning constants, +// and the name and other settings used for weight sharing). +message ParamSpec { + // The names of the parameter blobs -- useful for sharing parameters among + // layers, but never required otherwise. To share a parameter between two + // layers, give it a (non-empty) name. + optional string name = 1; + + // Whether to require shared weights to have the same shape, or just the same + // count -- defaults to STRICT if unspecified. + optional DimCheckMode share_mode = 2; + enum DimCheckMode { + // STRICT (default) requires that num, channels, height, width each match. + STRICT = 0; + // PERMISSIVE requires only the count (num*channels*height*width) to match. + PERMISSIVE = 1; + } + + // The multiplier on the global learning rate for this parameter. + optional float lr_mult = 3 [default = 1.0]; + + // The multiplier on the global weight decay for this parameter. + optional float decay_mult = 4 [default = 1.0]; +} + +// NOTE +// Update the next available ID when you add a new LayerParameter field. +// +// LayerParameter next available layer-specific ID: 147 (last added: recurrent_param) +message LayerParameter { + optional string name = 1; // the layer name + optional string type = 2; // the layer type + repeated string bottom = 3; // the name of each bottom blob + repeated string top = 4; // the name of each top blob + + // The train / test phase for computation. + optional Phase phase = 10; + + // The amount of weight to assign each top blob in the objective. + // Each layer assigns a default value, usually of either 0 or 1, + // to each top blob. + repeated float loss_weight = 5; + + // Specifies training parameters (multipliers on global learning constants, + // and the name and other settings used for weight sharing). + repeated ParamSpec param = 6; + + // The blobs containing the numeric parameters of the layer. + repeated BlobProto blobs = 7; + + // Specifies whether to backpropagate to each bottom. If unspecified, + // Caffe will automatically infer whether each input needs backpropagation + // to compute parameter gradients. If set to true for some inputs, + // backpropagation to those inputs is forced; if set false for some inputs, + // backpropagation to those inputs is skipped. + // + // The size must be either 0 or equal to the number of bottoms. + repeated bool propagate_down = 11; + + // Rules controlling whether and when a layer is included in the network, + // based on the current NetState. You may specify a non-zero number of rules + // to include OR exclude, but not both. If no include or exclude rules are + // specified, the layer is always included. If the current NetState meets + // ANY (i.e., one or more) of the specified rules, the layer is + // included/excluded. + repeated NetStateRule include = 8; + repeated NetStateRule exclude = 9; + + // Parameters for data pre-processing. + optional TransformationParameter transform_param = 100; + + // Parameters shared by loss layers. + optional LossParameter loss_param = 101; + + // Layer type-specific parameters. + // + // Note: certain layers may have more than one computational engine + // for their implementation. These layers include an Engine type and + // engine parameter for selecting the implementation. + // The default for the engine is set by the ENGINE switch at compile-time. + optional AccuracyParameter accuracy_param = 102; + optional ArgMaxParameter argmax_param = 103; + optional BatchNormParameter batch_norm_param = 139; + optional BiasParameter bias_param = 141; + optional ConcatParameter concat_param = 104; + optional ContrastiveLossParameter contrastive_loss_param = 105; + optional ConvolutionParameter convolution_param = 106; + optional CropParameter crop_param = 144; + optional DataParameter data_param = 107; + optional DetectionOutputParameter detection_output_param = 147; + optional DropoutParameter dropout_param = 108; + optional DummyDataParameter dummy_data_param = 109; + optional EltwiseParameter eltwise_param = 110; + optional ELUParameter elu_param = 140; + optional EmbedParameter embed_param = 137; + optional ExpParameter exp_param = 111; + optional FlattenParameter flatten_param = 135; + optional HDF5DataParameter hdf5_data_param = 112; + optional HDF5OutputParameter hdf5_output_param = 113; + optional HingeLossParameter hinge_loss_param = 114; + optional ImageDataParameter image_data_param = 115; + optional InfogainLossParameter infogain_loss_param = 116; + optional InnerProductParameter inner_product_param = 117; + optional InputParameter input_param = 143; + optional LogParameter log_param = 134; + optional LRNParameter lrn_param = 118; + optional MemoryDataParameter memory_data_param = 119; + optional MVNParameter mvn_param = 120; + optional NormalizeBBoxParameter norm_param = 149; + optional PermuteParameter permute_param = 148; + optional ParameterParameter parameter_param = 145; + optional PoolingParameter pooling_param = 121; + optional PowerParameter power_param = 122; + optional PReLUParameter prelu_param = 131; + optional PriorBoxParameter prior_box_param = 150; + optional PythonParameter python_param = 130; + optional RecurrentParameter recurrent_param = 146; + optional ReductionParameter reduction_param = 136; + optional ReLUParameter relu_param = 123; + optional ReshapeParameter reshape_param = 133; + optional ScaleParameter scale_param = 142; + optional SigmoidParameter sigmoid_param = 124; + optional SoftmaxParameter softmax_param = 125; + optional SPPParameter spp_param = 132; + optional SliceParameter slice_param = 126; + optional TanHParameter tanh_param = 127; + optional ThresholdParameter threshold_param = 128; + optional TileParameter tile_param = 138; + optional WindowDataParameter window_data_param = 129; +} + +// Message that stores parameters used to apply transformation +// to the data layer's data +message TransformationParameter { + // For data pre-processing, we can do simple scaling and subtracting the + // data mean, if provided. Note that the mean subtraction is always carried + // out before scaling. + optional float scale = 1 [default = 1]; + // Specify if we want to randomly mirror data. + optional bool mirror = 2 [default = false]; + // Specify if we would like to randomly crop an image. + optional uint32 crop_size = 3 [default = 0]; + // mean_file and mean_value cannot be specified at the same time + optional string mean_file = 4; + // if specified can be repeated once (would subtract it from all the channels) + // or can be repeated the same number of times as channels + // (would subtract them from the corresponding channel) + repeated float mean_value = 5; + // Force the decoded image to have 3 color channels. + optional bool force_color = 6 [default = false]; + // Force the decoded image to have 1 color channels. + optional bool force_gray = 7 [default = false]; +} + +// Message that stores parameters shared by loss layers +message LossParameter { + // If specified, ignore instances with the given label. + optional int32 ignore_label = 1; + // How to normalize the loss for loss layers that aggregate across batches, + // spatial dimensions, or other dimensions. Currently only implemented in + // SoftmaxWithLoss and SigmoidCrossEntropyLoss layers. + enum NormalizationMode { + // Divide by the number of examples in the batch times spatial dimensions. + // Outputs that receive the ignore label will NOT be ignored in computing + // the normalization factor. + FULL = 0; + // Divide by the total number of output locations that do not take the + // ignore_label. If ignore_label is not set, this behaves like FULL. + VALID = 1; + // Divide by the batch size. + BATCH_SIZE = 2; + // Do not normalize the loss. + NONE = 3; + } + // For historical reasons, the default normalization for + // SigmoidCrossEntropyLoss is BATCH_SIZE and *not* VALID. + optional NormalizationMode normalization = 3 [default = VALID]; + // Deprecated. Ignored if normalization is specified. If normalization + // is not specified, then setting this to false will be equivalent to + // normalization = BATCH_SIZE to be consistent with previous behavior. + optional bool normalize = 2; +} + +// Messages that store parameters used by individual layer types follow, in +// alphabetical order. + +message AccuracyParameter { + // When computing accuracy, count as correct by comparing the true label to + // the top k scoring classes. By default, only compare to the top scoring + // class (i.e. argmax). + optional uint32 top_k = 1 [default = 1]; + + // The "label" axis of the prediction blob, whose argmax corresponds to the + // predicted label -- may be negative to index from the end (e.g., -1 for the + // last axis). For example, if axis == 1 and the predictions are + // (N x C x H x W), the label blob is expected to contain N*H*W ground truth + // labels with integer values in {0, 1, ..., C-1}. + optional int32 axis = 2 [default = 1]; + + // If specified, ignore instances with the given label. + optional int32 ignore_label = 3; +} + +message ArgMaxParameter { + // If true produce pairs (argmax, maxval) + optional bool out_max_val = 1 [default = false]; + optional uint32 top_k = 2 [default = 1]; + // The axis along which to maximise -- may be negative to index from the + // end (e.g., -1 for the last axis). + // By default ArgMaxLayer maximizes over the flattened trailing dimensions + // for each index of the first / num dimension. + optional int32 axis = 3; +} + +message ConcatParameter { + // The axis along which to concatenate -- may be negative to index from the + // end (e.g., -1 for the last axis). Other axes must have the + // same dimension for all the bottom blobs. + // By default, ConcatLayer concatenates blobs along the "channels" axis (1). + optional int32 axis = 2 [default = 1]; + + // DEPRECATED: alias for "axis" -- does not support negative indexing. + optional uint32 concat_dim = 1 [default = 1]; +} + +message BatchNormParameter { + // If false, accumulate global mean/variance values via a moving average. If + // true, use those accumulated values instead of computing mean/variance + // across the batch. + optional bool use_global_stats = 1; + // How much does the moving average decay each iteration? + optional float moving_average_fraction = 2 [default = .999]; + // Small value to add to the variance estimate so that we don't divide by + // zero. + optional float eps = 3 [default = 1e-5]; +} + +message BiasParameter { + // The first axis of bottom[0] (the first input Blob) along which to apply + // bottom[1] (the second input Blob). May be negative to index from the end + // (e.g., -1 for the last axis). + // + // For example, if bottom[0] is 4D with shape 100x3x40x60, the output + // top[0] will have the same shape, and bottom[1] may have any of the + // following shapes (for the given value of axis): + // (axis == 0 == -4) 100; 100x3; 100x3x40; 100x3x40x60 + // (axis == 1 == -3) 3; 3x40; 3x40x60 + // (axis == 2 == -2) 40; 40x60 + // (axis == 3 == -1) 60 + // Furthermore, bottom[1] may have the empty shape (regardless of the value of + // "axis") -- a scalar bias. + optional int32 axis = 1 [default = 1]; + + // (num_axes is ignored unless just one bottom is given and the bias is + // a learned parameter of the layer. Otherwise, num_axes is determined by the + // number of axes by the second bottom.) + // The number of axes of the input (bottom[0]) covered by the bias + // parameter, or -1 to cover all axes of bottom[0] starting from `axis`. + // Set num_axes := 0, to add a zero-axis Blob: a scalar. + optional int32 num_axes = 2 [default = 1]; + + // (filler is ignored unless just one bottom is given and the bias is + // a learned parameter of the layer.) + // The initialization for the learned bias parameter. + // Default is the zero (0) initialization, resulting in the BiasLayer + // initially performing the identity operation. + optional FillerParameter filler = 3; +} + +message ContrastiveLossParameter { + // margin for dissimilar pair + optional float margin = 1 [default = 1.0]; + // The first implementation of this cost did not exactly match the cost of + // Hadsell et al 2006 -- using (margin - d^2) instead of (margin - d)^2. + // legacy_version = false (the default) uses (margin - d)^2 as proposed in the + // Hadsell paper. New models should probably use this version. + // legacy_version = true uses (margin - d^2). This is kept to support / + // reproduce existing models and results + optional bool legacy_version = 2 [default = false]; +} + +message ConvolutionParameter { + optional uint32 num_output = 1; // The number of outputs for the layer + optional bool bias_term = 2 [default = true]; // whether to have bias terms + + // Pad, kernel size, and stride are all given as a single value for equal + // dimensions in all spatial dimensions, or once per spatial dimension. + repeated uint32 pad = 3; // The padding size; defaults to 0 + repeated uint32 kernel_size = 4; // The kernel size + repeated uint32 stride = 6; // The stride; defaults to 1 + // Factor used to dilate the kernel, (implicitly) zero-filling the resulting + // holes. (Kernel dilation is sometimes referred to by its use in the + // algorithme à trous from Holschneider et al. 1987.) + repeated uint32 dilation = 18; // The dilation; defaults to 1 + + // For 2D convolution only, the *_h and *_w versions may also be used to + // specify both spatial dimensions. + optional uint32 pad_h = 9 [default = 0]; // The padding height (2D only) + optional uint32 pad_w = 10 [default = 0]; // The padding width (2D only) + optional uint32 kernel_h = 11; // The kernel height (2D only) + optional uint32 kernel_w = 12; // The kernel width (2D only) + optional uint32 stride_h = 13; // The stride height (2D only) + optional uint32 stride_w = 14; // The stride width (2D only) + + optional uint32 group = 5 [default = 1]; // The group size for group conv + + optional FillerParameter weight_filler = 7; // The filler for the weight + optional FillerParameter bias_filler = 8; // The filler for the bias + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 15 [default = DEFAULT]; + + // The axis to interpret as "channels" when performing convolution. + // Preceding dimensions are treated as independent inputs; + // succeeding dimensions are treated as "spatial". + // With (N, C, H, W) inputs, and axis == 1 (the default), we perform + // N independent 2D convolutions, sliding C-channel (or (C/g)-channels, for + // groups g>1) filters across the spatial axes (H, W) of the input. + // With (N, C, D, H, W) inputs, and axis == 1, we perform + // N independent 3D convolutions, sliding (C/g)-channels + // filters across the spatial axes (D, H, W) of the input. + optional int32 axis = 16 [default = 1]; + + // Whether to force use of the general ND convolution, even if a specific + // implementation for blobs of the appropriate number of spatial dimensions + // is available. (Currently, there is only a 2D-specific convolution + // implementation; for input blobs with num_axes != 2, this option is + // ignored and the ND implementation will be used.) + optional bool force_nd_im2col = 17 [default = false]; +} + +message CropParameter { + // To crop, elements of the first bottom are selected to fit the dimensions + // of the second, reference bottom. The crop is configured by + // - the crop `axis` to pick the dimensions for cropping + // - the crop `offset` to set the shift for all/each dimension + // to align the cropped bottom with the reference bottom. + // All dimensions up to but excluding `axis` are preserved, while + // the dimensions including and trailing `axis` are cropped. + // If only one `offset` is set, then all dimensions are offset by this amount. + // Otherwise, the number of offsets must equal the number of cropped axes to + // shift the crop in each dimension accordingly. + // Note: standard dimensions are N,C,H,W so the default is a spatial crop, + // and `axis` may be negative to index from the end (e.g., -1 for the last + // axis). + optional int32 axis = 1 [default = 2]; + repeated uint32 offset = 2; +} + +message DataParameter { + enum DB { + LEVELDB = 0; + LMDB = 1; + } + // Specify the data source. + optional string source = 1; + // Specify the batch size. + optional uint32 batch_size = 4; + // The rand_skip variable is for the data layer to skip a few data points + // to avoid all asynchronous sgd clients to start at the same point. The skip + // point would be set as rand_skip * rand(0,1). Note that rand_skip should not + // be larger than the number of keys in the database. + // DEPRECATED. Each solver accesses a different subset of the database. + optional uint32 rand_skip = 7 [default = 0]; + optional DB backend = 8 [default = LEVELDB]; + // DEPRECATED. See TransformationParameter. For data pre-processing, we can do + // simple scaling and subtracting the data mean, if provided. Note that the + // mean subtraction is always carried out before scaling. + optional float scale = 2 [default = 1]; + optional string mean_file = 3; + // DEPRECATED. See TransformationParameter. Specify if we would like to randomly + // crop an image. + optional uint32 crop_size = 5 [default = 0]; + // DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror + // data. + optional bool mirror = 6 [default = false]; + // Force the encoded image to have 3 color channels + optional bool force_encoded_color = 9 [default = false]; + // Prefetch queue (Number of batches to prefetch to host memory, increase if + // data access bandwidth varies). + optional uint32 prefetch = 10 [default = 4]; +} + +message NonMaximumSuppressionParameter { + // Threshold to be used in nms. + optional float nms_threshold = 1 [default = 0.3]; + // Maximum number of results to be kept. + optional int32 top_k = 2; + // Parameter for adaptive nms. + optional float eta = 3 [default = 1.0]; +} + +message SaveOutputParameter { + // Output directory. If not empty, we will save the results. + optional string output_directory = 1; + // Output name prefix. + optional string output_name_prefix = 2; + // Output format. + // VOC - PASCAL VOC output format. + // COCO - MS COCO output format. + optional string output_format = 3; + // If you want to output results, must also provide the following two files. + // Otherwise, we will ignore saving results. + // label map file. + optional string label_map_file = 4; + // A file which contains a list of names and sizes with same order + // of the input DB. The file is in the following format: + // name height width + // ... + optional string name_size_file = 5; + // Number of test images. It can be less than the lines specified in + // name_size_file. For example, when we only want to evaluate on part + // of the test images. + optional uint32 num_test_image = 6; +} + +message DropoutParameter { + optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio +} + +// DummyDataLayer fills any number of arbitrarily shaped blobs with random +// (or constant) data generated by "Fillers" (see "message FillerParameter"). +message DummyDataParameter { + // This layer produces N >= 1 top blobs. DummyDataParameter must specify 1 or N + // shape fields, and 0, 1 or N data_fillers. + // + // If 0 data_fillers are specified, ConstantFiller with a value of 0 is used. + // If 1 data_filler is specified, it is applied to all top blobs. If N are + // specified, the ith is applied to the ith top blob. + repeated FillerParameter data_filler = 1; + repeated BlobShape shape = 6; + + // 4D dimensions -- deprecated. Use "shape" instead. + repeated uint32 num = 2; + repeated uint32 channels = 3; + repeated uint32 height = 4; + repeated uint32 width = 5; +} + +message EltwiseParameter { + enum EltwiseOp { + PROD = 0; + SUM = 1; + MAX = 2; + } + optional EltwiseOp operation = 1 [default = SUM]; // element-wise operation + repeated float coeff = 2; // blob-wise coefficient for SUM operation + + // Whether to use an asymptotically slower (for >2 inputs) but stabler method + // of computing the gradient for the PROD operation. (No effect for SUM op.) + optional bool stable_prod_grad = 3 [default = true]; +} + +// Message that stores parameters used by ELULayer +message ELUParameter { + // Described in: + // Clevert, D.-A., Unterthiner, T., & Hochreiter, S. (2015). Fast and Accurate + // Deep Network Learning by Exponential Linear Units (ELUs). arXiv + optional float alpha = 1 [default = 1]; +} + +// Message that stores parameters used by EmbedLayer +message EmbedParameter { + optional uint32 num_output = 1; // The number of outputs for the layer + // The input is given as integers to be interpreted as one-hot + // vector indices with dimension num_input. Hence num_input should be + // 1 greater than the maximum possible input value. + optional uint32 input_dim = 2; + + optional bool bias_term = 3 [default = true]; // Whether to use a bias term + optional FillerParameter weight_filler = 4; // The filler for the weight + optional FillerParameter bias_filler = 5; // The filler for the bias + +} + +// Message that stores parameters used by ExpLayer +message ExpParameter { + // ExpLayer computes outputs y = base ^ (shift + scale * x), for base > 0. + // Or if base is set to the default (-1), base is set to e, + // so y = exp(shift + scale * x). + optional float base = 1 [default = -1.0]; + optional float scale = 2 [default = 1.0]; + optional float shift = 3 [default = 0.0]; +} + +/// Message that stores parameters used by FlattenLayer +message FlattenParameter { + // The first axis to flatten: all preceding axes are retained in the output. + // May be negative to index from the end (e.g., -1 for the last axis). + optional int32 axis = 1 [default = 1]; + + // The last axis to flatten: all following axes are retained in the output. + // May be negative to index from the end (e.g., the default -1 for the last + // axis). + optional int32 end_axis = 2 [default = -1]; +} + +// Message that stores parameters used by HDF5DataLayer +message HDF5DataParameter { + // Specify the data source. + optional string source = 1; + // Specify the batch size. + optional uint32 batch_size = 2; + + // Specify whether to shuffle the data. + // If shuffle == true, the ordering of the HDF5 files is shuffled, + // and the ordering of data within any given HDF5 file is shuffled, + // but data between different files are not interleaved; all of a file's + // data are output (in a random order) before moving onto another file. + optional bool shuffle = 3 [default = false]; +} + +message HDF5OutputParameter { + optional string file_name = 1; +} + +message HingeLossParameter { + enum Norm { + L1 = 1; + L2 = 2; + } + // Specify the Norm to use L1 or L2 + optional Norm norm = 1 [default = L1]; +} + +message ImageDataParameter { + // Specify the data source. + optional string source = 1; + // Specify the batch size. + optional uint32 batch_size = 4 [default = 1]; + // The rand_skip variable is for the data layer to skip a few data points + // to avoid all asynchronous sgd clients to start at the same point. The skip + // point would be set as rand_skip * rand(0,1). Note that rand_skip should not + // be larger than the number of keys in the database. + optional uint32 rand_skip = 7 [default = 0]; + // Whether or not ImageLayer should shuffle the list of files at every epoch. + optional bool shuffle = 8 [default = false]; + // It will also resize images if new_height or new_width are not zero. + optional uint32 new_height = 9 [default = 0]; + optional uint32 new_width = 10 [default = 0]; + // Specify if the images are color or gray + optional bool is_color = 11 [default = true]; + // DEPRECATED. See TransformationParameter. For data pre-processing, we can do + // simple scaling and subtracting the data mean, if provided. Note that the + // mean subtraction is always carried out before scaling. + optional float scale = 2 [default = 1]; + optional string mean_file = 3; + // DEPRECATED. See TransformationParameter. Specify if we would like to randomly + // crop an image. + optional uint32 crop_size = 5 [default = 0]; + // DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror + // data. + optional bool mirror = 6 [default = false]; + optional string root_folder = 12 [default = ""]; +} + +message InfogainLossParameter { + // Specify the infogain matrix source. + optional string source = 1; +} + +message InnerProductParameter { + optional uint32 num_output = 1; // The number of outputs for the layer + optional bool bias_term = 2 [default = true]; // whether to have bias terms + optional FillerParameter weight_filler = 3; // The filler for the weight + optional FillerParameter bias_filler = 4; // The filler for the bias + + // The first axis to be lumped into a single inner product computation; + // all preceding axes are retained in the output. + // May be negative to index from the end (e.g., -1 for the last axis). + optional int32 axis = 5 [default = 1]; + // Specify whether to transpose the weight matrix or not. + // If transpose == true, any operations will be performed on the transpose + // of the weight matrix. The weight matrix itself is not going to be transposed + // but rather the transfer flag of operations will be toggled accordingly. + optional bool transpose = 6 [default = false]; +} + +message InputParameter { + // This layer produces N >= 1 top blob(s) to be assigned manually. + // Define N shapes to set a shape for each top. + // Define 1 shape to set the same shape for every top. + // Define no shape to defer to reshaping manually. + repeated BlobShape shape = 1; +} + +// Message that stores parameters used by LogLayer +message LogParameter { + // LogLayer computes outputs y = log_base(shift + scale * x), for base > 0. + // Or if base is set to the default (-1), base is set to e, + // so y = ln(shift + scale * x) = log_e(shift + scale * x) + optional float base = 1 [default = -1.0]; + optional float scale = 2 [default = 1.0]; + optional float shift = 3 [default = 0.0]; +} + +// Message that stores parameters used by LRNLayer +message LRNParameter { + optional uint32 local_size = 1 [default = 5]; + optional float alpha = 2 [default = 1.]; + optional float beta = 3 [default = 0.75]; + enum NormRegion { + ACROSS_CHANNELS = 0; + WITHIN_CHANNEL = 1; + } + optional NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + optional float k = 5 [default = 1.]; + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 6 [default = DEFAULT]; +} + +message MemoryDataParameter { + optional uint32 batch_size = 1; + optional uint32 channels = 2; + optional uint32 height = 3; + optional uint32 width = 4; +} + +message MVNParameter { + // This parameter can be set to false to normalize mean only + optional bool normalize_variance = 1 [default = true]; + + // This parameter can be set to true to perform DNN-like MVN + optional bool across_channels = 2 [default = false]; + + // Epsilon for not dividing by zero while normalizing variance + optional float eps = 3 [default = 1e-9]; +} + +message ParameterParameter { + optional BlobShape shape = 1; +} + +message PoolingParameter { + enum PoolMethod { + MAX = 0; + AVE = 1; + STOCHASTIC = 2; + } + optional PoolMethod pool = 1 [default = MAX]; // The pooling method + // Pad, kernel size, and stride are all given as a single value for equal + // dimensions in height and width or as Y, X pairs. + optional uint32 pad = 4 [default = 0]; // The padding size (equal in Y, X) + optional uint32 pad_h = 9 [default = 0]; // The padding height + optional uint32 pad_w = 10 [default = 0]; // The padding width + optional uint32 kernel_size = 2; // The kernel size (square) + optional uint32 kernel_h = 5; // The kernel height + optional uint32 kernel_w = 6; // The kernel width + optional uint32 stride = 3 [default = 1]; // The stride (equal in Y, X) + optional uint32 stride_h = 7; // The stride height + optional uint32 stride_w = 8; // The stride width + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 11 [default = DEFAULT]; + // If global_pooling then it will pool over the size of the bottom by doing + // kernel_h = bottom->height and kernel_w = bottom->width + optional bool global_pooling = 12 [default = false]; +} + +message PowerParameter { + // PowerLayer computes outputs y = (shift + scale * x) ^ power. + optional float power = 1 [default = 1.0]; + optional float scale = 2 [default = 1.0]; + optional float shift = 3 [default = 0.0]; +} + +message PythonParameter { + optional string module = 1; + optional string layer = 2; + // This value is set to the attribute `param_str` of the `PythonLayer` object + // in Python before calling the `setup()` method. This could be a number, + // string, dictionary in Python dict format, JSON, etc. You may parse this + // string in `setup` method and use it in `forward` and `backward`. + optional string param_str = 3 [default = '']; + // Whether this PythonLayer is shared among worker solvers during data parallelism. + // If true, each worker solver sequentially run forward from this layer. + // This value should be set true if you are using it as a data layer. + optional bool share_in_parallel = 4 [default = false]; +} + +// Message that stores parameters used by RecurrentLayer +message RecurrentParameter { + // The dimension of the output (and usually hidden state) representation -- + // must be explicitly set to non-zero. + optional uint32 num_output = 1 [default = 0]; + + optional FillerParameter weight_filler = 2; // The filler for the weight + optional FillerParameter bias_filler = 3; // The filler for the bias + + // Whether to enable displaying debug_info in the unrolled recurrent net. + optional bool debug_info = 4 [default = false]; + + // Whether to add as additional inputs (bottoms) the initial hidden state + // blobs, and add as additional outputs (tops) the final timestep hidden state + // blobs. The number of additional bottom/top blobs required depends on the + // recurrent architecture -- e.g., 1 for RNNs, 2 for LSTMs. + optional bool expose_hidden = 5 [default = false]; +} + +// Message that stores parameters used by ReductionLayer +message ReductionParameter { + enum ReductionOp { + SUM = 1; + ASUM = 2; + SUMSQ = 3; + MEAN = 4; + } + + optional ReductionOp operation = 1 [default = SUM]; // reduction operation + + // The first axis to reduce to a scalar -- may be negative to index from the + // end (e.g., -1 for the last axis). + // (Currently, only reduction along ALL "tail" axes is supported; reduction + // of axis M through N, where N < num_axes - 1, is unsupported.) + // Suppose we have an n-axis bottom Blob with shape: + // (d0, d1, d2, ..., d(m-1), dm, d(m+1), ..., d(n-1)). + // If axis == m, the output Blob will have shape + // (d0, d1, d2, ..., d(m-1)), + // and the ReductionOp operation is performed (d0 * d1 * d2 * ... * d(m-1)) + // times, each including (dm * d(m+1) * ... * d(n-1)) individual data. + // If axis == 0 (the default), the output Blob always has the empty shape + // (count 1), performing reduction across the entire input -- + // often useful for creating new loss functions. + optional int32 axis = 2 [default = 0]; + + optional float coeff = 3 [default = 1.0]; // coefficient for output +} + +// Message that stores parameters used by ReLULayer +message ReLUParameter { + // Allow non-zero slope for negative inputs to speed up optimization + // Described in: + // Maas, A. L., Hannun, A. Y., & Ng, A. Y. (2013). Rectifier nonlinearities + // improve neural network acoustic models. In ICML Workshop on Deep Learning + // for Audio, Speech, and Language Processing. + optional float negative_slope = 1 [default = 0]; + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 2 [default = DEFAULT]; +} + +message ReshapeParameter { + // Specify the output dimensions. If some of the dimensions are set to 0, + // the corresponding dimension from the bottom layer is used (unchanged). + // Exactly one dimension may be set to -1, in which case its value is + // inferred from the count of the bottom blob and the remaining dimensions. + // For example, suppose we want to reshape a 2D blob "input" with shape 2 x 8: + // + // layer { + // type: "Reshape" bottom: "input" top: "output" + // reshape_param { ... } + // } + // + // If "input" is 2D with shape 2 x 8, then the following reshape_param + // specifications are all equivalent, producing a 3D blob "output" with shape + // 2 x 2 x 4: + // + // reshape_param { shape { dim: 2 dim: 2 dim: 4 } } + // reshape_param { shape { dim: 0 dim: 2 dim: 4 } } + // reshape_param { shape { dim: 0 dim: 2 dim: -1 } } + // reshape_param { shape { dim: 0 dim:-1 dim: 4 } } + // + optional BlobShape shape = 1; + + // axis and num_axes control the portion of the bottom blob's shape that are + // replaced by (included in) the reshape. By default (axis == 0 and + // num_axes == -1), the entire bottom blob shape is included in the reshape, + // and hence the shape field must specify the entire output shape. + // + // axis may be non-zero to retain some portion of the beginning of the input + // shape (and may be negative to index from the end; e.g., -1 to begin the + // reshape after the last axis, including nothing in the reshape, + // -2 to include only the last axis, etc.). + // + // For example, suppose "input" is a 2D blob with shape 2 x 8. + // Then the following ReshapeLayer specifications are all equivalent, + // producing a blob "output" with shape 2 x 2 x 4: + // + // reshape_param { shape { dim: 2 dim: 2 dim: 4 } } + // reshape_param { shape { dim: 2 dim: 4 } axis: 1 } + // reshape_param { shape { dim: 2 dim: 4 } axis: -3 } + // + // num_axes specifies the extent of the reshape. + // If num_axes >= 0 (and axis >= 0), the reshape will be performed only on + // input axes in the range [axis, axis+num_axes]. + // num_axes may also be -1, the default, to include all remaining axes + // (starting from axis). + // + // For example, suppose "input" is a 2D blob with shape 2 x 8. + // Then the following ReshapeLayer specifications are equivalent, + // producing a blob "output" with shape 1 x 2 x 8. + // + // reshape_param { shape { dim: 1 dim: 2 dim: 8 } } + // reshape_param { shape { dim: 1 dim: 2 } num_axes: 1 } + // reshape_param { shape { dim: 1 } num_axes: 0 } + // + // On the other hand, these would produce output blob shape 2 x 1 x 8: + // + // reshape_param { shape { dim: 2 dim: 1 dim: 8 } } + // reshape_param { shape { dim: 1 } axis: 1 num_axes: 0 } + // + optional int32 axis = 2 [default = 0]; + optional int32 num_axes = 3 [default = -1]; +} + +message ScaleParameter { + // The first axis of bottom[0] (the first input Blob) along which to apply + // bottom[1] (the second input Blob). May be negative to index from the end + // (e.g., -1 for the last axis). + // + // For example, if bottom[0] is 4D with shape 100x3x40x60, the output + // top[0] will have the same shape, and bottom[1] may have any of the + // following shapes (for the given value of axis): + // (axis == 0 == -4) 100; 100x3; 100x3x40; 100x3x40x60 + // (axis == 1 == -3) 3; 3x40; 3x40x60 + // (axis == 2 == -2) 40; 40x60 + // (axis == 3 == -1) 60 + // Furthermore, bottom[1] may have the empty shape (regardless of the value of + // "axis") -- a scalar multiplier. + optional int32 axis = 1 [default = 1]; + + // (num_axes is ignored unless just one bottom is given and the scale is + // a learned parameter of the layer. Otherwise, num_axes is determined by the + // number of axes by the second bottom.) + // The number of axes of the input (bottom[0]) covered by the scale + // parameter, or -1 to cover all axes of bottom[0] starting from `axis`. + // Set num_axes := 0, to multiply with a zero-axis Blob: a scalar. + optional int32 num_axes = 2 [default = 1]; + + // (filler is ignored unless just one bottom is given and the scale is + // a learned parameter of the layer.) + // The initialization for the learned scale parameter. + // Default is the unit (1) initialization, resulting in the ScaleLayer + // initially performing the identity operation. + optional FillerParameter filler = 3; + + // Whether to also learn a bias (equivalent to a ScaleLayer+BiasLayer, but + // may be more efficient). Initialized with bias_filler (defaults to 0). + optional bool bias_term = 4 [default = false]; + optional FillerParameter bias_filler = 5; +} + +message SigmoidParameter { + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 1 [default = DEFAULT]; +} + +message SliceParameter { + // The axis along which to slice -- may be negative to index from the end + // (e.g., -1 for the last axis). + // By default, SliceLayer concatenates blobs along the "channels" axis (1). + optional int32 axis = 3 [default = 1]; + repeated uint32 slice_point = 2; + + // DEPRECATED: alias for "axis" -- does not support negative indexing. + optional uint32 slice_dim = 1 [default = 1]; +} + +// Message that stores parameters used by SoftmaxLayer, SoftmaxWithLossLayer +message SoftmaxParameter { + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 1 [default = DEFAULT]; + + // The axis along which to perform the softmax -- may be negative to index + // from the end (e.g., -1 for the last axis). + // Any other axes will be evaluated as independent softmaxes. + optional int32 axis = 2 [default = 1]; +} + +message TanHParameter { + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 1 [default = DEFAULT]; +} + +// Message that stores parameters used by TileLayer +message TileParameter { + // The index of the axis to tile. + optional int32 axis = 1 [default = 1]; + + // The number of copies (tiles) of the blob to output. + optional int32 tiles = 2; +} + +// Message that stores parameters used by ThresholdLayer +message ThresholdParameter { + optional float threshold = 1 [default = 0]; // Strictly positive values +} + +message WindowDataParameter { + // Specify the data source. + optional string source = 1; + // For data pre-processing, we can do simple scaling and subtracting the + // data mean, if provided. Note that the mean subtraction is always carried + // out before scaling. + optional float scale = 2 [default = 1]; + optional string mean_file = 3; + // Specify the batch size. + optional uint32 batch_size = 4; + // Specify if we would like to randomly crop an image. + optional uint32 crop_size = 5 [default = 0]; + // Specify if we want to randomly mirror data. + optional bool mirror = 6 [default = false]; + // Foreground (object) overlap threshold + optional float fg_threshold = 7 [default = 0.5]; + // Background (non-object) overlap threshold + optional float bg_threshold = 8 [default = 0.5]; + // Fraction of batch that should be foreground objects + optional float fg_fraction = 9 [default = 0.25]; + // Amount of contextual padding to add around a window + // (used only by the window_data_layer) + optional uint32 context_pad = 10 [default = 0]; + // Mode for cropping out a detection window + // warp: cropped window is warped to a fixed size and aspect ratio + // square: the tightest square around the window is cropped + optional string crop_mode = 11 [default = "warp"]; + // cache_images: will load all images in memory for faster access + optional bool cache_images = 12 [default = false]; + // append root_folder to locate images + optional string root_folder = 13 [default = ""]; +} + +message SPPParameter { + enum PoolMethod { + MAX = 0; + AVE = 1; + STOCHASTIC = 2; + } + optional uint32 pyramid_height = 1; + optional PoolMethod pool = 2 [default = MAX]; // The pooling method + enum Engine { + DEFAULT = 0; + CAFFE = 1; + CUDNN = 2; + } + optional Engine engine = 6 [default = DEFAULT]; +} + +// DEPRECATED: use LayerParameter. +message V1LayerParameter { + repeated string bottom = 2; + repeated string top = 3; + optional string name = 4; + repeated NetStateRule include = 32; + repeated NetStateRule exclude = 33; + enum LayerType { + NONE = 0; + ABSVAL = 35; + ACCURACY = 1; + ARGMAX = 30; + BNLL = 2; + CONCAT = 3; + CONTRASTIVE_LOSS = 37; + CONVOLUTION = 4; + DATA = 5; + DECONVOLUTION = 39; + DROPOUT = 6; + DUMMY_DATA = 32; + EUCLIDEAN_LOSS = 7; + ELTWISE = 25; + EXP = 38; + FLATTEN = 8; + HDF5_DATA = 9; + HDF5_OUTPUT = 10; + HINGE_LOSS = 28; + IM2COL = 11; + IMAGE_DATA = 12; + INFOGAIN_LOSS = 13; + INNER_PRODUCT = 14; + LRN = 15; + MEMORY_DATA = 29; + MULTINOMIAL_LOGISTIC_LOSS = 16; + MVN = 34; + POOLING = 17; + POWER = 26; + RELU = 18; + SIGMOID = 19; + SIGMOID_CROSS_ENTROPY_LOSS = 27; + SILENCE = 36; + SOFTMAX = 20; + SOFTMAX_LOSS = 21; + SPLIT = 22; + SLICE = 33; + TANH = 23; + WINDOW_DATA = 24; + THRESHOLD = 31; + } + optional LayerType type = 5; + repeated BlobProto blobs = 6; + repeated string param = 1001; + repeated DimCheckMode blob_share_mode = 1002; + enum DimCheckMode { + STRICT = 0; + PERMISSIVE = 1; + } + repeated float blobs_lr = 7; + repeated float weight_decay = 8; + repeated float loss_weight = 35; + optional AccuracyParameter accuracy_param = 27; + optional ArgMaxParameter argmax_param = 23; + optional ConcatParameter concat_param = 9; + optional ContrastiveLossParameter contrastive_loss_param = 40; + optional ConvolutionParameter convolution_param = 10; + optional DataParameter data_param = 11; + optional DropoutParameter dropout_param = 12; + optional DummyDataParameter dummy_data_param = 26; + optional EltwiseParameter eltwise_param = 24; + optional ExpParameter exp_param = 41; + optional HDF5DataParameter hdf5_data_param = 13; + optional HDF5OutputParameter hdf5_output_param = 14; + optional HingeLossParameter hinge_loss_param = 29; + optional ImageDataParameter image_data_param = 15; + optional InfogainLossParameter infogain_loss_param = 16; + optional InnerProductParameter inner_product_param = 17; + optional LRNParameter lrn_param = 18; + optional MemoryDataParameter memory_data_param = 22; + optional MVNParameter mvn_param = 34; + optional PoolingParameter pooling_param = 19; + optional PowerParameter power_param = 21; + optional ReLUParameter relu_param = 30; + optional SigmoidParameter sigmoid_param = 38; + optional SoftmaxParameter softmax_param = 39; + optional SliceParameter slice_param = 31; + optional TanHParameter tanh_param = 37; + optional ThresholdParameter threshold_param = 25; + optional WindowDataParameter window_data_param = 20; + optional TransformationParameter transform_param = 36; + optional LossParameter loss_param = 42; + optional V0LayerParameter layer = 1; +} + +// DEPRECATED: V0LayerParameter is the old way of specifying layer parameters +// in Caffe. We keep this message type around for legacy support. +message V0LayerParameter { + optional string name = 1; // the layer name + optional string type = 2; // the string to specify the layer type + + // Parameters to specify layers with inner products. + optional uint32 num_output = 3; // The number of outputs for the layer + optional bool biasterm = 4 [default = true]; // whether to have bias terms + optional FillerParameter weight_filler = 5; // The filler for the weight + optional FillerParameter bias_filler = 6; // The filler for the bias + + optional uint32 pad = 7 [default = 0]; // The padding size + optional uint32 kernelsize = 8; // The kernel size + optional uint32 group = 9 [default = 1]; // The group size for group conv + optional uint32 stride = 10 [default = 1]; // The stride + enum PoolMethod { + MAX = 0; + AVE = 1; + STOCHASTIC = 2; + } + optional PoolMethod pool = 11 [default = MAX]; // The pooling method + optional float dropout_ratio = 12 [default = 0.5]; // dropout ratio + + optional uint32 local_size = 13 [default = 5]; // for local response norm + optional float alpha = 14 [default = 1.]; // for local response norm + optional float beta = 15 [default = 0.75]; // for local response norm + optional float k = 22 [default = 1.]; + + // For data layers, specify the data source + optional string source = 16; + // For data pre-processing, we can do simple scaling and subtracting the + // data mean, if provided. Note that the mean subtraction is always carried + // out before scaling. + optional float scale = 17 [default = 1]; + optional string meanfile = 18; + // For data layers, specify the batch size. + optional uint32 batchsize = 19; + // For data layers, specify if we would like to randomly crop an image. + optional uint32 cropsize = 20 [default = 0]; + // For data layers, specify if we want to randomly mirror data. + optional bool mirror = 21 [default = false]; + + // The blobs containing the numeric parameters of the layer + repeated BlobProto blobs = 50; + // The ratio that is multiplied on the global learning rate. If you want to + // set the learning ratio for one blob, you need to set it for all blobs. + repeated float blobs_lr = 51; + // The weight decay that is multiplied on the global weight decay. + repeated float weight_decay = 52; + + // The rand_skip variable is for the data layer to skip a few data points + // to avoid all asynchronous sgd clients to start at the same point. The skip + // point would be set as rand_skip * rand(0,1). Note that rand_skip should not + // be larger than the number of keys in the database. + optional uint32 rand_skip = 53 [default = 0]; + + // Fields related to detection (det_*) + // foreground (object) overlap threshold + optional float det_fg_threshold = 54 [default = 0.5]; + // background (non-object) overlap threshold + optional float det_bg_threshold = 55 [default = 0.5]; + // Fraction of batch that should be foreground objects + optional float det_fg_fraction = 56 [default = 0.25]; + + // optional bool OBSOLETE_can_clobber = 57 [default = true]; + + // Amount of contextual padding to add around a window + // (used only by the window_data_layer) + optional uint32 det_context_pad = 58 [default = 0]; + + // Mode for cropping out a detection window + // warp: cropped window is warped to a fixed size and aspect ratio + // square: the tightest square around the window is cropped + optional string det_crop_mode = 59 [default = "warp"]; + + // For ReshapeLayer, one needs to specify the new dimensions. + optional int32 new_num = 60 [default = 0]; + optional int32 new_channels = 61 [default = 0]; + optional int32 new_height = 62 [default = 0]; + optional int32 new_width = 63 [default = 0]; + + // Whether or not ImageLayer should shuffle the list of files at every epoch. + // It will also resize images if new_height or new_width are not zero. + optional bool shuffle_images = 64 [default = false]; + + // For ConcatLayer, one needs to specify the dimension for concatenation, and + // the other dimensions must be the same for all the bottom blobs. + // By default it will concatenate blobs along the channels dimension. + optional uint32 concat_dim = 65 [default = 1]; + + optional HDF5OutputParameter hdf5_output_param = 1001; +} + +message PReLUParameter { + // Parametric ReLU described in K. He et al, Delving Deep into Rectifiers: + // Surpassing Human-Level Performance on ImageNet Classification, 2015. + + // Initial value of a_i. Default is a_i=0.25 for all i. + optional FillerParameter filler = 1; + // Whether or not slope parameters are shared across channels. + optional bool channel_shared = 2 [default = false]; +} + +// The normalized bounding box [0, 1] w.r.t. the input image size. +message NormalizedBBox { + optional float xmin = 1; + optional float ymin = 2; + optional float xmax = 3; + optional float ymax = 4; + optional int32 label = 5; + optional bool difficult = 6; + optional float score = 7; + optional float size = 8; +} diff --git a/modules/dnn/src/caffe/caffe_importer.cpp b/modules/dnn/src/caffe/caffe_importer.cpp new file mode 100644 index 0000000000..15aae982f5 --- /dev/null +++ b/modules/dnn/src/caffe/caffe_importer.cpp @@ -0,0 +1,382 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +using namespace cv; +using namespace cv::dnn; + +#if HAVE_PROTOBUF +#include "caffe.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include "caffe_io.hpp" + +using ::google::protobuf::RepeatedField; +using ::google::protobuf::RepeatedPtrField; +using ::google::protobuf::Message; +using ::google::protobuf::Descriptor; +using ::google::protobuf::FieldDescriptor; +using ::google::protobuf::Reflection; + +namespace +{ + +template +static cv::String toString(const T &v) +{ + std::ostringstream ss; + ss << v; + return ss.str(); +} + +class CaffeImporter : public Importer +{ + caffe::NetParameter net; + caffe::NetParameter netBinary; + +public: + + CaffeImporter(const char *pototxt, const char *caffeModel) + { + ReadNetParamsFromTextFileOrDie(pototxt, &net); + + if (caffeModel && caffeModel[0]) + ReadNetParamsFromBinaryFileOrDie(caffeModel, &netBinary); + } + + void addParam(const Message &msg, const FieldDescriptor *field, cv::dnn::LayerParams ¶ms) + { + const Reflection *refl = msg.GetReflection(); + int type = field->cpp_type(); + bool isRepeated = field->is_repeated(); + const std::string &name = field->name(); + + #define SET_UP_FILED(getter, arrayConstr, gtype) \ + if (isRepeated) { \ + const RepeatedField &v = refl->GetRepeatedField(msg, field); \ + params.set(name, DictValue::arrayConstr(v.begin(), (int)v.size())); \ + } \ + else { \ + params.set(name, refl->getter(msg, field)); \ + } + + switch (type) + { + case FieldDescriptor::CPPTYPE_INT32: + SET_UP_FILED(GetInt32, arrayInt, ::google::protobuf::int32); + break; + case FieldDescriptor::CPPTYPE_UINT32: + SET_UP_FILED(GetUInt32, arrayInt, ::google::protobuf::uint32); + break; + case FieldDescriptor::CPPTYPE_INT64: + SET_UP_FILED(GetInt32, arrayInt, ::google::protobuf::int64); + break; + case FieldDescriptor::CPPTYPE_UINT64: + SET_UP_FILED(GetUInt32, arrayInt, ::google::protobuf::uint64); + break; + case FieldDescriptor::CPPTYPE_BOOL: + SET_UP_FILED(GetBool, arrayInt, bool); + break; + case FieldDescriptor::CPPTYPE_DOUBLE: + SET_UP_FILED(GetDouble, arrayReal, double); + break; + case FieldDescriptor::CPPTYPE_FLOAT: + SET_UP_FILED(GetFloat, arrayReal, float); + break; + case FieldDescriptor::CPPTYPE_STRING: + if (isRepeated) { + const RepeatedPtrField &v = refl->GetRepeatedPtrField(msg, field); + params.set(name, DictValue::arrayString(v.begin(), (int)v.size())); + } + else { + params.set(name, refl->GetString(msg, field)); + } + break; + case FieldDescriptor::CPPTYPE_ENUM: + if (isRepeated) { + int size = refl->FieldSize(msg, field); + std::vector buf(size); + for (int i = 0; i < size; i++) + buf[i] = refl->GetRepeatedEnum(msg, field, i)->name(); + params.set(name, DictValue::arrayString(buf.begin(), size)); + } + else { + params.set(name, refl->GetEnum(msg, field)->name()); + } + break; + default: + CV_Error(Error::StsError, "Unknown type \"" + String(field->type_name()) + "\" in prototxt"); + break; + } + } + + inline static bool ends_with_param(const std::string &str) + { + static const std::string _param("_param"); + return (str.size() >= _param.size()) && str.compare(str.size() - _param.size(), _param.size(), _param) == 0; + } + + void extractLayerParams(const Message &msg, cv::dnn::LayerParams ¶ms, bool isInternal = false) + { + const Descriptor *msgDesc = msg.GetDescriptor(); + const Reflection *msgRefl = msg.GetReflection(); + + for (int fieldId = 0; fieldId < msgDesc->field_count(); fieldId++) + { + const FieldDescriptor *fd = msgDesc->field(fieldId); + + if (!isInternal && !ends_with_param(fd->name())) + continue; + + bool hasData = fd->is_required() || + (fd->is_optional() && msgRefl->HasField(msg, fd)) || + (fd->is_repeated() && msgRefl->FieldSize(msg, fd) > 0); + if (!hasData) + continue; + + if (fd->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) + { + if (fd->is_repeated()) //Extract only first item! + extractLayerParams(msgRefl->GetRepeatedMessage(msg, fd, 0), params, true); + else + extractLayerParams(msgRefl->GetMessage(msg, fd), params, true); + } + else + { + addParam(msg, fd, params); + } + } + } + + void blobShapeFromProto(const caffe::BlobProto &pbBlob, MatShape& shape) + { + shape.clear(); + if (pbBlob.has_num() || pbBlob.has_channels() || pbBlob.has_height() || pbBlob.has_width()) + { + shape.push_back(pbBlob.num()); + shape.push_back(pbBlob.channels()); + shape.push_back(pbBlob.height()); + shape.push_back(pbBlob.width()); + } + else if (pbBlob.has_shape()) + { + const caffe::BlobShape &_shape = pbBlob.shape(); + + for (int i = 0; i < _shape.dim_size(); i++) + shape.push_back((int)_shape.dim(i)); + } + else + CV_Error(Error::StsError, "Unknown shape of input blob"); + } + + void blobFromProto(const caffe::BlobProto &pbBlob, cv::Mat &dstBlob) + { + MatShape shape; + blobShapeFromProto(pbBlob, shape); + + dstBlob.create((int)shape.size(), &shape[0], CV_32F); + CV_Assert(pbBlob.data_size() == (int)dstBlob.total()); + + CV_DbgAssert(pbBlob.GetDescriptor()->FindFieldByLowercaseName("data")->cpp_type() == FieldDescriptor::CPPTYPE_FLOAT); + float *dstData = dstBlob.ptr(); + + for (int i = 0; i < pbBlob.data_size(); i++) + dstData[i] = pbBlob.data(i); + } + + void extractBinaryLayerParms(const caffe::LayerParameter& layer, LayerParams& layerParams) + { + const std::string &name = layer.name(); + + int li; + for (li = 0; li != netBinary.layer_size(); li++) + { + if (netBinary.layer(li).name() == name) + break; + } + + if (li == netBinary.layer_size() || netBinary.layer(li).blobs_size() == 0) + return; + + const caffe::LayerParameter &binLayer = netBinary.layer(li); + layerParams.blobs.resize(binLayer.blobs_size()); + for (int bi = 0; bi < binLayer.blobs_size(); bi++) + { + blobFromProto(binLayer.blobs(bi), layerParams.blobs[bi]); + } + } + + struct BlobNote + { + BlobNote(const std::string &_name, int _layerId, int _outNum) : + name(_name.c_str()), layerId(_layerId), outNum(_outNum) {} + + const char *name; + int layerId, outNum; + }; + + std::vector addedBlobs; + std::map layerCounter; + + void populateNet(Net dstNet) + { + int layersSize = net.layer_size(); + layerCounter.clear(); + addedBlobs.clear(); + addedBlobs.reserve(layersSize + 1); + + //setup input layer names + { + std::vector netInputs(net.input_size()); + for (int inNum = 0; inNum < net.input_size(); inNum++) + { + addedBlobs.push_back(BlobNote(net.input(inNum), 0, inNum)); + netInputs[inNum] = net.input(inNum); + } + dstNet.setInputsNames(netInputs); + } + + for (int li = 0; li < layersSize; li++) + { + const caffe::LayerParameter &layer = net.layer(li); + String name = layer.name(); + String type = layer.type(); + LayerParams layerParams; + + extractLayerParams(layer, layerParams); + extractBinaryLayerParms(layer, layerParams); + + int repetitions = layerCounter[name]++; + if (repetitions) + name += String("_") + toString(repetitions); + + int id = dstNet.addLayer(name, type, layerParams); + + for (int inNum = 0; inNum < layer.bottom_size(); inNum++) + addInput(layer.bottom(inNum), id, inNum, dstNet); + + for (int outNum = 0; outNum < layer.top_size(); outNum++) + addOutput(layer, id, outNum); + } + + addedBlobs.clear(); + } + + void addOutput(const caffe::LayerParameter &layer, int layerId, int outNum) + { + const std::string &name = layer.top(outNum); + + bool haveDups = false; + for (int idx = (int)addedBlobs.size() - 1; idx >= 0; idx--) + { + if (addedBlobs[idx].name == name) + { + haveDups = true; + break; + } + } + + if (haveDups) + { + bool isInplace = layer.bottom_size() > outNum && layer.bottom(outNum) == name; + if (!isInplace) + CV_Error(Error::StsBadArg, "Duplicate blobs produced by multiple sources"); + } + + addedBlobs.push_back(BlobNote(name, layerId, outNum)); + } + + void addInput(const std::string &name, int layerId, int inNum, Net &dstNet) + { + int idx; + for (idx = (int)addedBlobs.size() - 1; idx >= 0; idx--) + { + if (addedBlobs[idx].name == name) + break; + } + + if (idx < 0) + { + CV_Error(Error::StsObjectNotFound, "Can't find output blob \"" + name + "\""); + return; + } + + dstNet.connect(addedBlobs[idx].layerId, addedBlobs[idx].outNum, layerId, inNum); + } + + ~CaffeImporter() + { + + } + +}; + +} + +Ptr cv::dnn::createCaffeImporter(const String &prototxt, const String &caffeModel) +{ + return Ptr(new CaffeImporter(prototxt.c_str(), caffeModel.c_str())); +} + +#else //HAVE_PROTOBUF + +Ptr cv::dnn::createCaffeImporter(const String&, const String&) +{ + CV_Error(cv::Error::StsNotImplemented, "libprotobuf required to import data from Caffe models"); + return Ptr(); +} + +#endif //HAVE_PROTOBUF + +Net cv::dnn::readNetFromCaffe(const String &prototxt, const String &caffeModel /*= String()*/) +{ + Ptr caffeImporter = createCaffeImporter(prototxt, caffeModel); + Net net; + if (caffeImporter) + caffeImporter->populateNet(net); + return net; +} diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp new file mode 100644 index 0000000000..9934dacda1 --- /dev/null +++ b/modules/dnn/src/caffe/caffe_io.cpp @@ -0,0 +1,1151 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +/*M/////////////////////////////////////////////////////////////////////////////////////// +//COPYRIGHT +// +//All contributions by the University of California: +//Copyright (c) 2014, The Regents of the University of California (Regents) +//All rights reserved. +// +//All other contributions: +//Copyright (c) 2014, the respective contributors +//All rights reserved. +// +//Caffe uses a shared copyright model: each contributor holds copyright over +//their contributions to Caffe. The project versioning records all such +//contribution and copyright details. If a contributor wants to further mark +//their specific copyright on a particular contribution, they should indicate +//their copyright solely in the commit message of the change when it is +//committed. +// +//LICENSE +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions are met: +// +//1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +//2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +//DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +//ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +//ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +//(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//CONTRIBUTION AGREEMENT +// +//By contributing to the BVLC/caffe repository through pull-request, comment, +//or otherwise, the contributor releases their content to the +//license and copyright terms herein. +// +//M*/ + +#if HAVE_PROTOBUF +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "caffe.pb.h" +#include "caffe_io.hpp" +#include "glog_emulator.hpp" + +namespace cv { +namespace dnn { + +using std::string; +using std::map; +using namespace caffe; +using namespace ::google::protobuf; +using namespace ::google::protobuf::io; + +// Return true iff the net is not the current version. +bool NetNeedsUpgrade(const NetParameter& net_param); + +// Return true iff any layer contains parameters specified using +// deprecated V0LayerParameter. +bool NetNeedsV0ToV1Upgrade(const NetParameter& net_param); + +// Perform all necessary transformations to upgrade a V0NetParameter into a +// NetParameter (including upgrading padding layers and LayerParameters). +bool UpgradeV0Net(const NetParameter& v0_net_param, NetParameter* net_param); + +// Upgrade NetParameter with padding layers to pad-aware conv layers. +// For any padding layer, remove it and put its pad parameter in any layers +// taking its top blob as input. +// Error if any of these above layers are not-conv layers. +void UpgradeV0PaddingLayers(const NetParameter& param, + NetParameter* param_upgraded_pad); + +// Upgrade a single V0LayerConnection to the V1LayerParameter format. +bool UpgradeV0LayerParameter(const V1LayerParameter& v0_layer_connection, + V1LayerParameter* layer_param); + +V1LayerParameter_LayerType UpgradeV0LayerType(const string& type); + +// Return true iff any layer contains deprecated data transformation parameters. +bool NetNeedsDataUpgrade(const NetParameter& net_param); + +// Perform all necessary transformations to upgrade old transformation fields +// into a TransformationParameter. +void UpgradeNetDataTransformation(NetParameter* net_param); + +// Return true iff the Net contains any layers specified as V1LayerParameters. +bool NetNeedsV1ToV2Upgrade(const NetParameter& net_param); + +// Perform all necessary transformations to upgrade a NetParameter with +// deprecated V1LayerParameters. +bool UpgradeV1Net(const NetParameter& v1_net_param, NetParameter* net_param); + +bool UpgradeV1LayerParameter(const V1LayerParameter& v1_layer_param, + LayerParameter* layer_param); + +const char* UpgradeV1LayerType(const V1LayerParameter_LayerType type); + +bool NetNeedsBatchNormUpgrade(const NetParameter& net_param); + +void UpgradeNetBatchNorm(NetParameter* net_param); + +// Check for deprecations and upgrade the NetParameter as needed. +bool UpgradeNetAsNeeded(const string& param_file, NetParameter* param); + + +bool NetNeedsUpgrade(const NetParameter& net_param) { + return NetNeedsV0ToV1Upgrade(net_param) || NetNeedsV1ToV2Upgrade(net_param) || + NetNeedsBatchNormUpgrade(net_param); +} + +bool NetNeedsV0ToV1Upgrade(const NetParameter& net_param) { + for (int i = 0; i < net_param.layers_size(); ++i) { + if (net_param.layers(i).has_layer()) { + return true; + } + } + return false; +} + +bool NetNeedsV1ToV2Upgrade(const NetParameter& net_param) { + return net_param.layers_size() > 0; +} + +bool UpgradeV0Net(const NetParameter& v0_net_param_padding_layers, + NetParameter* net_param) { + // First upgrade padding layers to padded conv layers. + NetParameter v0_net_param; + UpgradeV0PaddingLayers(v0_net_param_padding_layers, &v0_net_param); + // Now upgrade layer parameters. + bool is_fully_compatible = true; + net_param->Clear(); + if (v0_net_param.has_name()) { + net_param->set_name(v0_net_param.name()); + } + for (int i = 0; i < v0_net_param.layers_size(); ++i) { + is_fully_compatible &= UpgradeV0LayerParameter(v0_net_param.layers(i), + net_param->add_layers()); + } + for (int i = 0; i < v0_net_param.input_size(); ++i) { + net_param->add_input(v0_net_param.input(i)); + } + for (int i = 0; i < v0_net_param.input_dim_size(); ++i) { + net_param->add_input_dim(v0_net_param.input_dim(i)); + } + if (v0_net_param.has_force_backward()) { + net_param->set_force_backward(v0_net_param.force_backward()); + } + return is_fully_compatible; +} + +void UpgradeV0PaddingLayers(const NetParameter& param, + NetParameter* param_upgraded_pad) { + // Copy everything other than the layers from the original param. + param_upgraded_pad->Clear(); + param_upgraded_pad->CopyFrom(param); + param_upgraded_pad->clear_layers(); + // Figure out which layer each bottom blob comes from. + map blob_name_to_last_top_idx; + for (int i = 0; i < param.input_size(); ++i) { + const string& blob_name = param.input(i); + blob_name_to_last_top_idx[blob_name] = -1; + } + for (int i = 0; i < param.layers_size(); ++i) { + const V1LayerParameter& layer_connection = param.layers(i); + const V0LayerParameter& layer_param = layer_connection.layer(); + // Add the layer to the new net, unless it's a padding layer. + if (layer_param.type() != "padding") { + param_upgraded_pad->add_layers()->CopyFrom(layer_connection); + } + for (int j = 0; j < layer_connection.bottom_size(); ++j) { + const string& blob_name = layer_connection.bottom(j); + if (blob_name_to_last_top_idx.find(blob_name) == + blob_name_to_last_top_idx.end()) { + LOG(FATAL) << "Unknown blob input " << blob_name << " to layer " << j; + } + const int top_idx = blob_name_to_last_top_idx[blob_name]; + if (top_idx == -1) { + continue; + } + const V1LayerParameter& source_layer = param.layers(top_idx); + if (source_layer.layer().type() == "padding") { + // This layer has a padding layer as input -- check that it is a conv + // layer or a pooling layer and takes only one input. Also check that + // the padding layer input has only one input and one output. Other + // cases have undefined behavior in Caffe. + CHECK((layer_param.type() == "conv") || (layer_param.type() == "pool")) + << "Padding layer input to " + "non-convolutional / non-pooling layer type " + << layer_param.type(); + CHECK_EQ(layer_connection.bottom_size(), 1) + << "Conv Layer takes a single blob as input."; + CHECK_EQ(source_layer.bottom_size(), 1) + << "Padding Layer takes a single blob as input."; + CHECK_EQ(source_layer.top_size(), 1) + << "Padding Layer produces a single blob as output."; + int layer_index = param_upgraded_pad->layers_size() - 1; + param_upgraded_pad->mutable_layers(layer_index)->mutable_layer() + ->set_pad(source_layer.layer().pad()); + param_upgraded_pad->mutable_layers(layer_index) + ->set_bottom(j, source_layer.bottom(0)); + } + } + for (int j = 0; j < layer_connection.top_size(); ++j) { + const string& blob_name = layer_connection.top(j); + blob_name_to_last_top_idx[blob_name] = i; + } + } +} + +bool UpgradeV0LayerParameter(const V1LayerParameter& v0_layer_connection, + V1LayerParameter* layer_param) { + bool is_fully_compatible = true; + layer_param->Clear(); + for (int i = 0; i < v0_layer_connection.bottom_size(); ++i) { + layer_param->add_bottom(v0_layer_connection.bottom(i)); + } + for (int i = 0; i < v0_layer_connection.top_size(); ++i) { + layer_param->add_top(v0_layer_connection.top(i)); + } + if (v0_layer_connection.has_layer()) { + const V0LayerParameter& v0_layer_param = v0_layer_connection.layer(); + if (v0_layer_param.has_name()) { + layer_param->set_name(v0_layer_param.name()); + } + const string& type = v0_layer_param.type(); + if (v0_layer_param.has_type()) { + layer_param->set_type(UpgradeV0LayerType(type)); + } + for (int i = 0; i < v0_layer_param.blobs_size(); ++i) { + layer_param->add_blobs()->CopyFrom(v0_layer_param.blobs(i)); + } + for (int i = 0; i < v0_layer_param.blobs_lr_size(); ++i) { + layer_param->add_blobs_lr(v0_layer_param.blobs_lr(i)); + } + for (int i = 0; i < v0_layer_param.weight_decay_size(); ++i) { + layer_param->add_weight_decay(v0_layer_param.weight_decay(i)); + } + if (v0_layer_param.has_num_output()) { + if (type == "conv") { + layer_param->mutable_convolution_param()->set_num_output( + v0_layer_param.num_output()); + } else if (type == "innerproduct") { + layer_param->mutable_inner_product_param()->set_num_output( + v0_layer_param.num_output()); + } else { + LOG(ERROR) << "Unknown parameter num_output for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_biasterm()) { + if (type == "conv") { + layer_param->mutable_convolution_param()->set_bias_term( + v0_layer_param.biasterm()); + } else if (type == "innerproduct") { + layer_param->mutable_inner_product_param()->set_bias_term( + v0_layer_param.biasterm()); + } else { + LOG(ERROR) << "Unknown parameter biasterm for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_weight_filler()) { + if (type == "conv") { + layer_param->mutable_convolution_param()-> + mutable_weight_filler()->CopyFrom(v0_layer_param.weight_filler()); + } else if (type == "innerproduct") { + layer_param->mutable_inner_product_param()-> + mutable_weight_filler()->CopyFrom(v0_layer_param.weight_filler()); + } else { + LOG(ERROR) << "Unknown parameter weight_filler for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_bias_filler()) { + if (type == "conv") { + layer_param->mutable_convolution_param()-> + mutable_bias_filler()->CopyFrom(v0_layer_param.bias_filler()); + } else if (type == "innerproduct") { + layer_param->mutable_inner_product_param()-> + mutable_bias_filler()->CopyFrom(v0_layer_param.bias_filler()); + } else { + LOG(ERROR) << "Unknown parameter bias_filler for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_pad()) { + if (type == "conv") { + layer_param->mutable_convolution_param()->add_pad(v0_layer_param.pad()); + } else if (type == "pool") { + layer_param->mutable_pooling_param()->set_pad(v0_layer_param.pad()); + } else { + LOG(ERROR) << "Unknown parameter pad for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_kernelsize()) { + if (type == "conv") { + layer_param->mutable_convolution_param()->add_kernel_size( + v0_layer_param.kernelsize()); + } else if (type == "pool") { + layer_param->mutable_pooling_param()->set_kernel_size( + v0_layer_param.kernelsize()); + } else { + LOG(ERROR) << "Unknown parameter kernelsize for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_group()) { + if (type == "conv") { + layer_param->mutable_convolution_param()->set_group( + v0_layer_param.group()); + } else { + LOG(ERROR) << "Unknown parameter group for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_stride()) { + if (type == "conv") { + layer_param->mutable_convolution_param()->add_stride( + v0_layer_param.stride()); + } else if (type == "pool") { + layer_param->mutable_pooling_param()->set_stride( + v0_layer_param.stride()); + } else { + LOG(ERROR) << "Unknown parameter stride for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_pool()) { + if (type == "pool") { + V0LayerParameter_PoolMethod pool = v0_layer_param.pool(); + switch (pool) { + case V0LayerParameter_PoolMethod_MAX: + layer_param->mutable_pooling_param()->set_pool( + PoolingParameter_PoolMethod_MAX); + break; + case V0LayerParameter_PoolMethod_AVE: + layer_param->mutable_pooling_param()->set_pool( + PoolingParameter_PoolMethod_AVE); + break; + case V0LayerParameter_PoolMethod_STOCHASTIC: + layer_param->mutable_pooling_param()->set_pool( + PoolingParameter_PoolMethod_STOCHASTIC); + break; + default: + LOG(ERROR) << "Unknown pool method " << pool; + is_fully_compatible = false; + } + } else { + LOG(ERROR) << "Unknown parameter pool for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_dropout_ratio()) { + if (type == "dropout") { + layer_param->mutable_dropout_param()->set_dropout_ratio( + v0_layer_param.dropout_ratio()); + } else { + LOG(ERROR) << "Unknown parameter dropout_ratio for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_local_size()) { + if (type == "lrn") { + layer_param->mutable_lrn_param()->set_local_size( + v0_layer_param.local_size()); + } else { + LOG(ERROR) << "Unknown parameter local_size for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_alpha()) { + if (type == "lrn") { + layer_param->mutable_lrn_param()->set_alpha(v0_layer_param.alpha()); + } else { + LOG(ERROR) << "Unknown parameter alpha for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_beta()) { + if (type == "lrn") { + layer_param->mutable_lrn_param()->set_beta(v0_layer_param.beta()); + } else { + LOG(ERROR) << "Unknown parameter beta for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_k()) { + if (type == "lrn") { + layer_param->mutable_lrn_param()->set_k(v0_layer_param.k()); + } else { + LOG(ERROR) << "Unknown parameter k for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_source()) { + if (type == "data") { + layer_param->mutable_data_param()->set_source(v0_layer_param.source()); + } else if (type == "hdf5_data") { + layer_param->mutable_hdf5_data_param()->set_source( + v0_layer_param.source()); + } else if (type == "images") { + layer_param->mutable_image_data_param()->set_source( + v0_layer_param.source()); + } else if (type == "window_data") { + layer_param->mutable_window_data_param()->set_source( + v0_layer_param.source()); + } else if (type == "infogain_loss") { + layer_param->mutable_infogain_loss_param()->set_source( + v0_layer_param.source()); + } else { + LOG(ERROR) << "Unknown parameter source for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_scale()) { + layer_param->mutable_transform_param()-> + set_scale(v0_layer_param.scale()); + } + if (v0_layer_param.has_meanfile()) { + layer_param->mutable_transform_param()-> + set_mean_file(v0_layer_param.meanfile()); + } + if (v0_layer_param.has_batchsize()) { + if (type == "data") { + layer_param->mutable_data_param()->set_batch_size( + v0_layer_param.batchsize()); + } else if (type == "hdf5_data") { + layer_param->mutable_hdf5_data_param()->set_batch_size( + v0_layer_param.batchsize()); + } else if (type == "images") { + layer_param->mutable_image_data_param()->set_batch_size( + v0_layer_param.batchsize()); + } else if (type == "window_data") { + layer_param->mutable_window_data_param()->set_batch_size( + v0_layer_param.batchsize()); + } else { + LOG(ERROR) << "Unknown parameter batchsize for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_cropsize()) { + layer_param->mutable_transform_param()-> + set_crop_size(v0_layer_param.cropsize()); + } + if (v0_layer_param.has_mirror()) { + layer_param->mutable_transform_param()-> + set_mirror(v0_layer_param.mirror()); + } + if (v0_layer_param.has_rand_skip()) { + if (type == "data") { + layer_param->mutable_data_param()->set_rand_skip( + v0_layer_param.rand_skip()); + } else if (type == "images") { + layer_param->mutable_image_data_param()->set_rand_skip( + v0_layer_param.rand_skip()); + } else { + LOG(ERROR) << "Unknown parameter rand_skip for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_shuffle_images()) { + if (type == "images") { + layer_param->mutable_image_data_param()->set_shuffle( + v0_layer_param.shuffle_images()); + } else { + LOG(ERROR) << "Unknown parameter shuffle for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_new_height()) { + if (type == "images") { + layer_param->mutable_image_data_param()->set_new_height( + v0_layer_param.new_height()); + } else { + LOG(ERROR) << "Unknown parameter new_height for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_new_width()) { + if (type == "images") { + layer_param->mutable_image_data_param()->set_new_width( + v0_layer_param.new_width()); + } else { + LOG(ERROR) << "Unknown parameter new_width for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_concat_dim()) { + if (type == "concat") { + layer_param->mutable_concat_param()->set_concat_dim( + v0_layer_param.concat_dim()); + } else { + LOG(ERROR) << "Unknown parameter concat_dim for layer type " << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_det_fg_threshold()) { + if (type == "window_data") { + layer_param->mutable_window_data_param()->set_fg_threshold( + v0_layer_param.det_fg_threshold()); + } else { + LOG(ERROR) << "Unknown parameter det_fg_threshold for layer type " + << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_det_bg_threshold()) { + if (type == "window_data") { + layer_param->mutable_window_data_param()->set_bg_threshold( + v0_layer_param.det_bg_threshold()); + } else { + LOG(ERROR) << "Unknown parameter det_bg_threshold for layer type " + << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_det_fg_fraction()) { + if (type == "window_data") { + layer_param->mutable_window_data_param()->set_fg_fraction( + v0_layer_param.det_fg_fraction()); + } else { + LOG(ERROR) << "Unknown parameter det_fg_fraction for layer type " + << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_det_context_pad()) { + if (type == "window_data") { + layer_param->mutable_window_data_param()->set_context_pad( + v0_layer_param.det_context_pad()); + } else { + LOG(ERROR) << "Unknown parameter det_context_pad for layer type " + << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_det_crop_mode()) { + if (type == "window_data") { + layer_param->mutable_window_data_param()->set_crop_mode( + v0_layer_param.det_crop_mode()); + } else { + LOG(ERROR) << "Unknown parameter det_crop_mode for layer type " + << type; + is_fully_compatible = false; + } + } + if (v0_layer_param.has_hdf5_output_param()) { + if (type == "hdf5_output") { + layer_param->mutable_hdf5_output_param()->CopyFrom( + v0_layer_param.hdf5_output_param()); + } else { + LOG(ERROR) << "Unknown parameter hdf5_output_param for layer type " + << type; + is_fully_compatible = false; + } + } + } + return is_fully_compatible; +} + +V1LayerParameter_LayerType UpgradeV0LayerType(const string& type) { + if (type == "accuracy") { + return V1LayerParameter_LayerType_ACCURACY; + } else if (type == "bnll") { + return V1LayerParameter_LayerType_BNLL; + } else if (type == "concat") { + return V1LayerParameter_LayerType_CONCAT; + } else if (type == "conv") { + return V1LayerParameter_LayerType_CONVOLUTION; + } else if (type == "data") { + return V1LayerParameter_LayerType_DATA; + } else if (type == "dropout") { + return V1LayerParameter_LayerType_DROPOUT; + } else if (type == "euclidean_loss") { + return V1LayerParameter_LayerType_EUCLIDEAN_LOSS; + } else if (type == "flatten") { + return V1LayerParameter_LayerType_FLATTEN; + } else if (type == "hdf5_data") { + return V1LayerParameter_LayerType_HDF5_DATA; + } else if (type == "hdf5_output") { + return V1LayerParameter_LayerType_HDF5_OUTPUT; + } else if (type == "im2col") { + return V1LayerParameter_LayerType_IM2COL; + } else if (type == "images") { + return V1LayerParameter_LayerType_IMAGE_DATA; + } else if (type == "infogain_loss") { + return V1LayerParameter_LayerType_INFOGAIN_LOSS; + } else if (type == "innerproduct") { + return V1LayerParameter_LayerType_INNER_PRODUCT; + } else if (type == "lrn") { + return V1LayerParameter_LayerType_LRN; + } else if (type == "multinomial_logistic_loss") { + return V1LayerParameter_LayerType_MULTINOMIAL_LOGISTIC_LOSS; + } else if (type == "pool") { + return V1LayerParameter_LayerType_POOLING; + } else if (type == "relu") { + return V1LayerParameter_LayerType_RELU; + } else if (type == "sigmoid") { + return V1LayerParameter_LayerType_SIGMOID; + } else if (type == "softmax") { + return V1LayerParameter_LayerType_SOFTMAX; + } else if (type == "softmax_loss") { + return V1LayerParameter_LayerType_SOFTMAX_LOSS; + } else if (type == "split") { + return V1LayerParameter_LayerType_SPLIT; + } else if (type == "tanh") { + return V1LayerParameter_LayerType_TANH; + } else if (type == "window_data") { + return V1LayerParameter_LayerType_WINDOW_DATA; + } else { + LOG(FATAL) << "Unknown layer name: " << type; + return V1LayerParameter_LayerType_NONE; + } +} + +bool NetNeedsDataUpgrade(const NetParameter& net_param) { + for (int i = 0; i < net_param.layers_size(); ++i) { + if (net_param.layers(i).type() == V1LayerParameter_LayerType_DATA) { + DataParameter layer_param = net_param.layers(i).data_param(); + if (layer_param.has_scale()) { return true; } + if (layer_param.has_mean_file()) { return true; } + if (layer_param.has_crop_size()) { return true; } + if (layer_param.has_mirror()) { return true; } + } + if (net_param.layers(i).type() == V1LayerParameter_LayerType_IMAGE_DATA) { + ImageDataParameter layer_param = net_param.layers(i).image_data_param(); + if (layer_param.has_scale()) { return true; } + if (layer_param.has_mean_file()) { return true; } + if (layer_param.has_crop_size()) { return true; } + if (layer_param.has_mirror()) { return true; } + } + if (net_param.layers(i).type() == V1LayerParameter_LayerType_WINDOW_DATA) { + WindowDataParameter layer_param = net_param.layers(i).window_data_param(); + if (layer_param.has_scale()) { return true; } + if (layer_param.has_mean_file()) { return true; } + if (layer_param.has_crop_size()) { return true; } + if (layer_param.has_mirror()) { return true; } + } + } + return false; +} + +#define CONVERT_LAYER_TRANSFORM_PARAM(TYPE, Name, param_name) \ + do { \ + if (net_param->layers(i).type() == V1LayerParameter_LayerType_##TYPE) { \ + Name##Parameter* layer_param = \ + net_param->mutable_layers(i)->mutable_##param_name##_param(); \ + TransformationParameter* transform_param = \ + net_param->mutable_layers(i)->mutable_transform_param(); \ + if (layer_param->has_scale()) { \ + transform_param->set_scale(layer_param->scale()); \ + layer_param->clear_scale(); \ + } \ + if (layer_param->has_mean_file()) { \ + transform_param->set_mean_file(layer_param->mean_file()); \ + layer_param->clear_mean_file(); \ + } \ + if (layer_param->has_crop_size()) { \ + transform_param->set_crop_size(layer_param->crop_size()); \ + layer_param->clear_crop_size(); \ + } \ + if (layer_param->has_mirror()) { \ + transform_param->set_mirror(layer_param->mirror()); \ + layer_param->clear_mirror(); \ + } \ + } \ + } while (0) + +void UpgradeNetDataTransformation(NetParameter* net_param) { + for (int i = 0; i < net_param->layers_size(); ++i) { + CONVERT_LAYER_TRANSFORM_PARAM(DATA, Data, data); + CONVERT_LAYER_TRANSFORM_PARAM(IMAGE_DATA, ImageData, image_data); + CONVERT_LAYER_TRANSFORM_PARAM(WINDOW_DATA, WindowData, window_data); + } +} + +bool UpgradeNetAsNeeded(const string& param_file, NetParameter* param) { + bool success = true; + if (NetNeedsV0ToV1Upgrade(*param)) { + // NetParameter was specified using the old style (V0LayerParameter); try to + // upgrade it. + LOG(ERROR) << "Attempting to upgrade input file specified using deprecated " + << "V0LayerParameter: " << param_file; + NetParameter original_param(*param); + if (!UpgradeV0Net(original_param, param)) { + success = false; + LOG(ERROR) << "Warning: had one or more problems upgrading " + << "V0NetParameter to NetParameter (see above); continuing anyway."; + } else { + LOG(INFO) << "Successfully upgraded file specified using deprecated " + << "V0LayerParameter"; + } + LOG(ERROR) << "Note that future Caffe releases will not support " + << "V0NetParameter; use ./build/tools/upgrade_net_proto_text for " + << "prototxt and ./build/tools/upgrade_net_proto_binary for model " + << "weights upgrade this and any other net protos to the new format."; + } + // NetParameter uses old style data transformation fields; try to upgrade it. + if (NetNeedsDataUpgrade(*param)) { + LOG(ERROR) << "Attempting to upgrade input file specified using deprecated " + << "transformation parameters: " << param_file; + UpgradeNetDataTransformation(param); + LOG(INFO) << "Successfully upgraded file specified using deprecated " + << "data transformation parameters."; + LOG(ERROR) << "Note that future Caffe releases will only support " + << "transform_param messages for transformation fields."; + } + if (NetNeedsV1ToV2Upgrade(*param)) { + LOG(ERROR) << "Attempting to upgrade input file specified using deprecated " + << "V1LayerParameter: " << param_file; + NetParameter original_param(*param); + if (!UpgradeV1Net(original_param, param)) { + success = false; + LOG(ERROR) << "Warning: had one or more problems upgrading " + << "V1LayerParameter (see above); continuing anyway."; + } else { + LOG(INFO) << "Successfully upgraded file specified using deprecated " + << "V1LayerParameter"; + } + } + // NetParameter uses old style batch norm layers; try to upgrade it. + if (NetNeedsBatchNormUpgrade(*param)) { + LOG(INFO) << "Attempting to upgrade batch norm layers using deprecated " + << "params: " << param_file; + UpgradeNetBatchNorm(param); + LOG(INFO) << "Successfully upgraded batch norm layers using deprecated " + << "params."; + } + return success; +} + +bool UpgradeV1Net(const NetParameter& v1_net_param, NetParameter* net_param) { + bool is_fully_compatible = true; + if (v1_net_param.layer_size() > 0) { + LOG(ERROR) << "Input NetParameter to be upgraded already specifies 'layer' " + << "fields; these will be ignored for the upgrade."; + is_fully_compatible = false; + } + net_param->CopyFrom(v1_net_param); + net_param->clear_layers(); + net_param->clear_layer(); + for (int i = 0; i < v1_net_param.layers_size(); ++i) { + if (!UpgradeV1LayerParameter(v1_net_param.layers(i), + net_param->add_layer())) { + LOG(ERROR) << "Upgrade of input layer " << i << " failed."; + is_fully_compatible = false; + } + } + return is_fully_compatible; +} + +bool NetNeedsBatchNormUpgrade(const NetParameter& net_param) { + for (int i = 0; i < net_param.layer_size(); ++i) { + // Check if BatchNorm layers declare three parameters, as required by + // the previous BatchNorm layer definition. + if (net_param.layer(i).type() == "BatchNorm" + && net_param.layer(i).param_size() == 3) { + return true; + } + } + return false; +} + +void UpgradeNetBatchNorm(NetParameter* net_param) { + for (int i = 0; i < net_param->layer_size(); ++i) { + // Check if BatchNorm layers declare three parameters, as required by + // the previous BatchNorm layer definition. + if (net_param->layer(i).type() == "BatchNorm" + && net_param->layer(i).param_size() == 3) { + net_param->mutable_layer(i)->clear_param(); + } + } +} + +bool UpgradeV1LayerParameter(const V1LayerParameter& v1_layer_param, + LayerParameter* layer_param) { + layer_param->Clear(); + bool is_fully_compatible = true; + for (int i = 0; i < v1_layer_param.bottom_size(); ++i) { + layer_param->add_bottom(v1_layer_param.bottom(i)); + } + for (int i = 0; i < v1_layer_param.top_size(); ++i) { + layer_param->add_top(v1_layer_param.top(i)); + } + if (v1_layer_param.has_name()) { + layer_param->set_name(v1_layer_param.name()); + } + for (int i = 0; i < v1_layer_param.include_size(); ++i) { + layer_param->add_include()->CopyFrom(v1_layer_param.include(i)); + } + for (int i = 0; i < v1_layer_param.exclude_size(); ++i) { + layer_param->add_exclude()->CopyFrom(v1_layer_param.exclude(i)); + } + if (v1_layer_param.has_type()) { + layer_param->set_type(UpgradeV1LayerType(v1_layer_param.type())); + } + for (int i = 0; i < v1_layer_param.blobs_size(); ++i) { + layer_param->add_blobs()->CopyFrom(v1_layer_param.blobs(i)); + } + for (int i = 0; i < v1_layer_param.param_size(); ++i) { + while (layer_param->param_size() <= i) { layer_param->add_param(); } + layer_param->mutable_param(i)->set_name(v1_layer_param.param(i)); + } + ParamSpec_DimCheckMode mode; + for (int i = 0; i < v1_layer_param.blob_share_mode_size(); ++i) { + while (layer_param->param_size() <= i) { layer_param->add_param(); } + switch (v1_layer_param.blob_share_mode(i)) { + case V1LayerParameter_DimCheckMode_STRICT: + mode = ParamSpec_DimCheckMode_STRICT; + break; + case V1LayerParameter_DimCheckMode_PERMISSIVE: + mode = ParamSpec_DimCheckMode_PERMISSIVE; + break; + default: + LOG(FATAL) << "Unknown blob_share_mode: " + << v1_layer_param.blob_share_mode(i); + break; + } + layer_param->mutable_param(i)->set_share_mode(mode); + } + for (int i = 0; i < v1_layer_param.blobs_lr_size(); ++i) { + while (layer_param->param_size() <= i) { layer_param->add_param(); } + layer_param->mutable_param(i)->set_lr_mult(v1_layer_param.blobs_lr(i)); + } + for (int i = 0; i < v1_layer_param.weight_decay_size(); ++i) { + while (layer_param->param_size() <= i) { layer_param->add_param(); } + layer_param->mutable_param(i)->set_decay_mult( + v1_layer_param.weight_decay(i)); + } + for (int i = 0; i < v1_layer_param.loss_weight_size(); ++i) { + layer_param->add_loss_weight(v1_layer_param.loss_weight(i)); + } + if (v1_layer_param.has_accuracy_param()) { + layer_param->mutable_accuracy_param()->CopyFrom( + v1_layer_param.accuracy_param()); + } + if (v1_layer_param.has_argmax_param()) { + layer_param->mutable_argmax_param()->CopyFrom( + v1_layer_param.argmax_param()); + } + if (v1_layer_param.has_concat_param()) { + layer_param->mutable_concat_param()->CopyFrom( + v1_layer_param.concat_param()); + } + if (v1_layer_param.has_contrastive_loss_param()) { + layer_param->mutable_contrastive_loss_param()->CopyFrom( + v1_layer_param.contrastive_loss_param()); + } + if (v1_layer_param.has_convolution_param()) { + layer_param->mutable_convolution_param()->CopyFrom( + v1_layer_param.convolution_param()); + } + if (v1_layer_param.has_data_param()) { + layer_param->mutable_data_param()->CopyFrom( + v1_layer_param.data_param()); + } + if (v1_layer_param.has_dropout_param()) { + layer_param->mutable_dropout_param()->CopyFrom( + v1_layer_param.dropout_param()); + } + if (v1_layer_param.has_dummy_data_param()) { + layer_param->mutable_dummy_data_param()->CopyFrom( + v1_layer_param.dummy_data_param()); + } + if (v1_layer_param.has_eltwise_param()) { + layer_param->mutable_eltwise_param()->CopyFrom( + v1_layer_param.eltwise_param()); + } + if (v1_layer_param.has_exp_param()) { + layer_param->mutable_exp_param()->CopyFrom( + v1_layer_param.exp_param()); + } + if (v1_layer_param.has_hdf5_data_param()) { + layer_param->mutable_hdf5_data_param()->CopyFrom( + v1_layer_param.hdf5_data_param()); + } + if (v1_layer_param.has_hdf5_output_param()) { + layer_param->mutable_hdf5_output_param()->CopyFrom( + v1_layer_param.hdf5_output_param()); + } + if (v1_layer_param.has_hinge_loss_param()) { + layer_param->mutable_hinge_loss_param()->CopyFrom( + v1_layer_param.hinge_loss_param()); + } + if (v1_layer_param.has_image_data_param()) { + layer_param->mutable_image_data_param()->CopyFrom( + v1_layer_param.image_data_param()); + } + if (v1_layer_param.has_infogain_loss_param()) { + layer_param->mutable_infogain_loss_param()->CopyFrom( + v1_layer_param.infogain_loss_param()); + } + if (v1_layer_param.has_inner_product_param()) { + layer_param->mutable_inner_product_param()->CopyFrom( + v1_layer_param.inner_product_param()); + } + if (v1_layer_param.has_lrn_param()) { + layer_param->mutable_lrn_param()->CopyFrom( + v1_layer_param.lrn_param()); + } + if (v1_layer_param.has_memory_data_param()) { + layer_param->mutable_memory_data_param()->CopyFrom( + v1_layer_param.memory_data_param()); + } + if (v1_layer_param.has_mvn_param()) { + layer_param->mutable_mvn_param()->CopyFrom( + v1_layer_param.mvn_param()); + } + if (v1_layer_param.has_pooling_param()) { + layer_param->mutable_pooling_param()->CopyFrom( + v1_layer_param.pooling_param()); + } + if (v1_layer_param.has_power_param()) { + layer_param->mutable_power_param()->CopyFrom( + v1_layer_param.power_param()); + } + if (v1_layer_param.has_relu_param()) { + layer_param->mutable_relu_param()->CopyFrom( + v1_layer_param.relu_param()); + } + if (v1_layer_param.has_sigmoid_param()) { + layer_param->mutable_sigmoid_param()->CopyFrom( + v1_layer_param.sigmoid_param()); + } + if (v1_layer_param.has_softmax_param()) { + layer_param->mutable_softmax_param()->CopyFrom( + v1_layer_param.softmax_param()); + } + if (v1_layer_param.has_slice_param()) { + layer_param->mutable_slice_param()->CopyFrom( + v1_layer_param.slice_param()); + } + if (v1_layer_param.has_tanh_param()) { + layer_param->mutable_tanh_param()->CopyFrom( + v1_layer_param.tanh_param()); + } + if (v1_layer_param.has_threshold_param()) { + layer_param->mutable_threshold_param()->CopyFrom( + v1_layer_param.threshold_param()); + } + if (v1_layer_param.has_window_data_param()) { + layer_param->mutable_window_data_param()->CopyFrom( + v1_layer_param.window_data_param()); + } + if (v1_layer_param.has_transform_param()) { + layer_param->mutable_transform_param()->CopyFrom( + v1_layer_param.transform_param()); + } + if (v1_layer_param.has_loss_param()) { + layer_param->mutable_loss_param()->CopyFrom( + v1_layer_param.loss_param()); + } + if (v1_layer_param.has_layer()) { + LOG(ERROR) << "Input NetParameter has V0 layer -- ignoring."; + is_fully_compatible = false; + } + return is_fully_compatible; +} + +const char* UpgradeV1LayerType(const V1LayerParameter_LayerType type) { + switch (type) { + case V1LayerParameter_LayerType_NONE: + return ""; + case V1LayerParameter_LayerType_ABSVAL: + return "AbsVal"; + case V1LayerParameter_LayerType_ACCURACY: + return "Accuracy"; + case V1LayerParameter_LayerType_ARGMAX: + return "ArgMax"; + case V1LayerParameter_LayerType_BNLL: + return "BNLL"; + case V1LayerParameter_LayerType_CONCAT: + return "Concat"; + case V1LayerParameter_LayerType_CONTRASTIVE_LOSS: + return "ContrastiveLoss"; + case V1LayerParameter_LayerType_CONVOLUTION: + return "Convolution"; + case V1LayerParameter_LayerType_DECONVOLUTION: + return "Deconvolution"; + case V1LayerParameter_LayerType_DATA: + return "Data"; + case V1LayerParameter_LayerType_DROPOUT: + return "Dropout"; + case V1LayerParameter_LayerType_DUMMY_DATA: + return "DummyData"; + case V1LayerParameter_LayerType_EUCLIDEAN_LOSS: + return "EuclideanLoss"; + case V1LayerParameter_LayerType_ELTWISE: + return "Eltwise"; + case V1LayerParameter_LayerType_EXP: + return "Exp"; + case V1LayerParameter_LayerType_FLATTEN: + return "Flatten"; + case V1LayerParameter_LayerType_HDF5_DATA: + return "HDF5Data"; + case V1LayerParameter_LayerType_HDF5_OUTPUT: + return "HDF5Output"; + case V1LayerParameter_LayerType_HINGE_LOSS: + return "HingeLoss"; + case V1LayerParameter_LayerType_IM2COL: + return "Im2col"; + case V1LayerParameter_LayerType_IMAGE_DATA: + return "ImageData"; + case V1LayerParameter_LayerType_INFOGAIN_LOSS: + return "InfogainLoss"; + case V1LayerParameter_LayerType_INNER_PRODUCT: + return "InnerProduct"; + case V1LayerParameter_LayerType_LRN: + return "LRN"; + case V1LayerParameter_LayerType_MEMORY_DATA: + return "MemoryData"; + case V1LayerParameter_LayerType_MULTINOMIAL_LOGISTIC_LOSS: + return "MultinomialLogisticLoss"; + case V1LayerParameter_LayerType_MVN: + return "MVN"; + case V1LayerParameter_LayerType_POOLING: + return "Pooling"; + case V1LayerParameter_LayerType_POWER: + return "Power"; + case V1LayerParameter_LayerType_RELU: + return "ReLU"; + case V1LayerParameter_LayerType_SIGMOID: + return "Sigmoid"; + case V1LayerParameter_LayerType_SIGMOID_CROSS_ENTROPY_LOSS: + return "SigmoidCrossEntropyLoss"; + case V1LayerParameter_LayerType_SILENCE: + return "Silence"; + case V1LayerParameter_LayerType_SOFTMAX: + return "Softmax"; + case V1LayerParameter_LayerType_SOFTMAX_LOSS: + return "SoftmaxWithLoss"; + case V1LayerParameter_LayerType_SPLIT: + return "Split"; + case V1LayerParameter_LayerType_SLICE: + return "Slice"; + case V1LayerParameter_LayerType_TANH: + return "TanH"; + case V1LayerParameter_LayerType_WINDOW_DATA: + return "WindowData"; + case V1LayerParameter_LayerType_THRESHOLD: + return "Threshold"; + default: + LOG(FATAL) << "Unknown V1LayerParameter layer type: " << type; + return ""; + } +} + +const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 byte. + +bool ReadProtoFromTextFile(const char* filename, Message* proto) { + std::ifstream fs(filename, std::ifstream::in); + CHECK(fs.is_open()) << "Can't open \"" << filename << "\""; + IstreamInputStream input(&fs); + bool success = google::protobuf::TextFormat::Parse(&input, proto); + fs.close(); + return success; +} + +bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { + std::ifstream fs(filename, std::ifstream::in | std::ifstream::binary); + CHECK(fs.is_open()) << "Can't open \"" << filename << "\""; + ZeroCopyInputStream* raw_input = new IstreamInputStream(&fs); + CodedInputStream* coded_input = new CodedInputStream(raw_input); + coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); + + bool success = proto->ParseFromCodedStream(coded_input); + + delete coded_input; + delete raw_input; + fs.close(); + return success; +} + +void ReadNetParamsFromTextFileOrDie(const char* param_file, + NetParameter* param) { + CHECK(ReadProtoFromTextFile(param_file, param)) + << "Failed to parse NetParameter file: " << param_file; + UpgradeNetAsNeeded(param_file, param); +} + +void ReadNetParamsFromBinaryFileOrDie(const char* param_file, + NetParameter* param) { + CHECK(ReadProtoFromBinaryFile(param_file, param)) + << "Failed to parse NetParameter file: " << param_file; + UpgradeNetAsNeeded(param_file, param); +} + +} +} +#endif diff --git a/modules/dnn/src/caffe/caffe_io.hpp b/modules/dnn/src/caffe/caffe_io.hpp new file mode 100644 index 0000000000..fa16612890 --- /dev/null +++ b/modules/dnn/src/caffe/caffe_io.hpp @@ -0,0 +1,108 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +/*M/////////////////////////////////////////////////////////////////////////////////////// +//COPYRIGHT +// +//All contributions by the University of California: +//Copyright (c) 2014, The Regents of the University of California (Regents) +//All rights reserved. +// +//All other contributions: +//Copyright (c) 2014, the respective contributors +//All rights reserved. +// +//Caffe uses a shared copyright model: each contributor holds copyright over +//their contributions to Caffe. The project versioning records all such +//contribution and copyright details. If a contributor wants to further mark +//their specific copyright on a particular contribution, they should indicate +//their copyright solely in the commit message of the change when it is +//committed. +// +//LICENSE +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions are met: +// +//1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +//2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +//DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +//ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +//ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +//(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//CONTRIBUTION AGREEMENT +// +//By contributing to the BVLC/caffe repository through pull-request, comment, +//or otherwise, the contributor releases their content to the +//license and copyright terms herein. +// +//M*/ + +#ifndef __OPENCV_DNN_CAFFE_IO_HPP__ +#define __OPENCV_DNN_CAFFE_IO_HPP__ +#if HAVE_PROTOBUF + +#include "caffe.pb.h" + +namespace cv { +namespace dnn { + +// Read parameters from a file into a NetParameter proto message. +void ReadNetParamsFromTextFileOrDie(const char* param_file, + caffe::NetParameter* param); +void ReadNetParamsFromBinaryFileOrDie(const char* param_file, + caffe::NetParameter* param); + +} +} +#endif +#endif diff --git a/modules/dnn/src/caffe/glog_emulator.hpp b/modules/dnn/src/caffe/glog_emulator.hpp new file mode 100644 index 0000000000..5f674e4150 --- /dev/null +++ b/modules/dnn/src/caffe/glog_emulator.hpp @@ -0,0 +1,104 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_CAFFE_GLOG_EMULATOR_HPP__ +#define __OPENCV_DNN_CAFFE_GLOG_EMULATOR_HPP__ +#include +#include +#include +#include + +#define CHECK(cond) for(cv::dnn::GLogWrapper _logger(__FILE__, CV_Func, __LINE__, "CHECK", #cond, cond); _logger.exit(); _logger.check()) _logger.stream() +#define CHECK_EQ(a, b) for(cv::dnn::GLogWrapper _logger(__FILE__, CV_Func, __LINE__, "CHECK", #a"="#b, ((a) == (b))); _logger.exit(); _logger.check()) _logger.stream() +#define LOG(TYPE) for(cv::dnn::GLogWrapper _logger(__FILE__, CV_Func, __LINE__, #TYPE); _logger.exit(); _logger.check()) _logger.stream() + +namespace cv +{ +namespace dnn +{ + +class GLogWrapper +{ + const char *file, *func, *type, *cond_str; + int line; + bool cond_staus, exit_loop; + std::stringstream sstream; + +public: + + GLogWrapper(const char *_file, const char *_func, int _line, + const char *_type, + const char *_cond_str = NULL, bool _cond_status = true + ) : + file(_file), func(_func), type(_type), cond_str(_cond_str), + line(_line), cond_staus(_cond_status), exit_loop(true) {} + + std::iostream &stream() + { + return sstream; + } + + bool exit() + { + return exit_loop; + } + + void check() + { + exit_loop = false; + + if (cond_str && !cond_staus) + { + cv::error(cv::Error::StsError, "FAILED: " + String(cond_str) + ". " + sstream.str(), func, file, line); + } + else if (!cond_str && strcmp(type, "CHECK")) + { + if (!std::strcmp(type, "INFO")) + std::cout << sstream.str() << std::endl; + else + std::cerr << sstream.str() << std::endl; + } + } +}; + +} +} +#endif diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp new file mode 100644 index 0000000000..4e54808177 --- /dev/null +++ b/modules/dnn/src/dnn.cpp @@ -0,0 +1,2001 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "precomp.hpp" +#include "op_halide.hpp" +#include "halide_scheduler.hpp" +#include +#include +#include +#include +#include +#include +#include + +using namespace cv; +using namespace cv::dnn; + +using std::vector; +using std::map; +using std::make_pair; +using std::set; + +namespace +{ + typedef std::vector ShapesVec; + + struct LayerShapes + { + ShapesVec in, out, internal; + // No guarantees that layer which support in-place computations + // will be computed in-place (input.data_ptr == output.data_ptr). + // If layer said that it could work in-place and layers after it + // no longer use input blob, we'll set output = input. + bool supportInPlace; + LayerShapes() {supportInPlace = false;} + }; +} + +namespace cv +{ +namespace dnn +{ + +template +static String toString(const T &v) +{ + std::ostringstream ss; + ss << v; + return ss.str(); +} + +Mat blobFromImage(const Mat& image, double scalefactor, const Size& size, + const Scalar& mean, bool swapRB) +{ + std::vector images(1, image); + return blobFromImages(images, scalefactor, size, mean, swapRB); +} + +Mat blobFromImages(const std::vector& images_, double scalefactor, Size size, + const Scalar& mean_, bool swapRB) +{ + std::vector images = images_; + for (int i = 0; i < images.size(); i++) + { + Size imgSize = images[i].size(); + if (size == Size()) + size = imgSize; + if (size != imgSize) + { + float resizeFactor = std::max(size.width / (float)imgSize.width, + size.height / (float)imgSize.height); + resize(images[i], images[i], Size(), resizeFactor, resizeFactor); + Rect crop(Point(0.5 * (images[i].cols - size.width), + 0.5 * (images[i].rows - size.height)), + size); + images[i] = images[i](crop); + } + if(images[i].depth() == CV_8U) + images[i].convertTo(images[i], CV_32F); + Scalar mean = mean_; + if (swapRB) + std::swap(mean[0], mean[2]); + + images[i] -= mean; + images[i] *= scalefactor; + } + + size_t i, nimages = images.size(); + if(nimages == 0) + return Mat(); + Mat image0 = images[0]; + int nch = image0.channels(); + CV_Assert(image0.dims == 2); + Mat blob, image; + if (nch == 3 || nch == 4) + { + int sz[] = { (int)nimages, 3, image0.rows, image0.cols }; + blob = Mat(4, sz, CV_32F); + Mat ch[4]; + + for( i = 0; i < nimages; i++ ) + { + image = images[i]; + CV_Assert(image.depth() == CV_32F); + nch = image.channels(); + CV_Assert(image.dims == 2 && (nch == 3 || nch == 4)); + CV_Assert(image.size() == image0.size()); + + for( int j = 0; j < 3; j++ ) + ch[j] = Mat(image.rows, image.cols, CV_32F, blob.ptr((int)i, j)); + if(swapRB) + std::swap(ch[0], ch[2]); + split(image, ch); + } + } + else + { + CV_Assert(nch == 1); + int sz[] = { (int)nimages, 1, image0.rows, image0.cols }; + blob = Mat(4, sz, CV_32F); + + for( i = 0; i < nimages; i++ ) + { + Mat image = images[i]; + CV_Assert(image.depth() == CV_32F); + nch = image.channels(); + CV_Assert(image.dims == 2 && (nch == 1)); + CV_Assert(image.size() == image0.size()); + + image.copyTo(Mat(image.rows, image.cols, CV_32F, blob.ptr((int)i, 0))); + } + } + return blob; +} + +struct LayerPin +{ + int lid; + int oid; + + LayerPin(int layerId = -1, int outputId = -1) + : lid(layerId), oid(outputId) {} + + bool valid() const + { + return (lid >= 0 && oid >= 0); + } + + bool equal(const LayerPin &r) const + { + return (lid == r.lid && oid == r.oid); + } + + bool operator<(const LayerPin &r) const + { + return lid < r.lid || lid == r.lid && oid < r.oid; + } + + bool operator ==(const LayerPin &r) const + { + return lid == r.lid && oid == r.oid; + } +}; + +// Objects of this class manages wrappers. For every CPU memory pointer and shape +// one and only wrapper. Now it support wrapping for single backend and target. +class BackendWrapManager +{ +public: + Ptr wrap(const Mat& m, int backendId, int targetId) + { + CV_Assert(backendId != DNN_BACKEND_DEFAULT); + + std::map >::iterator hostsIt; + // Check that the same CPU memory was previously wrapped. + hostsIt = hostWrappers.find(m.data); + if (hostsIt == hostWrappers.end()) + { + // If not wrapped before. + return (hostWrappers[m.data] = wrapHost(m, backendId, targetId)); + } + else + { + // Find if wrapper of this host and shape was created before. + std::map, Ptr >::iterator it; + std::pair key(m.data, m.size); + it = extraWrappers.find(key); + if (it == extraWrappers.end()) + { + MatShape shape(m.dims); + for (int i = 0; i < m.dims; ++i) + shape[i] = m.size.p[i]; + return (extraWrappers[key] = wrapUser(hostsIt->second, shape)); + } + else + return it->second; + } + } + + std::vector > wrap(const std::vector& mats, + int backendId, int targetId) + { + const int num = mats.size(); + std::vector > dst(num); + for (int i = 0; i < num; ++i) + { + dst[i] = wrap(*mats[i], backendId, targetId); + } + return dst; + } + + std::vector > wrap(const std::vector& mats, + int backendId, int targetId) + { + const int num = mats.size(); + std::vector > dst(num); + for (int i = 0; i < num; ++i) + { + dst[i] = wrap(mats[i], backendId, targetId); + } + return dst; + } + + void reset() + { + hostWrappers.clear(); + extraWrappers.clear(); + } + +private: + // Backend-specific wrapping function. + Ptr wrapHost(const Mat& m, int backendId, int targetId) + { + if (backendId == DNN_BACKEND_DEFAULT) + { + return Ptr(); + } + else if (backendId == DNN_BACKEND_HALIDE) + { + CV_Assert(haveHalide()); +#ifdef HAVE_HALIDE + return Ptr(new HalideBackendWrapper(targetId, m)); +#endif // HAVE_HALIDE + } + else + { + CV_Error(Error::StsNotImplemented, "Unknown backend identifier"); + } + return Ptr(); + } + + // Backend-specific wrapping function. + Ptr wrapUser(const Ptr& host, const MatShape& shape) + { + int backendId = host->backendId; + if (backendId == DNN_BACKEND_DEFAULT) + { + return Ptr(); + } + else if (backendId == DNN_BACKEND_HALIDE) + { + CV_Assert(haveHalide()); +#ifdef HAVE_HALIDE + return Ptr(new HalideBackendWrapper(host, shape)); +#endif // HAVE_HALIDE + } + else + { + CV_Error(Error::StsNotImplemented, "Unknown backend identifier"); + } + return Ptr(); + } + + // Wrappers that initialized for memory hosts (first wrapping of CPU data). + std::map > hostWrappers; + // The rest of wrappers. They initialized for non-host cv::Mat. + std::map, Ptr > extraWrappers; +}; + +struct LayerData +{ + LayerData() {} + LayerData(int _id, const String &_name, const String &_type, LayerParams &_params) + : id(_id), name(_name), type(_type), params(_params) + { + //add logging info + params.name = name; + params.type = type; + } + + int id; + String name; + String type; + LayerParams params; + + std::vector inputBlobsId; + std::set inputLayersId; + std::set requiredOutputs; + std::vector consumers; + + Ptr layerInstance; + std::vector outputBlobs; + std::vector inputBlobs; + std::vector internals; + // Computation nodes of implemented backends (except DEFAULT). + std::map > backendNodes; + // Flag for skip layer computation for specific backend. + std::map skipFlags; + + int flag; + + Ptr getLayerInstance() + { + if (layerInstance) + return layerInstance; + + layerInstance = LayerFactory::createLayerInstance(type, params); + if (!layerInstance) + { + CV_Error(Error::StsError, "Can't create layer \"" + name + "\" of type \"" + type + "\""); + } + + return layerInstance; + } +}; + +//fake layer containing network input blobs +struct DataLayer : public Layer +{ + void finalize(const std::vector&, std::vector&) {} + void forward(std::vector&, std::vector&, std::vector &) {} + + int outputNameToIndex(String tgtName) + { + int idx = (int)(std::find(outNames.begin(), outNames.end(), tgtName) - outNames.begin()); + return (idx < (int)outNames.size()) ? idx : -1; + } + + void setNames(const std::vector &names) + { + outNames.assign(names.begin(), names.end()); + } + +private: + std::vector outNames; +}; + +struct BlobManager +{ +public: + // Increase references counter to layer output. + void addReference(const LayerPin& lp) + { + std::map::iterator it = refCounter.find(lp); + if (it == refCounter.end()) + refCounter[lp] = 1; + else + it->second += 1; + } + + void addReferences(const std::vector& pins) + { + for (int i = 0; i < pins.size(); i++) + { + addReference(pins[i]); + } + } + + // Returns number of references to allocated memory that used in specific + // layer blob. + int numReferences(const LayerPin& lp) + { + std::map::iterator mapIt = reuseMap.find(lp); + CV_Assert(mapIt != reuseMap.end()); + LayerPin memHost = mapIt->second; + + std::map::iterator refIt = refCounter.find(memHost); + CV_Assert(refIt != refCounter.end()); + return refIt->second; + } + + // Reuse data allocated in inside the blob. + void reuse(const LayerPin& host, const LayerPin& user) + { + CV_Assert(reuseMap.find(user) == reuseMap.end()); + CV_Assert(reuseMap.find(host) != reuseMap.end()); + LayerPin memHost = reuseMap[host]; + reuseMap[user] = memHost; + if (refCounter.find(memHost) != refCounter.end()) + { + std::map::iterator userRefIt = refCounter.find(user); + if (userRefIt != refCounter.end()) + { + refCounter[memHost] += userRefIt->second; + refCounter.erase(userRefIt); + } + else + refCounter[memHost] += 1; + } + } + + // Decrease references counter to allocated memory inside specific blob. + void releaseReference(const LayerPin& lp) + { + std::map::iterator mapIt = reuseMap.find(lp); + CV_Assert(mapIt != reuseMap.end()); + + std::map::iterator refIt = refCounter.find(mapIt->second); + CV_Assert(refIt != refCounter.end()); + CV_Assert(refIt->second > 0); + refIt->second -= 1; + } + + void releaseReferences(const std::vector& pins) + { + for (int i = 0; i < pins.size(); i++) + { + releaseReference(pins[i]); + } + } + + void reuseOrCreate(const MatShape& shape, const LayerPin& lp, Mat& dst) + { + std::map::iterator hostIt; + std::map::iterator refIt; + + const int targetTotal = total(shape); + Mat bestBlob; + int bestBlobTotal = INT_MAX; + LayerPin bestBlobPin; + for (hostIt = memHosts.begin(); hostIt != memHosts.end(); ++hostIt) + { + refIt = refCounter.find(hostIt->first); + // Use only blobs that had references before because if not, + // it might be used as output. + if (refIt != refCounter.end() && refIt->second == 0) + { + Mat& unusedBlob = hostIt->second; + if (unusedBlob.total() >= targetTotal && + unusedBlob.total() < bestBlobTotal) + { + bestBlobPin = hostIt->first; + bestBlob = unusedBlob; + bestBlobTotal = unusedBlob.total(); + } + } + } + if (!bestBlob.empty()) + { + reuse(bestBlobPin, lp); + dst = Mat(shape, CV_32F, bestBlob.data); + } + else + { + // if dst already has been allocated with total(shape) elements, + // it won't be recrreated and pointer of dst.data remains the same. + dst.create(shape, CV_32F); + addHost(lp, dst); + } + } + + void allocateBlobsForLayer(LayerData &ld, const LayerShapes& layerShapes, + std::vector& pinsForInternalBlobs) + { + pinsForInternalBlobs.clear(); + + std::vector& outputBlobs = ld.outputBlobs, + &internalBlobs = ld.internals; + + const ShapesVec& outShapes = layerShapes.out, + internalShapes = layerShapes.internal; + + outputBlobs.resize(std::max((size_t)1, outShapes.size())); //layer produce at least one output blob + internalBlobs.resize(internalShapes.size()); + + CV_Assert(ld.requiredOutputs.size() <= outShapes.size()); + + // Check that layer could work in-place. + bool inPlace = false; + if (layerShapes.supportInPlace) + { + if (ld.inputBlobs.size() == 1) + { + // Get number of references to the input memory. + int numRef = numReferences(ld.inputBlobsId[0]); + // If current layer is one and only customer of this blob. + inPlace = numRef == 1; + } + } + + ShapesVec shapes(outShapes); + shapes.insert(shapes.end(), internalShapes.begin(), internalShapes.end()); + std::vector blobs; + for(int i = 0; i < outputBlobs.size(); i++) + { + blobs.push_back(&outputBlobs[i]); + } + + for(int i = 0; i < internalBlobs.size(); i++) + { + blobs.push_back(&internalBlobs[i]); + if (total(internalShapes[i])) + { + pinsForInternalBlobs.push_back(LayerPin(ld.id, ld.outputBlobs.size() + i)); + } + } + + addReferences(pinsForInternalBlobs); + + std::map > idxSizes; + for(int i = 0; i < shapes.size(); i++) + { + idxSizes[total(shapes[i])].push_back(i); + } + + std::map >::reverse_iterator it; + for(it = idxSizes.rbegin(); it != idxSizes.rend(); it++) + { + for(int j = 0; j < it->second.size(); j++) + { + int index = it->second[j]; + if (total(shapes[index])) + { + LayerPin blobPin(ld.id, index); + if (index < outShapes.size() && inPlace) + { + CV_Assert(ld.inputBlobs[0]->total() == total(shapes[index])); + ld.outputBlobs[index] = ld.inputBlobs[0]->reshape(1, shapes[index]); + reuse(ld.inputBlobsId[0], blobPin); + } + else + { + reuseOrCreate(shapes[index], blobPin, *blobs[index]); + } + } + } + } + } + + // Clear internal state. Calls before an every reallocation. + void reset() + { + refCounter.clear(); + reuseMap.clear(); + memHosts.clear(); + } + +private: + // Register allocated memory. + void addHost(const LayerPin& lp, const Mat& mat) + { + CV_Assert(memHosts.find(lp) == memHosts.end()); + reuseMap[lp] = lp; + memHosts[lp] = mat; + } + + std::map refCounter; + // Maps pin to origin blob (for whom memory was allocated firstly). + // For origin blobs key == value. + std::map reuseMap; + std::map memHosts; +}; + +struct Net::Impl +{ + typedef std::map LayersShapesMap; + typedef std::map MapIdToLayerData; + + Impl() + { + //allocate fake net input layer + netInputLayer = Ptr(new DataLayer()); + LayerData &inpl = layers.insert( make_pair(0, LayerData()) ).first->second; + inpl.id = 0; + inpl.name = "_input"; + inpl.type = "__NetInputLayer__"; + inpl.layerInstance = netInputLayer; + layerNameToId.insert(std::make_pair(inpl.name, inpl.id)); + + lastLayerId = 1; + netWasAllocated = false; + preferableBackend = DNN_BACKEND_DEFAULT; + preferableTarget = DNN_TARGET_CPU; + } + + Ptr netInputLayer; + std::vector netOutputs; + std::vector blobsToKeep; + MapIdToLayerData layers; + std::map layerNameToId; + BlobManager blobManager; + int preferableBackend; + int preferableTarget; + String halideConfigFile; + // Backend-specific wrapping manager. + BackendWrapManager backendWrapper; + + int lastLayerId; + + bool netWasAllocated; + + void compileHalide() + { + CV_Assert(preferableBackend == DNN_BACKEND_HALIDE); + + HalideScheduler scheduler(halideConfigFile); + MapIdToLayerData::iterator it; + for (it = layers.begin(); it != layers.end(); ++it) + { + LayerData &ld = it->second; + Ptr layer = ld.layerInstance; + if (layer->supportBackend(DNN_BACKEND_HALIDE) && !ld.skipFlags[DNN_BACKEND_HALIDE]) + { + CV_Assert(!ld.backendNodes[DNN_BACKEND_HALIDE].empty()); + bool scheduled = scheduler.process(ld.backendNodes[DNN_BACKEND_HALIDE]); + if (!scheduled) + { + // Use automatic scheduling provided by layer. + layer->applyHalideScheduler(ld.backendNodes[DNN_BACKEND_HALIDE], + ld.inputBlobs, ld.outputBlobs, + preferableTarget); + } + dnn::compileHalide(ld.outputBlobs, ld.backendNodes[DNN_BACKEND_HALIDE], + preferableTarget); + } + } + } + + void clear() + { + MapIdToLayerData::iterator it; + for (it = layers.begin(); it != layers.end(); it++) + { + if (it->second.id != 0) { + it->second.outputBlobs.clear(); + it->second.internals.clear(); + } + it->second.skipFlags.clear(); + it->second.consumers.clear(); + Ptr convLayer = it->second.layerInstance.dynamicCast(); + + if( !convLayer.empty() ) + { + convLayer->setActivation(Ptr()); + convLayer->setBatchNorm(Ptr()); + } + + Ptr poolingLayer = it->second.layerInstance.dynamicCast(); + if( !poolingLayer.empty() ) + { + poolingLayer->computeMaxIdx = true; + } + } + } + + + void setUpNet(const std::vector& blobsToKeep_ = std::vector()) + { + if (!netWasAllocated || this->blobsToKeep != blobsToKeep_) + { + clear(); + + allocateLayers(blobsToKeep_); + computeNetOutputLayers(); + initBackend(); + + if (!netWasAllocated ) + { + // If user didn't call compileHalide() between + // setPreferableBackend(DNN_BACKEND_HALIDE) and forward(). + if (preferableBackend == DNN_BACKEND_HALIDE) + compileHalide(); + } + + netWasAllocated = true; + this->blobsToKeep = blobsToKeep_; + } + } + + int getLayerId(const String &layerName) + { + std::map::iterator it = layerNameToId.find(layerName); + return (it != layerNameToId.end()) ? it->second : -1; + } + + int getLayerId(int id) + { + MapIdToLayerData::iterator it = layers.find(id); + return (it != layers.end()) ? id : -1; + } + + int getLayerId(DictValue &layerDesc) + { + if (layerDesc.isInt()) + return getLayerId(layerDesc.get()); + else if (layerDesc.isString()) + return getLayerId(layerDesc.get()); + + CV_Assert(layerDesc.isInt() || layerDesc.isString()); + return -1; + } + + String getLayerName(int id) + { + MapIdToLayerData::iterator it = layers.find(id); + return (it != layers.end()) ? it->second.name : "(unknown layer)"; + } + + LayerData& getLayerData(int id) + { + MapIdToLayerData::iterator it = layers.find(id); + + if (it == layers.end()) + CV_Error(Error::StsObjectNotFound, format("Layer with requested id=%d not found", id)); + + return it->second; + } + + LayerData& getLayerData(const String &layerName) + { + int id = getLayerId(layerName); + + if (id < 0) + CV_Error(Error::StsError, "Requsted layer \"" + layerName + "\" not found"); + + return getLayerData(id); + } + + LayerData& getLayerData(const DictValue &layerDesc) + { + if (layerDesc.isInt()) + return getLayerData(layerDesc.get()); + else if (layerDesc.isString()) + return getLayerData(layerDesc.get()); + + CV_Assert(layerDesc.isInt() || layerDesc.isString()); + return *((LayerData*)NULL); + } + + static void addLayerInput(LayerData &ld, int inNum, LayerPin from) + { + if ((int)ld.inputBlobsId.size() <= inNum) + { + ld.inputBlobsId.resize(inNum + 1); + } + else + { + LayerPin storedFrom = ld.inputBlobsId[inNum]; + if (storedFrom.valid() && !storedFrom.equal(from)) + CV_Error(Error::StsError, "Input #" + toString(inNum) + "of layer \"" + ld.name + "\" already was connected"); + } + + ld.inputBlobsId[inNum] = from; + } + + static void splitPin(const String &pinAlias, String &layerName, String &outName) + { + size_t delimPos = pinAlias.find('.'); + layerName = pinAlias.substr(0, delimPos); + outName = (delimPos == String::npos) ? String() : pinAlias.substr(delimPos + 1); + } + + int resolvePinOutputName(LayerData &ld, const String &outName) + { + if (outName.empty()) + return 0; + + if (std::isdigit(outName[0])) + { + char *lastChar; + long inum = std::strtol(outName.c_str(), &lastChar, 10); + + if (*lastChar == 0) + { + CV_Assert(inum == (int)inum); + return (int)inum; + } + } + + return ld.getLayerInstance()->outputNameToIndex(outName); + } + + LayerPin getPinByAlias(const String &pinAlias) + { + LayerPin pin; + String layerName, outName; + splitPin(pinAlias, layerName, outName); + + pin.lid = (layerName.empty()) ? 0 : getLayerId(layerName); + + if (pin.lid >= 0) + pin.oid = resolvePinOutputName(getLayerData(pin.lid), outName); + + return pin; + } + + std::vector getLayerOutPins(const String &pinAlias) + { + String layerName, outName; + splitPin(pinAlias, layerName, outName); + + int lid = (layerName.empty()) ? 0 : getLayerId(layerName); + + std::vector pins; + + for (int i = 0; i < layers[lid].outputBlobs.size(); i++) + { + pins.push_back(LayerPin(lid, i)); + } + + return pins; + } + + void connect(int outLayerId, int outNum, int inLayerId, int inNum) + { + CV_Assert(outLayerId < inLayerId); + LayerData &ldOut = getLayerData(outLayerId); + LayerData &ldInp = getLayerData(inLayerId); + + addLayerInput(ldInp, inNum, LayerPin(outLayerId, outNum)); + ldOut.requiredOutputs.insert(outNum); + ldOut.consumers.push_back(LayerPin(inLayerId, outNum)); + } + + void computeNetOutputLayers() + { + netOutputs.clear(); + + MapIdToLayerData::iterator it; + for (it = layers.begin(); it != layers.end(); it++) + { + int lid = it->first; + LayerData &ld = it->second; + + if (ld.requiredOutputs.size() == 0) + netOutputs.push_back(lid); + } + + #ifndef NDEBUG + std::cout << "\nNet Outputs(" << netOutputs.size() << "):\n"; + for (size_t i = 0; i < netOutputs.size(); i++) + std::cout << layers[netOutputs[i]].name << "\n"; + #endif + } + + void initBackend() + { + backendWrapper.reset(); + if (preferableBackend == DNN_BACKEND_DEFAULT) + { + CV_Assert(preferableTarget == DNN_TARGET_CPU); + return; + } + + // Iterator to current layer. + MapIdToLayerData::iterator it = layers.begin(); + // Iterator to base layer for fusion. In example, in case of conv+bn+relu + // it'll be a conv layer. + MapIdToLayerData::iterator baseIt = layers.begin(); + for (; it != layers.end(); it++) + { + LayerData &ldTop = it->second; + Ptr layerTop = ldTop.layerInstance; + if (!layerTop->supportBackend(preferableBackend)) + { + // Move base iterator to layer that don't support preferable + // backend to prevent fusion over layer of different backend. + baseIt = it; + continue; + } + // Try to do layers fusion. + LayerData &ldBot = baseIt->second; + Ptr layerBot = ldBot.layerInstance; + // 1. Check that bottom and top from the same backends. + if (it != layers.begin() && layerBot->supportBackend(preferableBackend)) + { + // 2. Check that current layer works in-place. + bool inPlace = ldTop.inputBlobs.size() == 1 && + ldBot.outputBlobs.size() == 1 && + ldTop.inputBlobs[0]->data == + ldBot.outputBlobs[0].data; + if (inPlace) + { + // 3. Try to attach node. + CV_Assert(!ldBot.backendNodes[preferableBackend].empty()); + Ptr fusedNode = + layerTop->tryAttach(ldBot.backendNodes[preferableBackend]); + if (!fusedNode.empty()) + { + ldTop.skipFlags[preferableBackend] = true; + ldBot.backendNodes[preferableBackend] = fusedNode; + continue; + } + } + } + // No layers fusion. + ldTop.skipFlags[preferableBackend] = false; + std::vector > inputs = + backendWrapper.wrap(ldTop.inputBlobs, preferableBackend, + preferableTarget); + if (preferableBackend == DNN_BACKEND_HALIDE) + { + ldTop.backendNodes[DNN_BACKEND_HALIDE] = layerTop->initHalide(inputs); + baseIt = it; + } + else + { + CV_Error(Error::StsNotImplemented, "Unknown backend identifier"); + } + } + } + + #define CV_RETHROW_ERROR(err, newmsg)\ + cv::error(err.code, newmsg, err.func.c_str(), err.file.c_str(), err.line) + + void allocateLayer(int lid, const LayersShapesMap& layersShapes) + { + LayerData &ld = layers[lid]; + + //already allocated + if (ld.flag) + return; + + size_t ninputs = ld.inputBlobsId.size(); +#if 0 + printf("layer %s:", ld.name.c_str()); + for (size_t i = 0; i < ninputs; i++) + { + int inp_lid = ld.inputBlobsId[i].lid; + LayerData &inp_ld = layers[inp_lid]; + int inp_outputs = (int)inp_ld.outputBlobs.size(); + std::cout << " " << inp_ld.name << "(" << inp_outputs; + + for( int j = 0; j < inp_outputs; j++ ) + { + std::cout << (j == 0 ? ": " : ", ") << inp_ld.outputBlobs[j].size; + } + std::cout << ")"; + } + printf("\n"); +#endif + + //determine parent layers + for (size_t i = 0; i < ninputs; i++) + ld.inputLayersId.insert(ld.inputBlobsId[i].lid); + + //allocate parents + for (set::iterator i = ld.inputLayersId.begin(); i != ld.inputLayersId.end(); i++) + allocateLayer(*i, layersShapes); + + //bind inputs + ld.inputBlobs.resize(ninputs); + for (size_t i = 0; i < ninputs; i++) + { + LayerPin from = ld.inputBlobsId[i]; + CV_Assert(from.valid()); + CV_DbgAssert(layers.count(from.lid) && (int)layers[from.lid].outputBlobs.size() > from.oid); + ld.inputBlobs[i] = &layers[from.lid].outputBlobs[from.oid]; + } + + LayersShapesMap::const_iterator layerShapesIt = layersShapes.find(lid); + + CV_Assert(layerShapesIt != layersShapes.end()); + + std::vector pinsForInternalBlobs; + blobManager.allocateBlobsForLayer(ld, layerShapesIt->second, pinsForInternalBlobs); + + Ptr layerPtr = ld.getLayerInstance(); + { + layerPtr->finalize(ld.inputBlobs, ld.outputBlobs); +#if 0 + std::cout << "\toutputs:"; + size_t noutputs = ld.outputBlobs.size(); + for (size_t j = 0; j < noutputs; j++) + { + std::cout << (j == 0 ? " " : ", ") << ld.outputBlobs[j].size; + } + std::cout << "\n"; +#endif + } + + // After allocation of layer, we decrease counters to it's input blobs. + blobManager.releaseReferences(ld.inputBlobsId); + blobManager.releaseReferences(pinsForInternalBlobs); + + ld.flag = 1; + } + + void fuseLayers(const std::vector& blobsToKeep_) + { + // scan through all the layers. If there is convolution layer followed by the activation layer, + // we try to embed this activation into the convolution and disable separate execution of the activation + std::vector outnames; + std::set pinsToKeep(blobsToKeep_.begin(), + blobsToKeep_.end()); + MapIdToLayerData::iterator it; + for (it = layers.begin(); it != layers.end(); it++) + { + int lid = it->first; + LayerData& ld = layers[lid]; + if( ld.skipFlags[DNN_BACKEND_DEFAULT] ) + { + continue; + } + if( ld.consumers.size() == 0 ) + outnames.push_back(ld.layerInstance->name); + Ptr convLayer = ld.layerInstance.dynamicCast(); + LayerPin lp(lid, 0); + if( !convLayer.empty() && ld.consumers.size() == 1 && + pinsToKeep.count(lp) == 0 ) + { + LayerData* nextData = &layers[ld.consumers[0].lid]; + Ptr nextBNormLayer = + nextData->layerInstance.dynamicCast(); + LayerPin lpNext(ld.consumers[0].lid, 0); + if( !nextBNormLayer.empty() && pinsToKeep.count(lpNext) == 0 ) + { + LayerData* bnormData = nextData; + nextData = 0; + if( convLayer->setBatchNorm(nextBNormLayer) ) + { + bnormData->skipFlags[DNN_BACKEND_DEFAULT] = true; + ld.outputBlobs = layers[lpNext.lid].outputBlobs; + if( bnormData->consumers.size() == 1 ) + nextData = &layers[bnormData->consumers[0].lid]; + } + } + + Ptr nextActivLayer; + if( nextData ) + nextActivLayer = nextData->layerInstance.dynamicCast(); + + if( !nextActivLayer.empty() && convLayer->setActivation(nextActivLayer) ) + { + nextData->skipFlags[DNN_BACKEND_DEFAULT] = true; + ld.outputBlobs = layers[lpNext.lid].outputBlobs; + } + } + Ptr poolingLayer = ld.layerInstance.dynamicCast(); + if( !poolingLayer.empty() && !ld.consumers.empty() ) + { + size_t i = 0, nconsumers = ld.consumers.size(); + for( ; i < nconsumers; i++ ) + if( ld.consumers[i].oid > 0 ) + break; + // if there is no layer that takes the second output pin of the pooling layer + // on input then we don't need to compute the indices + if( i >= nconsumers ) + poolingLayer->computeMaxIdx = false; + } + } + } + + void allocateLayers(const std::vector& blobsToKeep_) + { + MapIdToLayerData::iterator it; + for (it = layers.begin(); it != layers.end(); it++) + it->second.flag = 0; + + CV_Assert(!layers[0].outputBlobs.empty()); + ShapesVec inputShapes; + for(int i = 0; i < layers[0].outputBlobs.size(); i++) + { + CV_Assert(layers[0].outputBlobs[i].total()); + inputShapes.push_back(shape(layers[0].outputBlobs[i])); + } + LayersShapesMap layersShapes; + getLayersShapes(inputShapes, layersShapes); + + blobManager.reset(); + for (it = layers.begin(); it != layers.end(); ++it) + { + const LayerData& ld = it->second; + blobManager.addReferences(ld.inputBlobsId); + } + + for (int i = 0; i < blobsToKeep_.size(); i++) + { + blobManager.addReference(blobsToKeep_[i]); + } + + for (it = layers.begin(); it != layers.end(); it++) + { + int lid = it->first; + allocateLayer(lid, layersShapes); + } + + fuseLayers(blobsToKeep_); + } + + void forwardLayer(LayerData &ld) + { + Ptr layer = ld.layerInstance; + + if (preferableBackend == DNN_BACKEND_DEFAULT || + !layer->supportBackend(preferableBackend)) + { + if( !ld.skipFlags[DNN_BACKEND_DEFAULT] ) + layer->forward(ld.inputBlobs, ld.outputBlobs, ld.internals); + } + else if (!ld.skipFlags[preferableBackend]) + { + std::vector > outputs = + backendWrapper.wrap(ld.outputBlobs, preferableBackend, preferableTarget); + Ptr node = ld.backendNodes[preferableBackend]; + if (preferableBackend == DNN_BACKEND_HALIDE) + { + forwardHalide(outputs, node); + } + else + { + CV_Error(Error::StsNotImplemented, "Unknown backend identifier"); + } + } + + ld.flag = 1; + } + + void forwardToLayer(LayerData &ld, bool clearFlags = true) + { + if (clearFlags) + { + MapIdToLayerData::iterator it; + for (it = layers.begin(); it != layers.end(); it++) + it->second.flag = 0; + } + + //already was forwarded + if (ld.flag) + return; + + //forward parents + MapIdToLayerData::iterator it; + for (it = layers.begin(); it->second.id < ld.id; it++) + { + LayerData &ld = it->second; + if (ld.flag) + continue; + forwardLayer(ld); + } + + //forward itself + forwardLayer(ld); + } + + void forwardAll() + { + forwardToLayer(layers.rbegin()->second, true); + } + + void getLayerShapesRecursively(int id, LayersShapesMap& inOutShapes) + { + std::vector& inputLayerIds = layers[id].inputBlobsId; + + if (inOutShapes[id].in.empty()) + { + for(int i = 0; i < inputLayerIds.size(); i++) + { + int layerId = inputLayerIds[i].lid; + LayersShapesMap::iterator it = + inOutShapes.find(layerId); + if(it == inOutShapes.end() || + it->second.out.empty()) + { + getLayerShapesRecursively(layerId, inOutShapes); + } + const MatShape& shape = inOutShapes[layerId].out[inputLayerIds[i].oid]; + inOutShapes[id].in.push_back(shape); + } + } + const ShapesVec& is = inOutShapes[id].in; + ShapesVec& os = inOutShapes[id].out; + ShapesVec& ints = inOutShapes[id].internal; + int requiredOutputs = layers[id].requiredOutputs.size(); + inOutShapes[id].supportInPlace = + layers[id].getLayerInstance()->getMemoryShapes(is, requiredOutputs, os, ints); + } + + void getLayersShapes(const ShapesVec& netInputShapes, + LayersShapesMap& inOutShapes) + { + inOutShapes.clear(); + + inOutShapes[0].in = netInputShapes; //insert shape for first input layer + for (MapIdToLayerData::iterator it = layers.begin(); + it != layers.end(); it++) + { + getLayerShapesRecursively(it->first, inOutShapes); + } + } + + void getLayerShapes(const ShapesVec& netInputShapes, + const int layerId, + LayerShapes& shapes) + { + LayersShapesMap inOutShapes; + inOutShapes[0].in = netInputShapes; //insert shape for first input layer + getLayerShapesRecursively(layerId, inOutShapes); + shapes = inOutShapes[layerId]; + } + + LayerPin getLatestLayerPin(const std::vector& pins) + { + return *std::max_element(pins.begin(), pins.end()); + } + + Mat getBlob(const LayerPin& pin) + { + if (!pin.valid()) + CV_Error(Error::StsObjectNotFound, "Requested blob not found"); + + LayerData &ld = layers[pin.lid]; + if ((size_t)pin.oid >= ld.outputBlobs.size()) + { + CV_Error(Error::StsOutOfRange, "Layer \"" + ld.name + "\" produce only " + toString(ld.outputBlobs.size()) + + " outputs, the #" + toString(pin.oid) + " was requsted"); + } + if (preferableBackend != DNN_BACKEND_DEFAULT) + { + // Transfer data to CPU if it's require. + backendWrapper.wrap(ld.outputBlobs[pin.oid], preferableBackend, + preferableTarget)->copyToHost(); + } + else + { + CV_Assert(preferableTarget == DNN_TARGET_CPU); + } + return ld.outputBlobs[pin.oid]; + } + + Mat getBlob(String outputName) + { + return getBlob(getPinByAlias(outputName)); + } +}; + +Net::Net() : impl(new Net::Impl) +{ +} + +Net::~Net() +{ +} + +int Net::addLayer(const String &name, const String &type, LayerParams ¶ms) +{ + if (name.find('.') != String::npos) + { + CV_Error(Error::StsBadArg, "Added layer name \"" + name + "\" must not contain dot symbol"); + return -1; + } + + if (impl->getLayerId(name) >= 0) + { + CV_Error(Error::StsBadArg, "Layer \"" + name + "\" already into net"); + return -1; + } + + int id = ++impl->lastLayerId; + impl->layerNameToId.insert(std::make_pair(name, id)); + impl->layers.insert(std::make_pair(id, LayerData(id, name, type, params))); + + return id; +} + +int Net::addLayerToPrev(const String &name, const String &type, LayerParams ¶ms) +{ + int prvLid = impl->lastLayerId; + int newLid = this->addLayer(name, type, params); + this->connect(prvLid, 0, newLid, 0); + return newLid; +} + +void Net::connect(int outLayerId, int outNum, int inpLayerId, int inpNum) +{ + impl->connect(outLayerId, outNum, inpLayerId, inpNum); +} + +void Net::connect(String _outPin, String _inPin) +{ + LayerPin outPin = impl->getPinByAlias(_outPin); + LayerPin inpPin = impl->getPinByAlias(_inPin); + + CV_Assert(outPin.valid() && inpPin.valid()); + + impl->connect(outPin.lid, outPin.oid, inpPin.lid, inpPin.oid); +} + +Mat Net::forward(const String& outputName) +{ + String layerName = outputName; + + if (layerName.empty()) + layerName = getLayerNames().back(); + + impl->setUpNet(); + impl->forwardToLayer(impl->getLayerData(layerName)); + + return impl->getBlob(layerName); +} + +void Net::forward(std::vector& outputBlobs, const String& outputName) +{ + impl->setUpNet(); + + String layerName = outputName; + + if (layerName.empty()) + layerName = getLayerNames().back(); + + impl->forwardToLayer(impl->getLayerData(layerName)); + + LayerPin pin = impl->getPinByAlias(layerName); + LayerData &ld = impl->layers[pin.lid]; + outputBlobs = ld.outputBlobs; +} + +void Net::forward(std::vector& outputBlobs, + const std::vector& outBlobNames) +{ + std::vector pins; + for (int i = 0; i < outBlobNames.size(); i++) + { + pins.push_back(impl->getPinByAlias(outBlobNames[i])); + } + + impl->setUpNet(pins); + + LayerPin out = impl->getLatestLayerPin(pins); + + impl->forwardToLayer(impl->getLayerData(out.lid)); + + outputBlobs.clear(); + for (int i = 0; i < pins.size(); i++) + { + outputBlobs.push_back(impl->getBlob(pins[i])); + } +} + +void Net::forward(std::vector >& outputBlobs, + const std::vector& outBlobNames) +{ + std::vector pins; + for (int i = 0; i < outBlobNames.size(); i++) + { + std::vector lp = impl->getLayerOutPins(outBlobNames[i]); + pins.insert(pins.end(), lp.begin(), lp.end()); + } + + impl->setUpNet(pins); + + LayerPin out = impl->getLatestLayerPin(pins); + + impl->forwardToLayer(impl->getLayerData(out.lid)); + + outputBlobs.resize(outBlobNames.size()); + for (int i = 0; i < outBlobNames.size(); i++) + { + std::vector lp = impl->getLayerOutPins(outBlobNames[i]); + for (int i = 0; i < lp.size(); i++) + { + outputBlobs[i].push_back(impl->getBlob(lp[i])); + } + } +} + +void Net::setPreferableBackend(int backendId) +{ + impl->netWasAllocated = impl->netWasAllocated && + impl->preferableBackend == backendId; + impl->preferableBackend = backendId; +} + +void Net::setPreferableTarget(int targetId) +{ + impl->netWasAllocated = impl->netWasAllocated && + impl->preferableTarget == targetId; + impl->preferableTarget = targetId; +} + +void Net::setInputsNames(const std::vector &inputBlobNames) +{ + impl->netInputLayer->setNames(inputBlobNames); +} + +void Net::setInput(const Mat &blob_, const String& name) +{ + LayerPin pin; + pin.lid = 0; + pin.oid = impl->resolvePinOutputName(impl->getLayerData(pin.lid), name); + + if (!pin.valid()) + CV_Error(Error::StsObjectNotFound, "Requested blob \"" + name + "\" not found"); + + LayerData &ld = impl->layers[pin.lid]; + ld.outputBlobs.resize( std::max(pin.oid+1, (int)ld.requiredOutputs.size()) ); + MatShape prevShape = shape(ld.outputBlobs[pin.oid]); + bool oldShape = prevShape == shape(blob_); + if (oldShape) + blob_.copyTo(ld.outputBlobs[pin.oid]); + else + ld.outputBlobs[pin.oid] = blob_.clone(); + + impl->netWasAllocated = impl->netWasAllocated && oldShape; +} + +Mat Net::getParam(LayerId layer, int numParam) +{ + LayerData &ld = impl->getLayerData(layer); + + std::vector &layerBlobs = ld.layerInstance->blobs; + CV_Assert(numParam < (int)layerBlobs.size()); + return layerBlobs[numParam]; +} + +void Net::setParam(LayerId layer, int numParam, const Mat &blob) +{ + LayerData &ld = impl->getLayerData(layer); + + std::vector &layerBlobs = ld.layerInstance->blobs; + CV_Assert(numParam < (int)layerBlobs.size()); + //we don't make strong checks, use this function carefully + layerBlobs[numParam] = blob; +} + +int Net::getLayerId(const String &layer) +{ + return impl->getLayerId(layer); +} + +void Net::deleteLayer(LayerId) +{ + CV_Error(Error::StsNotImplemented, ""); +} + +Ptr Net::getLayer(LayerId layerId) +{ + LayerData &ld = impl->getLayerData(layerId); + if (!ld.layerInstance) + CV_Error(Error::StsNullPtr, format("Requested layer \"%s\" was not initialized", ld.name.c_str())); + return ld.layerInstance; +} + +std::vector > Net::getLayerInputs(LayerId layerId) +{ + LayerData &ld = impl->getLayerData(layerId); + if (!ld.layerInstance) + CV_Error(Error::StsNullPtr, format("Requested layer \"%s\" was not initialized", ld.name.c_str())); + + std::vector > inputLayers; + inputLayers.reserve(ld.inputLayersId.size()); + std::set::iterator it; + for (it = ld.inputLayersId.begin(); it != ld.inputLayersId.end(); ++it) { + inputLayers.push_back(getLayer(*it)); + } + return inputLayers; +} + +std::vector Net::getLayerNames() const +{ + std::vector res; + res.reserve(impl->layers.size()); + + Impl::MapIdToLayerData::iterator it; + for (it = impl->layers.begin(); it != impl->layers.end(); it++) + { + if (it->second.id) //skip Data layer + res.push_back(it->second.name); + } + + return res; +} + +bool Net::empty() const +{ + return impl->layers.size() <= 1; //first layer is default Data layer +} + +std::vector Net::getUnconnectedOutLayers() const +{ + std::vector layersIds; + + Impl::MapIdToLayerData::iterator it; + for (it = impl->layers.begin(); it != impl->layers.end(); it++) + { + int lid = it->first; + LayerData &ld = it->second; + + if (ld.requiredOutputs.size() == 0) + layersIds.push_back(lid); + } + + return layersIds; +} + +void Net::getLayersShapes(const ShapesVec& netInputShapes, + std::vector* layersIds, + std::vector* inLayersShapes, + std::vector* outLayersShapes) const +{ + if ((layersIds || inLayersShapes || outLayersShapes) == false) + return; + + if (layersIds) layersIds->clear(); + if (inLayersShapes) inLayersShapes->clear(); + if (outLayersShapes) outLayersShapes->clear(); + + Impl::LayersShapesMap inOutShapes; + impl->getLayersShapes(netInputShapes, inOutShapes); + + for(Impl::LayersShapesMap::const_iterator it = inOutShapes.begin(); + it != inOutShapes.end(); it++) + { + if (layersIds) + layersIds->push_back(it->first); + if (inLayersShapes) + inLayersShapes->push_back(it->second.in); + if (outLayersShapes) + outLayersShapes->push_back(it->second.out); + } +} + +void Net::getLayersShapes(const MatShape& netInputShape, + std::vector* layerIds, + std::vector* inLayersShapes, + std::vector* outLayersShapes) const +{ + getLayersShapes(ShapesVec(1, netInputShape), + layerIds, inLayersShapes, outLayersShapes); +} + +void Net::getLayerShapes(const MatShape& netInputShape, + const int layerId, + ShapesVec* inLayerShapes, + ShapesVec* outLayerShapes) const +{ + getLayerShapes(ShapesVec(1, netInputShape), + layerId, inLayerShapes, outLayerShapes); + +} + +void Net::getLayerShapes(const ShapesVec& netInputShapes, + const int layerId, + ShapesVec* inLayerShapes, + ShapesVec* outLayerShapes) const +{ + LayerShapes shapes; + impl->getLayerShapes(netInputShapes, layerId, shapes); + if (inLayerShapes) + *inLayerShapes = shapes.in; + if (outLayerShapes) + *outLayerShapes = shapes.out; +} + +int64 Net::getFLOPS(const std::vector& netInputShapes) const +{ + int64 flops = 0; + std::vector ids; + std::vector > inShapes, outShapes; + getLayersShapes(netInputShapes, &ids, &inShapes, &outShapes); + CV_Assert(inShapes.size() == outShapes.size()); + CV_Assert(inShapes.size() == ids.size()); + + for(int i = 0; i < ids.size(); i++) + { + flops += impl->layers[ids[i]].getLayerInstance()->getFLOPS(inShapes[i], + outShapes[i]); + } + + return flops; +} + +int64 Net::getFLOPS(const MatShape& netInputShape) const +{ + return getFLOPS(std::vector(1, netInputShape)); +} + +int64 Net::getFLOPS(const int layerId, + const std::vector& netInputShapes) const +{ + Impl::MapIdToLayerData::iterator layer = impl->layers.find(layerId); + CV_Assert(layer != impl->layers.end()); + + LayerShapes shapes; + impl->getLayerShapes(netInputShapes, layerId, shapes); + + return layer->second.getLayerInstance()->getFLOPS(shapes.in, shapes.out); +} + +int64 Net::getFLOPS(const int layerId, + const MatShape& netInputShape) const +{ + return getFLOPS(layerId, std::vector(1, netInputShape)); +} + +void Net::getLayerTypes(std::vector& layersTypes) const +{ + layersTypes.clear(); + + std::map layers; + for (Impl::MapIdToLayerData::iterator it = impl->layers.begin(); + it != impl->layers.end(); it++) + { + if (layers.find(it->second.type) == layers.end()) + layers[it->second.type] = 0; + layers[it->second.type]++; + } + + for (std::map::iterator it = layers.begin(); + it != layers.end(); it++) + { + layersTypes.push_back(it->first); + } +} + +int Net::getLayersCount(const String& layerType) const +{ + int count = 0; + for (Impl::MapIdToLayerData::iterator it = impl->layers.begin(); + it != impl->layers.end(); it++) + { + if (it->second.type == layerType) + count++; + } + return count; +} + +void Net::getMemoryConsumption(const int layerId, + const std::vector& netInputShapes, + size_t& weights, size_t& blobs) const +{ + Impl::MapIdToLayerData::iterator layer = impl->layers.find(layerId); + CV_Assert(layer != impl->layers.end()); + + weights = blobs = 0; + + for(int i = 0; i < layer->second.params.blobs.size(); i++) + { + const Mat& weightsBlob = layer->second.params.blobs[i]; + weights += weightsBlob.total()*weightsBlob.elemSize(); + } + + std::vector outLayerShapes; + getLayerShapes(netInputShapes, layerId, 0, &outLayerShapes); + for(int i = 0; i < outLayerShapes.size(); i++) + { + blobs += total(outLayerShapes[i]) * sizeof(float); + } +} + +void Net::getMemoryConsumption(const std::vector& netInputShapes, + size_t& weights, size_t& blobs) const +{ + std::vector layerIds; + std::vector w, b; + getMemoryConsumption(netInputShapes, layerIds, w, b); + + weights = blobs = 0; + for(int i = 0; i < layerIds.size(); i++) + { + weights += w[i]; + blobs += b[i]; + } +} + +void Net::getMemoryConsumption(const int layerId, + const MatShape& netInputShape, + size_t& weights, size_t& blobs) const +{ + getMemoryConsumption(layerId, std::vector(1, netInputShape), + weights, blobs); +} + +void Net::getMemoryConsumption(const MatShape& netInputShape, + size_t& weights, size_t& blobs) const +{ + getMemoryConsumption(std::vector(1, netInputShape), + weights, blobs); +} + +void Net::getMemoryConsumption(const std::vector& netInputShapes, + std::vector& layerIds, std::vector& weights, + std::vector& blobs) const +{ + layerIds.clear(); + weights.clear(); + blobs.clear(); + + std::vector > outLayerShapes; + + getLayersShapes(netInputShapes, &layerIds, 0, &outLayerShapes); + + for(int i = 0; i < layerIds.size(); i++) + { + int w = 0, b = 0; + Impl::MapIdToLayerData::iterator layer = impl->layers.find(layerIds[i]); + CV_Assert(layer != impl->layers.end()); + + for(int j = 0; j < layer->second.params.blobs.size(); j++) + { + const Mat& weightsBlob = layer->second.params.blobs[j]; + w += weightsBlob.total()*weightsBlob.elemSize(); + } + + for(int j = 0; j < outLayerShapes[i].size(); j++) + { + b += total(outLayerShapes[i][j]) * sizeof(float); + } + + weights.push_back(w); + blobs.push_back(b); + } +} + +void Net::getMemoryConsumption(const MatShape& netInputShape, std::vector& layerIds, + std::vector& weights, std::vector& blobs) const +{ + getMemoryConsumption(std::vector(1, netInputShape), layerIds, + weights, blobs); +} + +void Net::setHalideScheduler(const String& scheduler) +{ + impl->halideConfigFile = scheduler; +} + +////////////////////////////////////////////////////////////////////////// + +Importer::~Importer() {} + +Layer::Layer() {} + +Layer::Layer(const LayerParams ¶ms) + : blobs(params.blobs), name(params.name), type(params.type) +{ + +} + +void Layer::setParamsFrom(const LayerParams ¶ms) +{ + blobs = params.blobs; + name = params.name; + type = params.type; +} + +int Layer::inputNameToIndex(String) +{ + return -1; +} + +int Layer::outputNameToIndex(String) +{ + return -1; +} + +bool Layer::supportBackend(int backendId) +{ + return backendId == DNN_BACKEND_DEFAULT; +} + +Ptr Layer::initHalide(const std::vector > &) +{ + CV_Error(Error::StsNotImplemented, "Halide pipeline of " + type + + " layers is not defined."); + return Ptr(); +} + +void Layer::applyHalideScheduler(Ptr& node, const std::vector &inputs, + const std::vector &outputs, int targetId) const +{ +#ifdef HAVE_HALIDE + Halide::Var x("x"), y("y"), c("c"), n("n"), co("co"), ci("ci"), + xo("xo"), xi("xi"), yo("yo"), yi("yi"), tile("tile"); + Halide::Func& top = node.dynamicCast()->funcs.back(); + + int outW, outH, outC, outN; + getCanonicalSize(outputs[0].size, &outW, &outH, &outC, &outN); + + if (targetId == DNN_TARGET_CPU) + { + if (outW == 1 && outH == 1) + { + if (outC + outN == 1) + return; + + if (outC > 8) + top.split(c, co, ci, 8) + .fuse(x, y, tile).fuse(co, tile, tile).fuse(n, tile, tile) + .parallel(tile) + .vectorize(ci, 8); + else + top.fuse(x, y, tile).fuse(c, tile, tile).fuse(n, tile, tile) + .parallel(tile); + } + else + { + if (outH > 2) + { + top.reorder(x, c, y) + .split(y, yo, yi, 2) + .fuse(yo, n, tile) + .parallel(tile) + .unroll(yi) + .vectorize(x, outW >= 16 ? 16 : outW); + } + } + } + else if (targetId == DNN_TARGET_OPENCL) + { + int c_split = outC > 8 ? (outC > 16 ? 8 : 4) : outC; + if (outW == 1 && outH == 1) + { + top.split(c, co, ci, c_split) + .fuse(x, y, tile).fuse(co, tile, tile).fuse(n, tile, tile) + .gpu_blocks(tile) + .gpu_threads(ci); + } + else + { + int x_split = outW > 8 ? (outW >= 32 ? 16 : 8) : outW; + int y_split = outH > 8 ? (outH >= 32 ? 16 : 8) : outH; + top.split(x, xo, xi, x_split).split(y, yo, yi, y_split) + .split(c, co, ci, c_split) + .gpu_blocks(xo, yo, co) + .gpu_threads(xi, yi) + .reorder(xi, yi, ci, xo, yo, co) + .vectorize(ci); + } + } + else + CV_Error(Error::StsNotImplemented, "Unknown target identifier"); +#endif // HAVE_HALIDE +} + +Ptr Layer::tryAttach(const Ptr& node) +{ + return Ptr(); +} + +template +static void vecToPVec(const std::vector &v, std::vector &pv) +{ + pv.resize(v.size()); + for (size_t i = 0; i < v.size(); i++) + pv[i] = const_cast(&v[i]); +} + +void Layer::finalize(const std::vector &inputs, std::vector &outputs) +{ + std::vector inputsp; + vecToPVec(inputs, inputsp); + this->finalize(inputsp, outputs); +} + +void Layer::finalize(const std::vector &input, std::vector &output) +{ + (void)input;(void)output; +} + +std::vector Layer::finalize(const std::vector &inputs) +{ + std::vector outputs; + this->finalize(inputs, outputs); + return outputs; +} + +void Layer::forward(const std::vector &inputs, std::vector &outputs, std::vector &internals) +{ + std::vector inputsp; + vecToPVec(inputs, inputsp); + this->forward(inputsp, outputs, internals); +} + +void Layer::run(const std::vector &inputs, std::vector &outputs, std::vector &internals) +{ + std::vector inputsp; + vecToPVec(inputs, inputsp); + this->finalize(inputsp, outputs); + this->forward(inputsp, outputs, internals); +} + +Layer::~Layer() {} + +bool Layer::getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const +{ + CV_Assert(inputs.size()); + outputs.assign(std::max(requiredOutputs, (int)inputs.size()), inputs[0]); + return false; +} + +////////////////////////////////////////////////////////////////////////// + +struct LayerFactory::Impl : public std::map +{ +}; + +Ptr LayerFactory::impl () +{ + // allocate on first use + static Ptr impl_(new LayerFactory::Impl()); + return impl_; +} + +void LayerFactory::registerLayer(const String &_type, Constuctor constructor) +{ + String type = _type.toLowerCase(); + Impl::iterator it = impl()->find(type); + + if (it != impl()->end() && it->second != constructor) + { + CV_Error(cv::Error::StsBadArg, "Layer \"" + type + "\" already was registered"); + } + + impl()->insert(std::make_pair(type, constructor)); +} + +void LayerFactory::unregisterLayer(const String &_type) +{ + String type = _type.toLowerCase(); + impl()->erase(type); +} + +Ptr LayerFactory::createLayerInstance(const String &_type, LayerParams& params) +{ + String type = _type.toLowerCase(); + Impl::const_iterator it = LayerFactory::impl()->find(type); + + if (it != impl()->end()) + { + return it->second(params); + } + else + { + return Ptr(); //NULL + } +} + +BackendNode::BackendNode(int backendId) : backendId(backendId) {} + +BackendNode::~BackendNode() {}; + +BackendWrapper::BackendWrapper(int backendId, int targetId) + : backendId(backendId), targetId(targetId) {} + +BackendWrapper::BackendWrapper(int targetId, const cv::Mat& m) +{ + CV_Error(Error::StsNotImplemented, + "Constructor of backend wrapper must be implemented"); +} + +BackendWrapper::BackendWrapper(const Ptr& base, const MatShape& shape) +{ + CV_Error(Error::StsNotImplemented, + "Constructor of backend wrapper must be implemented"); +} + +BackendWrapper::~BackendWrapper() {} + +} +} diff --git a/modules/dnn/src/halide_scheduler.cpp b/modules/dnn/src/halide_scheduler.cpp new file mode 100644 index 0000000000..b7f748ff7a --- /dev/null +++ b/modules/dnn/src/halide_scheduler.cpp @@ -0,0 +1,284 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +#include "halide_scheduler.hpp" +#include "op_halide.hpp" + +namespace cv +{ +namespace dnn +{ + +#ifdef HAVE_HALIDE +static void applySplit(const FileNode& directive, Halide::Func& func, + const FileNode& params) +{ + for (const auto& varNode : directive) + { + const std::string varName = varNode.name(); + const std::string factorName = (std::string)varNode; + Halide::Var var(varName); + Halide::Var outerVar(varName + "o"); + Halide::Var innerVar(varName + "i"); + // If split factor is integer or parameters map has parameter value. + CV_Assert(varNode.isString() && !params[factorName].empty() || + varNode.isInt()); + int factor = (int)(varNode.isInt() ? varNode : params[factorName]); + func.split(var, outerVar, innerVar, factor); + } +} + +static void applyReorder(const FileNode& directive, Halide::Func& func) +{ + std::string varName; + const int numVars = directive.size(); + std::vector reorderedVars; + reorderedVars.reserve(numVars); + for (int i = 0; i < numVars; ++i) + { + directive[i] >> varName; + reorderedVars.push_back(Halide::Var(varName)); + } + func.reorder(reorderedVars); +} + +static void applyFuse(const FileNode& directive, Halide::Func& func) +{ + CV_Assert(directive["src"].size() >= 2); + CV_Assert(directive["dst"].size() == 1); + + std::string str; + directive["src"][0] >> str; + Halide::Var firstVar(str); + directive["src"][1] >> str; + Halide::Var secondVar(str); + directive["dst"] >> str; + Halide::Var dstVar(str); + + func.fuse(firstVar, secondVar, dstVar); + for (int i = 2, n = directive["src"].size(); i < n; ++i) + { + directive["src"][i] >> str; + func.fuse(Halide::Var(str), dstVar, dstVar); + } +} + +static void applyParallel(const FileNode& directive, Halide::Func& func) +{ + std::string varName; + for (int i = 0, n = directive.size(); i < n; ++i) + { + directive[i] >> varName; + func.parallel(Halide::Var(varName)); + } +} + +static void applyUnroll(const FileNode& directive, Halide::Func& func) +{ + std::string varName; + for (int i = 0, n = directive.size(); i < n; ++i) + { + directive[i] >> varName; + func.unroll(Halide::Var(varName)); + } +} + +static void applyVectorize(const FileNode& directive, Halide::Func& func, + const FileNode& params) +{ + for (const auto& varNode : directive) + { + const std::string varName = varNode.name(); + const std::string factorName = (std::string)varNode; + // If split factor is integer or parameters map has parameter value. + CV_Assert(varNode.isString() && !params[factorName].empty() || + varNode.isInt()); + int factor = (int)(varNode.isInt() ? varNode : params[factorName]); + Halide::Var var(varName); + Halide::Var inner(varName + "v"); + func.split(var, var, inner, factor); + func.vectorize(inner); + } +} + +static void applyStoreAt(const FileNode& directive, Halide::Func& func, + std::map& funcsMap) +{ + for (const auto& funcNode : directive) + { + const std::string targetFuncName = funcNode.name(); + if (funcsMap.find(targetFuncName) == funcsMap.end()) + CV_Error(cv::Error::StsParseError, "Function " + targetFuncName + + " is not represented in Halide pipeline"); + Halide::Func targetFunc = funcsMap[targetFuncName]; + func.store_at(targetFunc, (std::string)funcNode); + break; + } +} + +static void applyComputeAt(const FileNode& directive, Halide::Func& func, + std::map& funcsMap) +{ + for (const auto& funcNode : directive) + { + const std::string targetFuncName = funcNode.name(); + if (funcsMap.find(targetFuncName) == funcsMap.end()) + CV_Error(cv::Error::StsParseError, "Function " + targetFuncName + + " is not represented in Halide pipeline"); + Halide::Func targetFunc = funcsMap[targetFuncName]; + func.compute_at(targetFunc, (std::string)funcNode); + break; + } +} + +static void applyComputeRoot(const FileNode& directive, Halide::Func& func) +{ + bool compute_root; + directive >> compute_root; + if (compute_root) + func.compute_root(); +} + +static void applyGpuBlocks(const FileNode& directive, Halide::Func& func) +{ + std::string varName; + for (int i = 0, n = directive.size(); i < n; ++i) + { + directive[i] >> varName; + func.gpu_blocks(Halide::Var(varName)); + } +} + +static void applyGpuThreads(const FileNode& directive, Halide::Func& func) +{ + std::string varName; + for (int i = 0, n = directive.size(); i < n; ++i) + { + directive[i] >> varName; + func.gpu_threads(Halide::Var(varName)); + } +} + +static void apply(const FileNode& directives, Halide::Func& func, + std::map& funcsMap, + const FileNode& params) +{ + for (const auto& directive : directives) + { + if (directive.name() == "split") + applySplit(directive, func, params); + else if (directive.name() == "reorder") + applyReorder(directive, func); + else if (directive.name() == "fuse") + applyFuse(directive, func); + else if (directive.name() == "parallel") + applyParallel(directive, func); + else if (directive.name() == "unroll") + applyUnroll(directive, func); + else if (directive.name() == "vectorize") + applyVectorize(directive, func, params); + else if (directive.name() == "store_at") + applyStoreAt(directive, func, funcsMap); + else if (directive.name() == "compute_at") + applyComputeAt(directive, func, funcsMap); + else if (directive.name() == "compute_root") + applyComputeRoot(directive, func); + else if (directive.name() == "gpu_blocks") + applyGpuBlocks(directive, func); + else if (directive.name() == "gpu_threads") + applyGpuThreads(directive, func); + else + CV_Error(Error::StsNotImplemented, "Scheduling directive " + + directive.name() + " is not implemented."); + } +} + +// Remove any numeric symbols after '$' sign. +static std::string Deunique(std::string str) +{ + int pos = -1; + do + { + pos = str.find('$'); + if (pos != -1) + { + int len = str.find_first_not_of("0123456789", pos + 1) - pos; + str = str.replace(pos, len, ""); + } + } + while (pos != -1); + return str; +} +#endif // HAVE_HALIDE + +HalideScheduler::HalideScheduler(const std::string& configFile) +{ + if (!configFile.empty()) + fs = FileStorage(configFile, FileStorage::READ); +} + +HalideScheduler::~HalideScheduler() +{ + if (fs.isOpened()) + fs.release(); +} + +bool HalideScheduler::process(Ptr& node) +{ +#ifdef HAVE_HALIDE + if (!fs.isOpened()) + return false; + + const FileNode& scheduleNode = fs["scheduling"]; + if (scheduleNode.empty()) + CV_Error(cv::Error::StsParseError, "Scheduling file should has scheduling node"); + + std::string str; + std::map funcsMap; // Scheduled functions. + // For every function, from top to bottom, we try to find a scheduling node. + // Scheduling is successful (return true) if for the first function (top) + // node is respresented. + CV_Assert(!node.empty()); + std::vector& funcs = node.dynamicCast()->funcs; + for (int i = funcs.size() - 1; i >= 0; --i) + { + Halide::Func& func = funcs[i]; + // For functions with the same name Halide generates unique names + // for example func, func$1, func$2. + // They are always formed with '$' and number. + std::string funcName = Deunique(func.name()); + + const FileNode& funcNode = scheduleNode[funcName]; + if (!funcNode.empty()) + { + if (!funcNode["pattern"].empty()) + { + funcNode["pattern"] >> str; + if (fs["patterns"][str].empty()) + CV_Error(cv::Error::StsParseError, "Scheduling pattern " + str + + " is not defined"); + apply(fs["patterns"][str], func, funcsMap, funcNode["params"]); + } + else + { + apply(funcNode, func, funcsMap, funcNode["params"]); + } + } + else + { + if (funcsMap.empty()) + return false; + } + funcsMap[funcName] = func; + } + return true; +#endif // HAVE_HALIDE + return false; +} + +} // namespace dnn +} // namespace cv diff --git a/modules/dnn/src/halide_scheduler.hpp b/modules/dnn/src/halide_scheduler.hpp new file mode 100644 index 0000000000..9afef3023f --- /dev/null +++ b/modules/dnn/src/halide_scheduler.hpp @@ -0,0 +1,37 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +#ifndef __OPENCV_DNN_HALIDE_SCHEDULER_HPP__ +#define __OPENCV_DNN_HALIDE_SCHEDULER_HPP__ + +#include + +namespace cv +{ +namespace dnn +{ + +class HalideScheduler +{ +public: + HalideScheduler(const std::string& configFile); + + ~HalideScheduler(); + + // Returns true if pipeline found in scheduling file. + // If more than one function, returns true if the top function scheduled. + // Other functions are optional to scheduling. + bool process(Ptr& node); + +private: + FileStorage fs; +}; + +} // namespace dnn +} // namespace cv + +#endif // __OPENCV_DNN_HALIDE_SCHEDULER_HPP__ diff --git a/modules/dnn/src/init.cpp b/modules/dnn/src/init.cpp new file mode 100644 index 0000000000..5ece907b77 --- /dev/null +++ b/modules/dnn/src/init.cpp @@ -0,0 +1,107 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "precomp.hpp" + +namespace cv +{ +namespace dnn +{ + +struct AutoInitializer +{ + bool status; + + AutoInitializer() : status(false) + { + initModule(); + } +}; + +static AutoInitializer init; + +void initModule() +{ + if (init.status) + return; + + REG_RUNTIME_LAYER_CLASS(Slice, SliceLayer); + REG_RUNTIME_LAYER_CLASS(Split, SplitLayer); + REG_RUNTIME_LAYER_CLASS(Concat, ConcatLayer); + REG_RUNTIME_LAYER_CLASS(Reshape, ReshapeLayer); + REG_RUNTIME_LAYER_CLASS(Flatten, FlattenLayer); + + REG_RUNTIME_LAYER_CLASS(Convolution, ConvolutionLayer); + REG_RUNTIME_LAYER_CLASS(Deconvolution, DeconvolutionLayer); + REG_RUNTIME_LAYER_CLASS(Pooling, PoolingLayer); + REG_RUNTIME_LAYER_CLASS(LRN, LRNLayer); + REG_RUNTIME_LAYER_CLASS(InnerProduct, InnerProductLayer); + REG_RUNTIME_LAYER_CLASS(Softmax, SoftmaxLayer); + REG_RUNTIME_LAYER_CLASS(MVN, MVNLayer); + + REG_RUNTIME_LAYER_CLASS(ReLU, ReLULayer); + REG_RUNTIME_LAYER_CLASS(ChannelsPReLU, ChannelsPReLULayer); + REG_RUNTIME_LAYER_CLASS(Sigmoid, SigmoidLayer); + REG_RUNTIME_LAYER_CLASS(TanH, TanHLayer); + REG_RUNTIME_LAYER_CLASS(BNLL, BNLLLayer); + REG_RUNTIME_LAYER_CLASS(AbsVal, AbsLayer); + REG_RUNTIME_LAYER_CLASS(Power, PowerLayer); + REG_RUNTIME_LAYER_CLASS(BatchNorm, BatchNormLayer); + REG_RUNTIME_LAYER_CLASS(MaxUnpool, MaxUnpoolLayer); + REG_RUNTIME_LAYER_CLASS(Dropout, BlankLayer); + REG_RUNTIME_LAYER_CLASS(Identity, BlankLayer); + + REG_RUNTIME_LAYER_CLASS(Crop, CropLayer); + REG_RUNTIME_LAYER_CLASS(Eltwise, EltwiseLayer); + REG_RUNTIME_LAYER_CLASS(Permute, PermuteLayer); + REG_RUNTIME_LAYER_CLASS(PriorBox, PriorBoxLayer); + REG_RUNTIME_LAYER_CLASS(DetectionOutput, DetectionOutputLayer); + REG_RUNTIME_LAYER_CLASS(NormalizeBBox, NormalizeBBoxLayer); + REG_RUNTIME_LAYER_CLASS(Normalize, NormalizeBBoxLayer); + REG_RUNTIME_LAYER_CLASS(Shift, ShiftLayer); + REG_RUNTIME_LAYER_CLASS(Padding, PaddingLayer); + REG_RUNTIME_LAYER_CLASS(Scale, ScaleLayer); + + init.status = true; +} + +} +} diff --git a/modules/dnn/src/layers/batch_norm_layer.cpp b/modules/dnn/src/layers/batch_norm_layer.cpp new file mode 100644 index 0000000000..3b42230097 --- /dev/null +++ b/modules/dnn/src/layers/batch_norm_layer.cpp @@ -0,0 +1,198 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of Batch Normalization layer. +*/ + +#include "../precomp.hpp" +#include "op_halide.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class BatchNormLayerImpl : public BatchNormLayer +{ +public: + Mat weights_, bias_; + + BatchNormLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + CV_Assert(blobs.size() >= 3); + + hasWeights = params.get("has_weight", false); + hasBias = params.get("has_bias", false); + epsilon = params.get("eps", 1E-5); + + size_t n = blobs[0].total(); + CV_Assert(blobs[1].total() == n && + blobs[0].isContinuous() && blobs[1].isContinuous() && + blobs[0].type() == CV_32F && blobs[1].type() == CV_32F); + + float varMeanScale = 1.f; + if (!hasWeights && !hasBias) { + CV_Assert(blobs[2].type() == CV_32F); + varMeanScale = blobs[2].at(0); + if (varMeanScale != 0) + varMeanScale = 1/varMeanScale; + } + + const int weightsBlobIndex = 2; + const int biasBlobIndex = weightsBlobIndex + hasWeights; + + if( hasWeights ) + { + CV_Assert((size_t)weightsBlobIndex < blobs.size()); + const Mat& w = blobs[weightsBlobIndex]; + CV_Assert(w.isContinuous() && w.type() == CV_32F && w.total() == (size_t)n); + } + + if( hasBias ) + { + CV_Assert((size_t)biasBlobIndex < blobs.size()); + const Mat& b = blobs[weightsBlobIndex]; + CV_Assert(b.isContinuous() && b.type() == CV_32F && b.total() == (size_t)n); + } + + const float* meanData = blobs[0].ptr(); + const float* stdData = blobs[1].ptr(); + const float* weightsData = hasWeights ? blobs[weightsBlobIndex].ptr() : 0; + const float* biasData = hasBias ? blobs[biasBlobIndex].ptr() : 0; + + weights_.create(1, (int)n, CV_32F); + bias_.create(1, (int)n, CV_32F); + + float* dstWeightsData = weights_.ptr(); + float* dstBiasData = bias_.ptr(); + + for (size_t i = 0; i < n; ++i) + { + float w = (hasWeights ? weightsData[i] : 1.0f) / sqrt(stdData[i] * varMeanScale + epsilon); + dstWeightsData[i] = w; + dstBiasData[i] = (hasBias ? biasData[i] : 0.0f) - w * meanData[i] * varMeanScale; + } + } + + void getScaleShift(Mat& scale, Mat& shift) const + { + scale = weights_; + shift = bias_; + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + return true; + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + CV_Assert(blobs.size() >= 2); + CV_Assert(inputs.size() == 1); + + Mat &inpBlob = *inputs[0]; + int rows = inpBlob.size[2]; + int cols = inpBlob.size[3]; + + for (size_t ii = 0; ii < outputs.size(); ii++) + { + Mat &outBlob = outputs[ii]; + + for(int num = 0; num < outBlob.size[0]; num++) + { + for (int n = 0; n < outBlob.size[1]; n++) + { + float w = weights_.at(n); + float b = bias_.at(n); + Mat inpBlobPlane(rows, cols, CV_32F, inpBlob.ptr(num, n)); + Mat outBlobPlane(rows, cols, CV_32F, outBlob.ptr(num, n)); + inpBlobPlane.convertTo(outBlobPlane, CV_32F, w, b); + } + } + } + } + + virtual Ptr tryAttach(const Ptr& node) + { + switch (node->backendId) + { + case DNN_BACKEND_HALIDE: + { +#ifdef HAVE_HALIDE + auto base = node.dynamicCast(); + Halide::Func& input = base->funcs.back(); + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = attachHalide(input(x, y, c, n)); + return Ptr(new HalideBackendNode(base, top)); +#endif // HAVE_HALIDE + break; + } + } + return Ptr(); + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer input = halideBuffer(inputs[0]); + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = attachHalide(input(x, y, c, n)); + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + +#ifdef HAVE_HALIDE + // attachHalide can work both with Halide::Buffer and Halide::Func. In the + // second case it will be a fusion. + Halide::Func attachHalide(const Halide::Expr& input) + { + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Var x("x"), y("y"), c("c"), n("n"); + + const int numChannels = weights_.total(); + auto weights = wrapToHalideBuffer(weights_, {numChannels}); + auto bias = wrapToHalideBuffer(bias_, {numChannels}); + top(x, y, c, n) = input * weights(c) + bias(c); + return top; + } +#endif // HAVE_HALIDE + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + + int64 flops = 0; + for(int i = 0; i < inputs.size(); i++) + { + flops += 3*total(inputs[i]); + } + return flops; + } +}; + +Ptr BatchNormLayer::create(const LayerParams& params) +{ + return Ptr(new BatchNormLayerImpl(params)); +} + +} // namespace dnn +} // namespace cv diff --git a/modules/dnn/src/layers/blank_layer.cpp b/modules/dnn/src/layers/blank_layer.cpp new file mode 100644 index 0000000000..f90f238c90 --- /dev/null +++ b/modules/dnn/src/layers/blank_layer.cpp @@ -0,0 +1,78 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ +#include "../precomp.hpp" + +namespace cv +{ +namespace dnn +{ +class BlankLayerImpl : public BlankLayer +{ +public: + BlankLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + return true; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (int i = 0, n = outputs.size(); i < n; ++i) + if (outputs[i].data != inputs[i]->data) + inputs[i]->copyTo(outputs[i]); + } +}; + +Ptr BlankLayer::create(const LayerParams& params) +{ + return Ptr(new BlankLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/concat_layer.cpp b/modules/dnn/src/layers/concat_layer.cpp new file mode 100644 index 0000000000..26fb64c15a --- /dev/null +++ b/modules/dnn/src/layers/concat_layer.cpp @@ -0,0 +1,141 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" + +namespace cv +{ +namespace dnn +{ + +class ConcatLayerImpl : public ConcatLayer +{ +public: + ConcatLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + axis = params.get("axis", 1); + } + + virtual bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() > 0); + outputs.clear(); + outputs.push_back(inputs[0]); + int cAxis = clamp(axis, inputs[0]); + + int axisSum = 0; + for (size_t i = 0; i < inputs.size(); i++) + { + MatShape curShape = inputs[i]; + + CV_Assert(curShape.size() == outputs.back().size()); + for (int curAxis = 0; curAxis < outputs.back().size(); curAxis++) + { + if (curAxis != cAxis && outputs.back()[curAxis] != curShape[curAxis]) + CV_Error(Error::StsBadSize, "Inconsitent shape for ConcatLayer"); + } + + axisSum += curShape[cAxis]; + } + + outputs.back()[cAxis] = axisSum; + + return false; + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide() && axis == 1; // By channels + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + int cAxis = clamp(axis, inputs[0]->dims); + Mat& outMat = outputs[0]; + std::vector ranges(outputs[0].dims, Range::all()); + + ranges[cAxis].start = 0; + for (size_t i = 0; i < inputs.size(); i++) + { + ranges[cAxis].end = ranges[cAxis].start + inputs[i]->size[cAxis]; + inputs[i]->copyTo(outMat(&ranges[0])); + ranges[cAxis].start = ranges[cAxis].end; + } + } + + virtual Ptr initHalide(const std::vector > &input) + { +#ifdef HAVE_HALIDE + std::vector > inputBuffers = halideBuffers(input); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + int offset = inputBuffers[0].channels(); + Halide::Expr topExpr = select(c < offset, + inputBuffers[0](x, y, c, n), + inputBuffers[1](x, y, c - offset, n)); + for (int i = 2; i < input.size(); ++i) + { + offset += inputBuffers[i - 1].channels(); + topExpr = select(c < offset, topExpr, + inputBuffers[i](x, y, c - offset, n)); + } + top(x, y, c, n) = topExpr; + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } +}; + +Ptr ConcatLayer::create(const LayerParams& params) +{ + return Ptr(new ConcatLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/convolution_layer.cpp b/modules/dnn/src/layers/convolution_layer.cpp new file mode 100644 index 0000000000..9dac3e7072 --- /dev/null +++ b/modules/dnn/src/layers/convolution_layer.cpp @@ -0,0 +1,1145 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" +#include "opencv2/core/hal/hal.hpp" +#include "opencv2/core/hal/intrin.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class BaseConvolutionLayerImpl : public ConvolutionLayer +{ +public: + BaseConvolutionLayerImpl() {} + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + void finalize(const std::vector &inputs, std::vector &outputs) + { + CV_Assert(inputs.size() > 0); + + CV_Assert(blobs.size() >= 1 && blobs.size() <= 2); + CV_Assert(blobs[0].dims == 4 && blobs[0].size[3] == kernel.width && blobs[0].size[2] == kernel.height); + + const Mat &input = *inputs[0]; + CV_Assert(input.dims == 4 && (input.type() == CV_32F || input.type() == CV_64F)); + for (size_t i = 0; i < inputs.size(); i++) + { + CV_Assert(inputs[i]->type() == input.type()); + CV_Assert(inputs[i]->dims == 4 && inputs[i]->size[1] == input.size[1]); + CV_Assert(inputs[i]->size[2] == input.size[2] && inputs[i]->size[3] == input.size[3]); + } + + Size outSize = Size(outputs[0].size[3], outputs[0].size[2]); + getConvPoolPaddings(Size(input.size[3], input.size[2]), outSize, + kernel, stride, padMode, pad); + } + + bool hasBias() const + { + return blobs.size() >= 2; + } + + virtual MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const = 0; + bool is1x1() const + { + return (kernel.height == 1 && kernel.width == 1) && + (stride.height == 1 && stride.width == 1) && + (dilation.height == 1 && dilation.width == 1); + } + bool setActivation(const Ptr& ) { return false; } + bool setBatchNorm(const Ptr& ) { return false; } + + virtual void applyHalideScheduler(Ptr& node, + const std::vector &inputs, + const std::vector &outputs, + int targetId) const + { +#ifdef HAVE_HALIDE + if (targetId != DNN_TARGET_CPU) + { + Layer::applyHalideScheduler(node, inputs, outputs, targetId); + return; + } + Halide::Var x("x"), y("y"), c("c"), n("n"), tile("tile"), yi("yi"), yo("yo"), co("co"), ci("ci"); + Halide::Func& top = node.dynamicCast()->funcs[1]; + Halide::Func& padded_input = node.dynamicCast()->funcs[0]; + + int outW, outH, outC, outN; + getCanonicalSize(outputs[0].size, &outW, &outH, &outC, &outN); + + if (outW == 1 || outH <= 2) + return; + + if (is1x1() || outC <= 16) + top.reorder(x, c, y) + .split(y, yo, yi, 2) + .fuse(yo, n, tile) + .parallel(tile) + .unroll(yi) + .vectorize(x, outW >= 16 ? 16 : outW); + else + top.reorder(x, c, y) + .split(y, yo, yi, 2) + .split(c, co, ci, 16) + .fuse(yo, co, tile).fuse(n, tile, tile) + .parallel(tile) + .unroll(yi) + .vectorize(x, outW >= 16 ? 16 : outW); + padded_input.compute_at(top, yi); +#endif // HAVE_HALIDE + } +}; + +//TODO: simultaneously convolution and bias addition for cache optimization +class ConvolutionLayerImpl : public BaseConvolutionLayerImpl +{ +public: + enum { VEC_ALIGN = 8, DFT_TYPE = CV_32F }; + Mat weightsMat; + std::vector biasvec; + std::vector reluslope; + Ptr activ; + Ptr bnorm; + + MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const + { + Size out(outShape[3], outShape[2]); + int inpGroupCn = blobs[0].size[1]; + int ksize = inpGroupCn * kernel.height * kernel.width; + return shape(out.area(), ksize); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(blobs.size() != 0); + CV_Assert(!hasBias() || blobs[1].total() == (size_t)blobs[0].size[0]); + CV_Assert(inputs.size() == (size_t)1); + + internals.clear(); + + int inpCn = inputs[0][1]; + int inpH = inputs[0][2]; + int inpW = inputs[0][3]; + + int outCn = blobs[0].size[0]; + Size out; + + if (padMode.empty()) + { + out.height = (inpH + 2 * pad.height - (dilation.height * (kernel.height - 1) + 1)) / stride.height + 1; + out.width = (inpW + 2 * pad.width - (dilation.width * (kernel.width - 1) + 1)) / stride.width + 1; + } + else + { + getConvPoolOutParams(Size(inpH, inpW), kernel, stride, padMode, out); + } + + int ngroups = inpCn / blobs[0].size[1]; + CV_Assert(inpCn % ngroups == 0 && outCn % ngroups == 0); + + int dims[] = {inputs[0][0], outCn, out.height, out.width}; + outputs.resize(inputs.size(), shape(dims)); + + return false; + } + + bool setActivation(const Ptr& layer) { activ = layer; return true; } + bool setBatchNorm(const Ptr& layer ) + { + bnorm = layer; + // we will need to re-compute the weights with the batch + // norm coefficients taken into account + weightsMat.release(); + return true; + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + + const int inpCn = inputBuffer.channels(); + const int outCn = blobs[0].size[0]; + const int inpGroupCn = blobs[0].size[1]; + const int group = inpCn / inpGroupCn; + const int outGroupCn = outCn / group; + + Halide::Buffer weights = wrapToHalideBuffer(blobs[0]); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Func padded_input(name + "_constant_exterior"); + if (pad.width || pad.height) + { + Halide::Func bounded = + Halide::BoundaryConditions::constant_exterior(inputBuffer, 0); + padded_input(x, y, c, n) = bounded(x, y, c, n); + } + else + { + padded_input(x, y, c, n) = inputBuffer(x, y, c, n); + } + + Halide::RDom r(0, kernel.width, 0, kernel.height, 0, inpGroupCn); + + Halide::Expr kc = r.z; + if (group > 1) + { + int outCnBound = outGroupCn; + int inpChBound = inpGroupCn; + Halide::Expr shift = select(c < outCnBound, 0, inpChBound); + for (int i = 2; i < group; ++i) + { + outCnBound += outGroupCn; + inpChBound += inpGroupCn; + shift = select(c < outCnBound, shift, inpChBound); + } + kc += shift; + } + + Halide::Expr kx = x * stride.width - pad.width + r.x * dilation.width; + Halide::Expr ky = y * stride.height - pad.height + r.y * dilation.height; + Halide::Expr topExpr = sum(padded_input(kx, ky, kc, n) * + weights(r.x, r.y, r.z, c)); + if (hasBias()) + { + Halide::Buffer bias = wrapToHalideBuffer(blobs[1], {outCn}); + topExpr += bias(c); + } + top(x, y, c, n) = topExpr; + Ptr pp(new HalideBackendNode({ padded_input, top })); + return Ptr(new HalideBackendNode({ padded_input, top })); +#endif // HAVE_HALIDE + return Ptr(); + } + + class ParallelConv : public cv::ParallelLoopBody + { + public: + enum { BLK_SIZE = 32, BLK_SIZE_CN = 64 }; + + const Mat* input_; + const Mat* weights_; + Mat* output_; + int outShape[4]; + Size kernel_, pad_, stride_, dilation_; + int ngroups_, nstripes_; + std::vector ofstab_; + const std::vector* biasvec_; + const std::vector* reluslope_; + const ActivationLayer* activ_; + bool is1x1_; + bool useAVX2; + + ParallelConv() {} + + static void run( const Mat& input, Mat& output, const Mat& weights, + const std::vector& biasvec, + const std::vector& reluslope, + Size kernel, Size pad, Size stride, Size dilation, + int ngroups, int nstripes, const ActivationLayer* activ ) + { + CV_Assert( input.dims == 4 && output.dims == 4 && + input.size[0] == output.size[0] && + weights.rows == output.size[1] && + weights.cols == (input.size[1]/ngroups)*kernel.width*kernel.height && + input.type() == output.type() && + input.type() == weights.type() && + input.type() == CV_32F && + input.isContinuous() && + output.isContinuous() && + biasvec.size() == (size_t)output.size[1]+2); + ParallelConv p; + + p.input_ = &input; + p.weights_ = &weights; + p.output_ = &output; + for( int i = 0; i < 4; i++ ) p.outShape[i] = output.size[i]; + p.outShape[1] /= ngroups; + p.kernel_ = kernel; p.pad_ = pad; p.stride_ = stride; p.dilation_ = dilation; + p.ngroups_ = ngroups; + p.nstripes_ = nstripes; + + int inpCnAll = input.size[1], width = input.size[3], height = input.size[2]; + int inpCn = inpCnAll / ngroups; + p.is1x1_ = kernel == Size(0,0) && pad == Size(0, 0); + p.useAVX2 = checkHardwareSupport(CPU_AVX2); + + int ncn = std::min(inpCn, (int)BLK_SIZE_CN); + p.ofstab_.resize(kernel.width*kernel.height*ncn); + int* ofstab = &p.ofstab_[0]; + + for( int k = 0; k < ncn; k++ ) + for( int k_r = 0; k_r < kernel.height; k_r++ ) + for( int k_c = 0; k_c < kernel.width; k_c++ ) + ofstab[(k*kernel.height + k_r)*kernel.width + k_c] = + (k*height + k_r*dilation.height)*width + k_c*dilation.width; + + p.biasvec_ = &biasvec; + p.reluslope_ = &reluslope; + p.activ_ = p.reluslope_->empty() ? activ : 0; + + parallel_for_(Range(0, nstripes), p, nstripes); + } + + virtual void operator ()(const Range &r0) const + { + const int valign = ConvolutionLayerImpl::VEC_ALIGN; + int ngroups = ngroups_, batchSize = input_->size[0]*ngroups; + int outW = output_->size[3], outH = output_->size[2], outCn = output_->size[1]/ngroups; + int width = input_->size[3], height = input_->size[2], inpCn = input_->size[1]/ngroups; + int nstripes = nstripes_; + int kernel_w = kernel_.width, kernel_h = kernel_.height; + int pad_w = pad_.width, pad_h = pad_.height; + int stride_w = stride_.width, stride_h = stride_.height; + int dilation_w = dilation_.width, dilation_h = dilation_.height; + int karea = kernel_w*kernel_h; + int i, j, k; + size_t inpPlaneSize = width*height; + size_t outPlaneSize = outW*outH; + bool is1x1 = is1x1_; + + int stripesPerSample; + size_t stripeSize; + Range r = r0; + + if( nstripes >= batchSize*2 ) + { + stripesPerSample = nstripes/batchSize; + stripeSize = alignSize((outPlaneSize + stripesPerSample - 1)/stripesPerSample, valign); + stripeSize = std::min(stripeSize, outPlaneSize); + } + else + { + stripesPerSample = 1; + int samplesPerStripe = std::max((batchSize + nstripes - 1)/nstripes, 1); + r.start *= samplesPerStripe; + r.end *= samplesPerStripe; + nstripes *= samplesPerStripe; + stripeSize = outPlaneSize; + } + + const float* data_inp0_ = input_->ptr(); + const int* ofstab = &ofstab_[0]; + const float* wptr_orig_ = weights_->ptr(); + size_t wstep = weights_->step1(); + const float* biasptr_ = &biasvec_->at(0); + const float* reluptr_ = reluslope_->empty() ? 0 : &reluslope_->at(0); + float* data_out0_ = output_->ptr(); + size_t rowbufsz = (size_t)karea*BLK_SIZE_CN*BLK_SIZE; + AutoBuffer rowbuf0_(rowbufsz + valign); + float* rowbuf0 = alignPtr((float*)rowbuf0_, (int)(valign*sizeof(float))); + + // we clear the buffer once; ultimately, it lets us to avoid + // tail processing after running the unrolled/vectorized loop. + // the main idea is to make sure that the tail (a.k.a. padding) of each row + // (i.e. the elements with indices between vsz=karea*ncn and vsz_a) + // does not contain NaNs or Infs. Because the padding in the weights + // matrix is explicitly initialized with 0's, we handle all other + // cases nicely, i.e. we can skip expliciting re-initialization + // of the padding - we just retain elements from the previous iteration + // of the loop over channels (cn0). + memset(rowbuf0, 0, rowbufsz*sizeof(rowbuf0[0]) ); + + for( int stripe = r.start; stripe < r.end; stripe++ ) + { + int subsampleIdx = stripe/stripesPerSample; + if( subsampleIdx >= batchSize ) + break; + int stripeStart = (int)((stripe - subsampleIdx*stripesPerSample)*stripeSize); + int stripeEnd = (int)std::min(stripeStart + stripeSize, outPlaneSize); + const float* data_inp0 = data_inp0_ + subsampleIdx*inpPlaneSize*inpCn; + float* data_out0 = data_out0_ + subsampleIdx*outPlaneSize*outCn; + int startOutCn = (subsampleIdx % ngroups)*outCn; + const float* wptr_orig = wptr_orig_ + wstep*startOutCn; + const float* biasptr = biasptr_ + startOutCn; + + for( int cn0 = 0; cn0 < inpCn; cn0 += BLK_SIZE_CN ) + { + int cn1 = std::min(cn0 + BLK_SIZE_CN, inpCn); + int ncn = cn1 - cn0, vsz = karea*ncn; + int vsz_a = (int)alignSize(vsz, valign); + const float* wptr = wptr_orig + cn0*karea; + // we apply [Channels][P]ReLU (if any) during the final pass only. + const float* relu = cn1 == inpCn && reluptr_ ? reluptr_ + startOutCn : 0; + + for( int ofs0 = stripeStart; ofs0 < stripeEnd; ofs0 += BLK_SIZE ) + { + int ofs, ofs1 = std::min(ofs0 + BLK_SIZE, stripeEnd); + + // do im2row for a part of input tensor + if( is1x1 ) + { + for( ofs = ofs0; ofs < ofs1; ofs++ ) + { + int out_i = ofs / outW; + int out_j = ofs - out_i * outW; + float* rowbuf = rowbuf0 + (ofs - ofs0)*vsz_a; + + int in_i = out_i * stride_h - pad_h; + int in_j = out_j * stride_w - pad_w; + const float* imgptr = data_inp0 + (cn0*height + in_i)*width + in_j; + + for( k = 0; k < vsz; k++ ) + rowbuf[k] = imgptr[k*inpPlaneSize]; + } + } + else + { + for( ofs = ofs0; ofs < ofs1; ofs++ ) + { + int out_i = ofs / outW; + int out_j = ofs - out_i * outW; + float* rowbuf = rowbuf0 + (ofs - ofs0)*vsz_a; + + int in_i = out_i * stride_h - pad_h; + int in_j = out_j * stride_w - pad_w; + const float* imgptr = data_inp0 + (cn0*height + in_i)*width + in_j; + + // this condition should be true for most of the tensor elements, i.e. + // most of the time the kernel aperture is inside the tensor X-Y plane. + if( 0 <= in_i && in_i < height - (kernel_h-1)*dilation_h && + 0 <= in_j && in_j < width - (kernel_w-1)*dilation_w ) + { + for( k = 0; k < vsz; k++ ) + rowbuf[k] = imgptr[ofstab[k]]; + } + else + { + int i0 = std::max(0, (-in_i + dilation_h-1)/dilation_h); + int i1 = std::min(kernel_h, (height - in_i + dilation_h-1)/dilation_h); + int j0 = std::max(0, (-in_j + dilation_w-1)/dilation_w); + int j1 = std::min(kernel_w, (width - in_j + dilation_w-1)/dilation_w); + + // here some non-continous sub-row of the row will not be + // filled from the tensor; we need to make sure that the uncovered + // elements are explicitly set to 0's. the easiest way is to + // set all the elements to 0's before the loop. + memset(rowbuf, 0, vsz*sizeof(rowbuf[0])); + for( k = 0; k < ncn; k++, imgptr += width*height ) + { + for( i = i0; i < i1; i++ ) + { + for( j = j0; j < j1; j++ ) + { + int imgofs = i*(dilation_h*width) + j*dilation_w; + rowbuf[(k*kernel_h + i)*kernel_w + j] = imgptr[imgofs]; + } + } + } + } + } + } + + // now compute dot product of the weights + // and im2row-transformed part of the tensor + int bsz = ofs1 - ofs0; + #if CV_DNN_TRY_AVX2 + if(useAVX2) + fastConv_avx2(wptr, wstep, biasptr, rowbuf0, data_out0 + ofs0, + outShape, bsz, vsz, vsz_a, relu, cn0 == 0); + else + #endif + for( int i = 0; i < outCn; i += 2 ) + { + const float* wptr0 = wptr + i*wstep; + const float* wptr1 = wptr0 + wstep; + float* outptr0 = data_out0 + ofs0 + i*outPlaneSize; + float* outptr1 = outptr0 + outPlaneSize; + float bias0 = biasptr[i], bias1 = biasptr[i+1]; + float r0 = 1.f, r1 = 1.f; + + if( i+1 >= outCn ) + { + wptr1 = wptr0; + outptr1 = outptr0; + bias1 = bias0; + } + + if( relu ) + { + r0 = relu[i]; + r1 = relu[i+1]; + } + + int j = 0; + #if CV_SIMD128 + v_float32x4 vr0 = v_setall_f32(r0), vr1 = v_setall_f32(r1), z = v_setzero_f32(); + + for( ; j <= bsz - 4; j += 4 ) + { + const float* rptr = rowbuf0 + j*vsz_a; + v_float32x4 s0, s1; + + if( cn0 == 0 ) + { + s0 = v_setall_f32(bias0); + s1 = v_setall_f32(bias1); + } + else + { + s0 = v_load(outptr0 + j); + s1 = v_load(outptr1 + j); + } + + v_float32x4 vs00 = v_setzero_f32(), vs01 = v_setzero_f32(), + vs02 = v_setzero_f32(), vs03 = v_setzero_f32(), + vs10 = v_setzero_f32(), vs11 = v_setzero_f32(), + vs12 = v_setzero_f32(), vs13 = v_setzero_f32(); + for( k = 0; k < vsz; k += 4, rptr += 4 ) + { + v_float32x4 w0 = v_load_aligned(wptr0 + k), w1 = v_load_aligned(wptr1 + k); + v_float32x4 r0 = v_load_aligned(rptr), r1 = v_load_aligned(rptr + vsz_a), + r2 = v_load_aligned(rptr + vsz_a*2), r3 = v_load_aligned(rptr + vsz_a*3); + + vs00 += w0*r0; + vs01 += w0*r1; + vs02 += w0*r2; + vs03 += w0*r3; + + vs10 += w1*r0; + vs11 += w1*r1; + vs12 += w1*r2; + vs13 += w1*r3; + } + s0 += v_reduce_sum4(vs00, vs01, vs02, vs03); + s1 += v_reduce_sum4(vs10, vs11, vs12, vs13); + if( relu ) + { + s0 = v_select(s0 > z, s0, s0*vr0); + s1 = v_select(s1 > z, s1, s1*vr1); + } + + v_store(outptr0 + j, s0); + v_store(outptr1 + j, s1); + } + #endif + for( ; j < bsz; j++ ) + { + const float* rptr = rowbuf0 + j*vsz_a; + float s00, s10; + + if( cn0 == 0 ) + { + s00 = bias0; + s10 = bias1; + } + else + { + s00 = outptr0[j]; + s10 = outptr1[j]; + } + + for( k = 0; k < vsz; k++ ) + { + float r0 = rptr[k]; + s00 += wptr0[k]*r0; + s10 += wptr1[k]*r0; + } + if( relu ) + { + s00 = s00 > 0.f ? s00 : s00*r0; + s10 = s10 > 0.f ? s10 : s10*r1; + } + + outptr0[j] = s00; + outptr1[j] = s10; + } + } + } + } + + if( activ_ ) + activ_->forwardSlice(data_out0 + stripeStart, data_out0 + stripeStart, + (int)(stripeEnd - stripeStart), + outPlaneSize, startOutCn, startOutCn + outCn); + } + } + }; + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + /*printf("conv %s: input (%d x %d x %d x %d), kernel (%d x %d), pad (%d x %d), stride (%d x %d), dilation (%d x %d)\n", + name.c_str(), inputs[0]->size[0], inputs[0]->size[1], inputs[0]->size[2], inputs[0]->size[3], + kernel.width, kernel.height, pad.width, pad.height, + stride.width, stride.height, dilation.width, dilation.height);*/ + CV_Assert(inputs.size() == (size_t)1 && inputs[0]->size[1] % blobs[0].size[1] == 0); + int ngroups = inputs[0]->size[1]/blobs[0].size[1]; + CV_Assert(outputs[0].size[1] % ngroups == 0); + + int k, outCn = blobs[0].size[0]; + + if( weightsMat.empty() ) + { + // prepare weightsMat where each row is aligned and has enough zero padding on the right to + // use vectorized (i.e. with intrinsics) loops without tail processing + Mat wm = blobs[0].reshape(1, outCn).clone(); + if( wm.step1() % VEC_ALIGN != 0 ) + { + int newcols = (int)alignSize(wm.step1(), VEC_ALIGN); + Mat wm_buffer = Mat(outCn, newcols, wm.type()); + Mat wm_padding = wm_buffer.colRange(wm.cols, newcols); + wm_padding.setTo(Scalar::all(0.)); + Mat wm_aligned = wm_buffer.colRange(0, wm.cols); + wm.copyTo(wm_aligned); + wm = wm_aligned; + } + weightsMat = wm; + + Mat biasMat = hasBias() ? blobs[1].reshape(1, outCn) : Mat(); + biasvec.resize(outCn+2); + if( biasMat.empty() ) + { + for( k = 0; k < outCn; k++ ) + biasvec[k] = 0.f; + } + else + { + for( k = 0; k < outCn; k++ ) + biasvec[k] = biasMat.at(k); + } + + if( !bnorm.empty() ) + { + Mat scale, shift; + bnorm->getScaleShift(scale, shift); + + CV_Assert( scale.isContinuous() && shift.isContinuous() && + scale.type() == CV_32F && shift.type() == CV_32F && + scale.total() == (size_t)outCn && + shift.total() == (size_t)outCn ); + + for( int i = 0; i < outCn; i++ ) + { + float s = scale.at(i); + float delta = shift.at(i); + float* w_i = weightsMat.ptr(i); + int j, wcols = weightsMat.cols; + + for( j = 0; j < wcols; j++ ) + w_i[j] *= s; + + biasvec[i] = biasvec[i]*s + delta; + } + } + biasvec[outCn] = biasvec[outCn+1] = biasvec[outCn-1]; + } + + if( activ ) + { + Ptr activ_relu = activ.dynamicCast(); + if( !activ_relu.empty() ) + reluslope.assign(outCn+2, activ_relu->negativeSlope); + + Ptr activ_chprelu = activ.dynamicCast(); + if( !activ_chprelu.empty() ) + { + const Mat& m = activ_chprelu->blobs[0]; + CV_Assert(m.isContinuous() && m.type() == CV_32F && (int)m.total() == outCn); + const float* mdata = m.ptr(); + reluslope.resize(outCn+2); + std::copy(mdata, mdata + outCn, reluslope.begin()); + reluslope[outCn] = reluslope[outCn+1] = reluslope[outCn-1]; + } + } + + int nstripes = std::max(getNumThreads(), 1); + + ParallelConv::run(*inputs[0], outputs[0], weightsMat, biasvec, reluslope, + kernel, pad, stride, dilation, ngroups, nstripes, activ.get()); + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + CV_Assert(inputs.size() == outputs.size()); + + int64 flops = 0; + for (int i = 0; i < inputs.size(); i++) + { + flops += total(outputs[i])*(2*kernel.area()*inputs[i][1] + 1); + } + + return flops; + } +}; + +class DeConvolutionLayerImpl : public BaseConvolutionLayerImpl +{ +public: + Mat weightsMat, biasesMat; + + MatShape computeColRowShape(const MatShape &inpShape, const MatShape &outShape) const + { + int inpCn = inpShape[1]; + int inpH = inpShape[2]; + int inpW = inpShape[3]; + int outCn = outShape[1]; + int ngroups = inpCn / blobs[0].size[1]; + int outGroupCn = outCn / ngroups; + int ksize = outGroupCn * kernel.height * kernel.width; + return shape(ksize, inpH * inpW); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(!hasBias() || blobs[1].total() == (size_t)blobs[0].size[0]); + CV_Assert(inputs.size() != 0); + + int inpCn = inputs[0][1]; + int inpH = inputs[0][2]; + int inpW = inputs[0][3]; + + int outH = stride.height * (inpH - 1) + kernel.height - 2 * pad.height + adjustPad.height; + int outW = stride.width * (inpW - 1) + kernel.width - 2 * pad.width + adjustPad.width; + int outCn = blobs[0].size[0]; + + int ngroups = inpCn / blobs[0].size[1]; + + CV_Assert(inpCn % ngroups == 0 && outCn % ngroups == 0); + CV_Assert(blobs[0].size[0] == outCn && blobs[0].size[1] == inpCn / ngroups); + + int dims[] = {inputs[0][0], outCn, outH, outW}; + outputs.resize(inputs.size(), shape(dims)); + + internals.push_back(MatShape()); + if (!is1x1()) + internals[0] = computeColRowShape(inputs[0], outputs[0]); + + if (hasBias()) + internals.push_back(shape(1, outH*outW)); + + return false; + } + + class MatMulInvoker : public ParallelLoopBody + { + public: + MatMulInvoker(const Mat& a, const Mat& b, Mat& c, int nstripes) + { + a_ = &a; + b_ = &b; + c_ = &c; + nstripes_ = nstripes; + useAVX2 = checkHardwareSupport(CPU_AVX2); + } + + void operator()(const Range& range_) const + { + int stripeSize = (int)alignSize((b_->cols + nstripes_ - 1)/nstripes_, 16); + Range range(range_.start*stripeSize, std::min(range_.end*stripeSize, b_->cols)); + int mmax = a_->rows; + int nmax = range.end - range.start; + int kmax = a_->cols; + int m, n, k; + const float* aptr = a_->ptr(); + const float* bptr = b_->ptr() + range.start; + float* cptr = c_->ptr() + range.start; + size_t astep = a_->step1(); + size_t bstep = b_->step1(); + size_t cstep = c_->step1(); + + #if CV_DNN_TRY_AVX2 + if( useAVX2 ) + fastGEMM_avx2( aptr, astep, bptr, bstep, cptr, cstep, mmax, kmax, nmax ); + else + #endif + for( m = 0; m < mmax; m += 2 ) + { + float* dst0 = cptr + cstep*m; + float* dst1 = cptr + cstep*std::min(m+1, mmax-1); + const float* aptr0 = aptr + astep*m; + const float* aptr1 = aptr + astep*std::min(m+1, mmax-1); + + for( n = 0; n < nmax; n++ ) + { + dst0[n] = 0.f; + dst1[n] = 0.f; + } + + for( k = 0; k < kmax; k += 4 ) + { + float alpha00 = aptr0[k]; + float alpha01 = aptr1[k]; + float alpha10 = 0.f, alpha11 = 0.f; + float alpha20 = 0.f, alpha21 = 0.f; + float alpha30 = 0.f, alpha31 = 0.f; + const float* bptr0 = bptr + k*bstep; + const float* bptr1 = bptr0; + const float* bptr2 = bptr0; + const float* bptr3 = bptr0; + + if( k+1 < kmax ) + { + alpha10 = aptr0[k+1]; + alpha11 = aptr1[k+1]; + bptr1 = bptr0 + bstep; + if( k+2 < kmax ) + { + alpha20 = aptr0[k+2]; + alpha21 = aptr1[k+2]; + bptr2 = bptr1 + bstep; + if( k+3 < kmax ) + { + alpha30 = aptr0[k+3]; + alpha31 = aptr1[k+3]; + bptr3 = bptr2 + bstep; + } + } + } + n = 0; + + #if CV_SIMD128 + v_float32x4 a00 = v_setall_f32(alpha00); + v_float32x4 a01 = v_setall_f32(alpha01); + v_float32x4 a10 = v_setall_f32(alpha10); + v_float32x4 a11 = v_setall_f32(alpha11); + v_float32x4 a20 = v_setall_f32(alpha20); + v_float32x4 a21 = v_setall_f32(alpha21); + v_float32x4 a30 = v_setall_f32(alpha30); + v_float32x4 a31 = v_setall_f32(alpha31); + + for( ; n <= nmax - 4; n += 4 ) + { + v_float32x4 b0 = v_load(bptr0 + n); + v_float32x4 b1 = v_load(bptr1 + n); + v_float32x4 b2 = v_load(bptr2 + n); + v_float32x4 b3 = v_load(bptr3 + n); + v_float32x4 d0 = v_load(dst0 + n); + v_float32x4 d1 = v_load(dst1 + n); + d0 += b0*a00; + d1 += b0*a01; + d0 += b1*a10; + d1 += b1*a11; + d0 += b2*a20; + d1 += b2*a21; + d0 += b3*a30; + d1 += b3*a31; + v_store(dst0 + n, d0); + v_store(dst1 + n, d1); + } + #endif + + for( ; n < nmax; n++ ) + { + float b0 = bptr0[n], b1 = bptr1[n]; + float b2 = bptr2[n], b3 = bptr3[n]; + float d0 = dst0[n] + alpha00*b0 + alpha10*b1 + alpha20*b2 + alpha30*b3; + float d1 = dst1[n] + alpha01*b0 + alpha11*b1 + alpha21*b2 + alpha31*b3; + dst0[n] = d0; + dst1[n] = d1; + } + } + } + } + + const Mat *a_, *b_; + Mat* c_; + int nstripes_; + bool useAVX2; + }; + + class Col2ImInvoker : public cv::ParallelLoopBody + { + public: + const float* data_col; + const float* biasvec; + int channels, height, width; + int kernel_h, kernel_w; + int pad_h, pad_w; + int stride_h, stride_w; + float* data_im; + int height_col, width_col; + int nstripes; + bool is1x1; + + Col2ImInvoker() {} + + static void run(const float* data_col, + int channels, int height, int width, + int kernel_h, int kernel_w, + int pad_h, int pad_w, + int stride_h, int stride_w, + float* data_im, + const float* biasvec, + bool is1x1) + { + const int nstripes = getNumThreads(); + + Col2ImInvoker t; + t.data_col = data_col; + t.data_im = data_im; + t.channels = channels; t.height = height; t.width = width; + t.kernel_h = kernel_h; t.kernel_w = kernel_w; + t.pad_h = pad_h; t.pad_w = pad_w; + t.stride_h = stride_h; t.stride_w = stride_w; + t.height_col = (height + 2 * pad_h - kernel_h) / stride_h + 1; + t.width_col = (width + 2 * pad_w - kernel_w) / stride_w + 1; + t.nstripes = nstripes; + t.is1x1 = is1x1; + t.biasvec = biasvec; + + parallel_for_(Range(0, nstripes), t, nstripes); + } + + virtual void operator ()(const Range &r) const + { + const float* data_col_ = data_col; + float* data_im_ = data_im; + int coeff_h = (1 - stride_h * kernel_w * height_col) * width_col; + int coeff_w = (1 - stride_w * height_col * width_col); + size_t total = (size_t)channels * height * width; + size_t stripeSize = (total + nstripes - 1)/nstripes; + size_t startIndex = r.start*stripeSize; + size_t endIndex = std::min(r.end*stripeSize, total); + int w = (int)(startIndex % width + pad_w); + int h = (int)((startIndex / width) % height + pad_h); + int c = (int)(startIndex / (width * height)); + int h_col_start = (h < kernel_h) ? 0 : (h - kernel_h) / stride_h + 1; + int h_col_end = std::min(h / stride_h + 1, height_col); + int plane_size_col = height_col * width_col; + int offset = (c * kernel_h * kernel_w + h * kernel_w + w) * plane_size_col; + bool is1x1_ = is1x1; + const float* biasvec_ = biasvec; + + for (size_t index = startIndex; index < endIndex; index++) + { + // compute the start and end of the output + int w_col_start = (w < kernel_w) ? 0 : (w - kernel_w) / stride_w + 1; + int w_col_end = std::min(w / stride_w + 1, width_col); + float val; + + if( is1x1_ ) + val = data_im_[index]; + else + { + val = 0.f; + for (int h_col = h_col_start; h_col < h_col_end; ++h_col) { + for (int w_col = w_col_start; w_col < w_col_end; ++w_col) { + val += data_col_[offset + h_col * coeff_h + w_col * coeff_w]; + } + } + } + data_im_[index] = val + biasvec_[c]; + + offset += plane_size_col; + if( ++w >= width + pad_w ) + { + w = (int)((index + 1)% width + pad_w); + h = (int)(((index + 1) / width) % height + pad_h); + c = (int)((index + 1) / (width * height)); + h_col_start = (h < kernel_h) ? 0 : (h - kernel_h) / stride_h + 1; + h_col_end = std::min(h / stride_h + 1, height_col); + offset = (c * kernel_h * kernel_w + h * kernel_w + w) * plane_size_col; + } + } + } + }; + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + int outCn = blobs[0].size[0]; + int inpCn = inputs[0]->size[1]; + bool is1x1flag = is1x1(); + int nstripes = getNumThreads(); + + if( weightsMat.empty() ) + { + transpose(blobs[0].reshape(1, inpCn), weightsMat); + biasesMat = hasBias() ? blobs[1].reshape(1, outCn) : Mat::zeros(outCn, 1, CV_32F); + } + + for (size_t ii = 0; ii < outputs.size(); ii++) + { + int ngroups = inpCn / blobs[0].size[1]; + int inpGroupCn = blobs[0].size[1]; + int outGroupCn = outCn / ngroups; + const Mat& inp = *inputs[ii]; + Mat& out = outputs[ii]; + int numImg = inp.size[0]; + int outH = out.size[2], outW = out.size[3]; + + Mat convBlob = inputs[ii]->reshape(1, numImg*inpCn); + Mat decnBlob = out.reshape(1, numImg*outCn); + + for (int n = 0; n < numImg; n++) + { + for (int g = 0; g < ngroups; g++) + { + Mat dstMat = decnBlob.rowRange(_Range((g + n * ngroups) * outGroupCn, outGroupCn)); + Mat &colMat = is1x1flag ? dstMat : internals[0]; + + Mat convMat = convBlob.rowRange(_Range((g + n * ngroups) * inpGroupCn, inpGroupCn)); + Mat wghtMat = weightsMat.colRange(_Range(g * inpGroupCn, inpGroupCn)); + Mat curBiasMat = biasesMat.rowRange(_Range(g * outGroupCn, outGroupCn)); + + //gemm(wghtMat, convMat, 1, colMat, 0, colMat, 0); + MatMulInvoker mminvoker(wghtMat, convMat, colMat, nstripes); + parallel_for_(Range(0, nstripes), mminvoker, nstripes); + + Col2ImInvoker::run(colMat.ptr(), outGroupCn, outH, outW, + kernel.height, kernel.width, pad.height, pad.width, + stride.height, stride.width, dstMat.ptr(), + curBiasMat.ptr(), is1x1flag); + } + } + } + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + + int inW, inH, inC, inN, outC = blobs[0].size[0]; + getCanonicalSize(inputBuffer, &inW, &inH, &inC, &inN); + + if (inC / blobs[0].size[1] != 1) + CV_Error(cv::Error::StsNotImplemented, + "Halide backend for Deconvolution with group > 1 is not implemented"); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Func padded_input(name + "_constant_exterior"); + auto weights = wrapToHalideBuffer(blobs[0], {kernel.width, + kernel.height, outC, inC}); + + Halide::Func dilated_input("dilated_input"); + dilated_input(x, y, c, n) = 0.0f; + Halide::RDom r1(0, inW, 0, inH); + dilated_input(r1.x * stride.width, r1.y * stride.height, c, n) = + inputBuffer(r1.x, r1.y, c, n); + dilated_input.compute_root(); + + Halide::Func bounded = + Halide::BoundaryConditions::constant_exterior(dilated_input, 0, + 0, (inW - 1) * stride.width + 1, + 0, (inH - 1) * stride.height + 1, + 0, inC, 0, inN); + padded_input(x, y, c, n) = bounded(x, y, c, n); + + Halide::RDom r(0, kernel.width, 0, kernel.height, 0, inC); + Halide::Expr topExpr = sum( + padded_input(x + pad.width - r.x, y + pad.height - r.y, r.z, n) * + weights(r.x, r.y, c, r.z)); + if (hasBias()) + { + auto bias = wrapToHalideBuffer(blobs[1], {outC}); + topExpr += bias(c); + } + top(x, y, c, n) = topExpr; + return Ptr(new HalideBackendNode({ padded_input, top })); +#endif // HAVE_HALIDE + return Ptr(); + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + CV_Assert(inputs.size() == outputs.size()); + + float flops = 0; + int outChannels = blobs[0].size[0]; + + for (int i = 0; i < inputs.size(); i++) + { + flops += 2*outChannels*kernel.area()*total(inputs[i]); + } + + return flops; + } +}; + +//Convolution and Deconvolution +static void initConvDeconvLayerFromCaffe(Ptr l, const LayerParams ¶ms) +{ + l->setParamsFrom(params); + getConvolutionKernelParams(params, l->kernel.height, l->kernel.width, l->pad.height, + l->pad.width, l->stride.height, l->stride.width, l->dilation.height, + l->dilation.width, l->padMode); + + bool bias = params.get("bias_term", true); + int numOutput = params.get("num_output"); + int ngroups = params.get("group", 1); + + l->adjustPad.height = params.get("adj_h", 0); + l->adjustPad.width = params.get("adj_w", 0); + + CV_Assert(numOutput % ngroups == 0); + CV_Assert((bias && l->blobs.size() == 2) || (!bias && l->blobs.size() == 1)); + CV_Assert(l->adjustPad.width < l->stride.width && + l->adjustPad.height < l->stride.height); +} + +Ptr ConvolutionLayer::create(const LayerParams ¶ms) +{ + Ptr l(new ConvolutionLayerImpl); + initConvDeconvLayerFromCaffe(l, params); + return l; +} + +Ptr DeconvolutionLayer::create(const LayerParams ¶ms) +{ + Ptr l(new DeConvolutionLayerImpl); + initConvDeconvLayerFromCaffe(l, params); + + return l; +} + +} +} diff --git a/modules/dnn/src/layers/crop_layer.cpp b/modules/dnn/src/layers/crop_layer.cpp new file mode 100644 index 0000000000..5615033ccb --- /dev/null +++ b/modules/dnn/src/layers/crop_layer.cpp @@ -0,0 +1,153 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" + +namespace cv +{ +namespace dnn +{ + +class CropLayerImpl : public CropLayer +{ +public: + CropLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + startAxis = params.get("axis", 2); + const DictValue *paramOffset = params.ptr("offset"); + + if (paramOffset) + { + for (int i = 0; i < paramOffset->size(); i++) + offset.push_back(paramOffset->get(i)); + } + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() == 2); + + MatShape dstShape = inputs[0]; + int start = clamp(startAxis, dstShape); + for (int i = start; i < dstShape.size(); i++) + { + dstShape[i] = inputs[1][i]; + } + + outputs.resize(1, dstShape); + + return false; + } + + void finalize(const std::vector &inputs, std::vector &outputs) + { + CV_Assert(2 == inputs.size()); + + const Mat &inpBlob = *inputs[0]; + const Mat &inpSzBlob = *inputs[1]; + + int dims = inpBlob.dims; + int start_axis = clamp(startAxis, dims); + + std::vector offset_final(dims, 0); + if (offset.size() == 1) + { + for (int i = start_axis; i < dims; i++) + offset_final[i] = offset[0]; + } + else if (offset.size() > 1) + { + if ((int)offset.size() != dims - start_axis) + CV_Error(Error::StsBadArg, "number of offset values specified must be " + "equal to the number of dimensions following axis."); + + for (int i = start_axis; i < dims; i++) + offset_final[i] = offset[i - start_axis]; + } + + crop_ranges.resize(dims, Range::all()); + for (int i = 0; i < dims; i++) + { + if( i < start_axis ) + continue; + + if (!offset.empty()) //normal case + { + if (offset_final[i] < 0 || offset_final[i] + inpSzBlob.size[i] > inpBlob.size[i]) + CV_Error(Error::StsBadArg, "invalid crop parameters"); + + crop_ranges[i] = Range(offset_final[i], offset_final[i] + inpSzBlob.size[i]); + } + else //detect offset automatically so that cropped image is center of original one + { + if (inpSzBlob.size[i] > inpBlob.size[i]) + CV_Error(Error::StsBadArg, "invalid output blob size"); + + int cur_crop = (inpBlob.size[i] - inpSzBlob.size[i]) / 2; + crop_ranges[i] = Range(cur_crop, cur_crop + inpSzBlob.size[i]); + } + } + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + Mat &input = *inputs[0]; + Mat &output = outputs[0]; + + input(&crop_ranges[0]).copyTo(output); + } + + std::vector crop_ranges; +}; + + +Ptr CropLayer::create(const LayerParams& params) +{ + return Ptr(new CropLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/detection_output_layer.cpp b/modules/dnn/src/layers/detection_output_layer.cpp new file mode 100644 index 0000000000..463d0a093d --- /dev/null +++ b/modules/dnn/src/layers/detection_output_layer.cpp @@ -0,0 +1,798 @@ +/*M /////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include +#include +#include + +namespace cv +{ +namespace dnn +{ + +namespace util +{ + +template +std::string to_string(T value) +{ + std::ostringstream stream; + stream << value; + return stream.str(); +} + +template +void make_error(const std::string& message1, const T& message2) +{ + std::string error(message1); + error += std::string(util::to_string(message2)); + CV_Error(Error::StsBadArg, error.c_str()); +} + +template +bool SortScorePairDescend(const std::pair& pair1, + const std::pair& pair2) +{ + return pair1.first > pair2.first; +} + +} + +class DetectionOutputLayerImpl : public DetectionOutputLayer +{ +public: + unsigned _numClasses; + bool _shareLocation; + int _numLocClasses; + + int _backgroundLabelId; + + typedef caffe::PriorBoxParameter_CodeType CodeType; + CodeType _codeType; + + bool _varianceEncodedInTarget; + int _keepTopK; + float _confidenceThreshold; + + float _nmsThreshold; + int _topK; + + enum { _numAxes = 4 }; + static const std::string _layerName; + + typedef std::map > LabelBBox; + + bool getParameterDict(const LayerParams ¶ms, + const std::string ¶meterName, + DictValue& result) + { + if (!params.has(parameterName)) + { + return false; + } + + result = params.get(parameterName); + return true; + } + + template + T getParameter(const LayerParams ¶ms, + const std::string ¶meterName, + const size_t &idx=0, + const bool required=true, + const T& defaultValue=T()) + { + DictValue dictValue; + bool success = getParameterDict(params, parameterName, dictValue); + if(!success) + { + if(required) + { + std::string message = _layerName; + message += " layer parameter does not contain "; + message += parameterName; + message += " parameter."; + CV_Error(Error::StsBadArg, message); + } + else + { + return defaultValue; + } + } + return dictValue.get(idx); + } + + void getCodeType(const LayerParams ¶ms) + { + String codeTypeString = params.get("code_type").toLowerCase(); + if (codeTypeString == "corner") + _codeType = caffe::PriorBoxParameter_CodeType_CORNER; + else if (codeTypeString == "center_size") + _codeType = caffe::PriorBoxParameter_CodeType_CENTER_SIZE; + else + _codeType = caffe::PriorBoxParameter_CodeType_CORNER; + } + + DetectionOutputLayerImpl(const LayerParams ¶ms) + { + _numClasses = getParameter(params, "num_classes"); + _shareLocation = getParameter(params, "share_location"); + _numLocClasses = _shareLocation ? 1 : _numClasses; + _backgroundLabelId = getParameter(params, "background_label_id"); + _varianceEncodedInTarget = getParameter(params, "variance_encoded_in_target", 0, false, false); + _keepTopK = getParameter(params, "keep_top_k"); + _confidenceThreshold = getParameter(params, "confidence_threshold", 0, false, -FLT_MAX); + _topK = getParameter(params, "top_k", 0, false, -1); + + getCodeType(params); + + // Parameters used in nms. + _nmsThreshold = getParameter(params, "nms_threshold"); + CV_Assert(_nmsThreshold > 0.); + + setParamsFrom(params); + } + + void checkInputs(const std::vector &inputs) + { + for (size_t i = 1; i < inputs.size(); i++) + { + CV_Assert(inputs[i]->size == inputs[0]->size); + } + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() > 0); + CV_Assert(inputs[0][0] == inputs[1][0]); + + int numPriors = inputs[2][2] / 4; + CV_Assert((numPriors * _numLocClasses * 4) == inputs[0][1]); + CV_Assert(int(numPriors * _numClasses) == inputs[1][1]); + + // num() and channels() are 1. + // Since the number of bboxes to be kept is unknown before nms, we manually + // set it to (fake) 1. + // Each row is a 7 dimension std::vector, which stores + // [image_id, label, confidence, xmin, ymin, xmax, ymax] + outputs.resize(1, shape(1, 1, 1, 7)); + + return false; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + const float* locationData = inputs[0]->ptr(); + const float* confidenceData = inputs[1]->ptr(); + const float* priorData = inputs[2]->ptr(); + + int num = inputs[0]->size[0]; + int numPriors = inputs[2]->size[2] / 4; + + // Retrieve all location predictions. + std::vector allLocationPredictions; + GetLocPredictions(locationData, num, numPriors, _numLocClasses, + _shareLocation, &allLocationPredictions); + + // Retrieve all confidences. + std::vector > > allConfidenceScores; + GetConfidenceScores(confidenceData, num, numPriors, _numClasses, + &allConfidenceScores); + + // Retrieve all prior bboxes. It is same within a batch since we assume all + // images in a batch are of same dimension. + std::vector priorBBoxes; + std::vector > priorVariances; + GetPriorBBoxes(priorData, numPriors, &priorBBoxes, &priorVariances); + + const bool clip_bbox = false; + // Decode all loc predictions to bboxes. + std::vector allDecodedBBoxes; + DecodeBBoxesAll(allLocationPredictions, priorBBoxes, priorVariances, num, + _shareLocation, _numLocClasses, _backgroundLabelId, + _codeType, _varianceEncodedInTarget, clip_bbox, &allDecodedBBoxes); + + int numKept = 0; + std::vector > > allIndices; + for (int i = 0; i < num; ++i) + { + const LabelBBox& decodeBBoxes = allDecodedBBoxes[i]; + const std::map >& confidenceScores = + allConfidenceScores[i]; + std::map > indices; + int numDetections = 0; + for (int c = 0; c < (int)_numClasses; ++c) + { + if (c == _backgroundLabelId) + { + // Ignore background class. + continue; + } + if (confidenceScores.find(c) == confidenceScores.end()) + { + // Something bad happened if there are no predictions for current label. + util::make_error("Could not find confidence predictions for label ", c); + } + + const std::vector& scores = confidenceScores.find(c)->second; + int label = _shareLocation ? -1 : c; + if (decodeBBoxes.find(label) == decodeBBoxes.end()) + { + // Something bad happened if there are no predictions for current label. + util::make_error("Could not find location predictions for label ", label); + continue; + } + const std::vector& bboxes = + decodeBBoxes.find(label)->second; + ApplyNMSFast(bboxes, scores, _confidenceThreshold, _nmsThreshold, 1.0, + _topK, &(indices[c])); + numDetections += indices[c].size(); + } + if (_keepTopK > -1 && numDetections > _keepTopK) + { + std::vector > > scoreIndexPairs; + for (std::map >::iterator it = indices.begin(); + it != indices.end(); ++it) + { + int label = it->first; + const std::vector& labelIndices = it->second; + if (confidenceScores.find(label) == confidenceScores.end()) + { + // Something bad happened for current label. + util::make_error("Could not find location predictions for label ", label); + continue; + } + const std::vector& scores = confidenceScores.find(label)->second; + for (size_t j = 0; j < labelIndices.size(); ++j) + { + size_t idx = labelIndices[j]; + CV_Assert(idx < scores.size()); + scoreIndexPairs.push_back( + std::make_pair(scores[idx], std::make_pair(label, idx))); + } + } + // Keep outputs k results per image. + std::sort(scoreIndexPairs.begin(), scoreIndexPairs.end(), + util::SortScorePairDescend >); + scoreIndexPairs.resize(_keepTopK); + // Store the new indices. + std::map > newIndices; + for (size_t j = 0; j < scoreIndexPairs.size(); ++j) + { + int label = scoreIndexPairs[j].second.first; + int idx = scoreIndexPairs[j].second.second; + newIndices[label].push_back(idx); + } + allIndices.push_back(newIndices); + numKept += _keepTopK; + } + else + { + allIndices.push_back(indices); + numKept += numDetections; + } + } + + if (numKept == 0) + { + CV_ErrorNoReturn(Error::StsError, "Couldn't find any detections"); + return; + } + int outputShape[] = {1, 1, numKept, 7}; + outputs[0].create(4, outputShape, CV_32F); + float* outputsData = outputs[0].ptr(); + + int count = 0; + for (int i = 0; i < num; ++i) + { + const std::map >& confidenceScores = + allConfidenceScores[i]; + const LabelBBox& decodeBBoxes = allDecodedBBoxes[i]; + for (std::map >::iterator it = allIndices[i].begin(); + it != allIndices[i].end(); ++it) + { + int label = it->first; + if (confidenceScores.find(label) == confidenceScores.end()) + { + // Something bad happened if there are no predictions for current label. + util::make_error("Could not find confidence predictions for label ", label); + continue; + } + const std::vector& scores = confidenceScores.find(label)->second; + int locLabel = _shareLocation ? -1 : label; + if (decodeBBoxes.find(locLabel) == decodeBBoxes.end()) + { + // Something bad happened if there are no predictions for current label. + util::make_error("Could not find location predictions for label ", locLabel); + continue; + } + const std::vector& bboxes = + decodeBBoxes.find(locLabel)->second; + std::vector& indices = it->second; + + for (size_t j = 0; j < indices.size(); ++j) + { + int idx = indices[j]; + outputsData[count * 7] = i; + outputsData[count * 7 + 1] = label; + outputsData[count * 7 + 2] = scores[idx]; + caffe::NormalizedBBox clipBBox = bboxes[idx]; + outputsData[count * 7 + 3] = clipBBox.xmin(); + outputsData[count * 7 + 4] = clipBBox.ymin(); + outputsData[count * 7 + 5] = clipBBox.xmax(); + outputsData[count * 7 + 6] = clipBBox.ymax(); + + ++count; + } + } + } + } + + // Compute bbox size. + float BBoxSize(const caffe::NormalizedBBox& bbox, + const bool normalized=true) + { + if (bbox.xmax() < bbox.xmin() || bbox.ymax() < bbox.ymin()) + { + // If bbox is invalid (e.g. xmax < xmin or ymax < ymin), return 0. + return 0; + } + else + { + if (bbox.has_size()) + { + return bbox.size(); + } + else + { + float width = bbox.xmax() - bbox.xmin(); + float height = bbox.ymax() - bbox.ymin(); + if (normalized) + { + return width * height; + } + else + { + // If bbox is not within range [0, 1]. + return (width + 1) * (height + 1); + } + } + } + } + + // Clip the caffe::NormalizedBBox such that the range for each corner is [0, 1]. + void ClipBBox(const caffe::NormalizedBBox& bbox, + caffe::NormalizedBBox* clipBBox) + { + clipBBox->set_xmin(std::max(std::min(bbox.xmin(), 1.f), 0.f)); + clipBBox->set_ymin(std::max(std::min(bbox.ymin(), 1.f), 0.f)); + clipBBox->set_xmax(std::max(std::min(bbox.xmax(), 1.f), 0.f)); + clipBBox->set_ymax(std::max(std::min(bbox.ymax(), 1.f), 0.f)); + clipBBox->clear_size(); + clipBBox->set_size(BBoxSize(*clipBBox)); + clipBBox->set_difficult(bbox.difficult()); + } + + // Decode a bbox according to a prior bbox. + void DecodeBBox( + const caffe::NormalizedBBox& prior_bbox, const std::vector& prior_variance, + const CodeType code_type, const bool variance_encoded_in_target, + const bool clip_bbox, const caffe::NormalizedBBox& bbox, + caffe::NormalizedBBox* decode_bbox) { + if (code_type == caffe::PriorBoxParameter_CodeType_CORNER) { + if (variance_encoded_in_target) { + // variance is encoded in target, we simply need to add the offset + // predictions. + decode_bbox->set_xmin(prior_bbox.xmin() + bbox.xmin()); + decode_bbox->set_ymin(prior_bbox.ymin() + bbox.ymin()); + decode_bbox->set_xmax(prior_bbox.xmax() + bbox.xmax()); + decode_bbox->set_ymax(prior_bbox.ymax() + bbox.ymax()); + } else { + // variance is encoded in bbox, we need to scale the offset accordingly. + decode_bbox->set_xmin( + prior_bbox.xmin() + prior_variance[0] * bbox.xmin()); + decode_bbox->set_ymin( + prior_bbox.ymin() + prior_variance[1] * bbox.ymin()); + decode_bbox->set_xmax( + prior_bbox.xmax() + prior_variance[2] * bbox.xmax()); + decode_bbox->set_ymax( + prior_bbox.ymax() + prior_variance[3] * bbox.ymax()); + } + } else if (code_type == caffe::PriorBoxParameter_CodeType_CENTER_SIZE) { + float prior_width = prior_bbox.xmax() - prior_bbox.xmin(); + CV_Assert(prior_width > 0); + float prior_height = prior_bbox.ymax() - prior_bbox.ymin(); + CV_Assert(prior_height > 0); + float prior_center_x = (prior_bbox.xmin() + prior_bbox.xmax()) / 2.; + float prior_center_y = (prior_bbox.ymin() + prior_bbox.ymax()) / 2.; + + float decode_bbox_center_x, decode_bbox_center_y; + float decode_bbox_width, decode_bbox_height; + if (variance_encoded_in_target) { + // variance is encoded in target, we simply need to retore the offset + // predictions. + decode_bbox_center_x = bbox.xmin() * prior_width + prior_center_x; + decode_bbox_center_y = bbox.ymin() * prior_height + prior_center_y; + decode_bbox_width = exp(bbox.xmax()) * prior_width; + decode_bbox_height = exp(bbox.ymax()) * prior_height; + } else { + // variance is encoded in bbox, we need to scale the offset accordingly. + decode_bbox_center_x = + prior_variance[0] * bbox.xmin() * prior_width + prior_center_x; + decode_bbox_center_y = + prior_variance[1] * bbox.ymin() * prior_height + prior_center_y; + decode_bbox_width = + exp(prior_variance[2] * bbox.xmax()) * prior_width; + decode_bbox_height = + exp(prior_variance[3] * bbox.ymax()) * prior_height; + } + + decode_bbox->set_xmin(decode_bbox_center_x - decode_bbox_width / 2.); + decode_bbox->set_ymin(decode_bbox_center_y - decode_bbox_height / 2.); + decode_bbox->set_xmax(decode_bbox_center_x + decode_bbox_width / 2.); + decode_bbox->set_ymax(decode_bbox_center_y + decode_bbox_height / 2.); + } else { + CV_Error(Error::StsBadArg, "Unknown LocLossType."); + } + float bbox_size = BBoxSize(*decode_bbox); + decode_bbox->set_size(bbox_size); + if (clip_bbox) { + ClipBBox(*decode_bbox, decode_bbox); + } + } + + // Decode a set of bboxes according to a set of prior bboxes. + void DecodeBBoxes( + const std::vector& prior_bboxes, + const std::vector >& prior_variances, + const CodeType code_type, const bool variance_encoded_in_target, + const bool clip_bbox, const std::vector& bboxes, + std::vector* decode_bboxes) { + CV_Assert(prior_bboxes.size() == prior_variances.size()); + CV_Assert(prior_bboxes.size() == bboxes.size()); + int num_bboxes = prior_bboxes.size(); + if (num_bboxes >= 1) { + CV_Assert(prior_variances[0].size() == 4); + } + decode_bboxes->clear(); + for (int i = 0; i < num_bboxes; ++i) { + caffe::NormalizedBBox decode_bbox; + DecodeBBox(prior_bboxes[i], prior_variances[i], code_type, + variance_encoded_in_target, clip_bbox, bboxes[i], &decode_bbox); + decode_bboxes->push_back(decode_bbox); + } + } + + // Decode all bboxes in a batch. + void DecodeBBoxesAll(const std::vector& all_loc_preds, + const std::vector& prior_bboxes, + const std::vector >& prior_variances, + const int num, const bool share_location, + const int num_loc_classes, const int background_label_id, + const CodeType code_type, const bool variance_encoded_in_target, + const bool clip, std::vector* all_decode_bboxes) { + CV_Assert(all_loc_preds.size() == num); + all_decode_bboxes->clear(); + all_decode_bboxes->resize(num); + for (int i = 0; i < num; ++i) { + // Decode predictions into bboxes. + LabelBBox& decode_bboxes = (*all_decode_bboxes)[i]; + for (int c = 0; c < num_loc_classes; ++c) { + int label = share_location ? -1 : c; + if (label == background_label_id) { + // Ignore background class. + continue; + } + if (all_loc_preds[i].find(label) == all_loc_preds[i].end()) { + // Something bad happened if there are no predictions for current label. + util::make_error("Could not find location predictions for label ", label); + } + const std::vector& label_loc_preds = + all_loc_preds[i].find(label)->second; + DecodeBBoxes(prior_bboxes, prior_variances, + code_type, variance_encoded_in_target, clip, + label_loc_preds, &(decode_bboxes[label])); + } + } + } + + // Get prior bounding boxes from prior_data. + // prior_data: 1 x 2 x num_priors * 4 x 1 blob. + // num_priors: number of priors. + // prior_bboxes: stores all the prior bboxes in the format of caffe::NormalizedBBox. + // prior_variances: stores all the variances needed by prior bboxes. + void GetPriorBBoxes(const float* priorData, const int& numPriors, + std::vector* priorBBoxes, + std::vector >* priorVariances) + { + priorBBoxes->clear(); + priorVariances->clear(); + for (int i = 0; i < numPriors; ++i) + { + int startIdx = i * 4; + caffe::NormalizedBBox bbox; + bbox.set_xmin(priorData[startIdx]); + bbox.set_ymin(priorData[startIdx + 1]); + bbox.set_xmax(priorData[startIdx + 2]); + bbox.set_ymax(priorData[startIdx + 3]); + float bboxSize = BBoxSize(bbox); + bbox.set_size(bboxSize); + priorBBoxes->push_back(bbox); + } + + for (int i = 0; i < numPriors; ++i) + { + int startIdx = (numPriors + i) * 4; + std::vector var; + for (int j = 0; j < 4; ++j) + { + var.push_back(priorData[startIdx + j]); + } + priorVariances->push_back(var); + } + } + + // Scale the caffe::NormalizedBBox w.r.t. height and width. + void ScaleBBox(const caffe::NormalizedBBox& bbox, + const int height, const int width, + caffe::NormalizedBBox* scaleBBox) + { + scaleBBox->set_xmin(bbox.xmin() * width); + scaleBBox->set_ymin(bbox.ymin() * height); + scaleBBox->set_xmax(bbox.xmax() * width); + scaleBBox->set_ymax(bbox.ymax() * height); + scaleBBox->clear_size(); + bool normalized = !(width > 1 || height > 1); + scaleBBox->set_size(BBoxSize(*scaleBBox, normalized)); + scaleBBox->set_difficult(bbox.difficult()); + } + + // Get location predictions from loc_data. + // loc_data: num x num_preds_per_class * num_loc_classes * 4 blob. + // num: the number of images. + // num_preds_per_class: number of predictions per class. + // num_loc_classes: number of location classes. It is 1 if share_location is + // true; and is equal to number of classes needed to predict otherwise. + // share_location: if true, all classes share the same location prediction. + // loc_preds: stores the location prediction, where each item contains + // location prediction for an image. + void GetLocPredictions(const float* locData, const int num, + const int numPredsPerClass, const int numLocClasses, + const bool shareLocation, std::vector* locPreds) + { + locPreds->clear(); + if (shareLocation) + { + CV_Assert(numLocClasses == 1); + } + locPreds->resize(num); + for (int i = 0; i < num; ++i) + { + LabelBBox& labelBBox = (*locPreds)[i]; + for (int p = 0; p < numPredsPerClass; ++p) + { + int startIdx = p * numLocClasses * 4; + for (int c = 0; c < numLocClasses; ++c) + { + int label = shareLocation ? -1 : c; + if (labelBBox.find(label) == labelBBox.end()) + { + labelBBox[label].resize(numPredsPerClass); + } + labelBBox[label][p].set_xmin(locData[startIdx + c * 4]); + labelBBox[label][p].set_ymin(locData[startIdx + c * 4 + 1]); + labelBBox[label][p].set_xmax(locData[startIdx + c * 4 + 2]); + labelBBox[label][p].set_ymax(locData[startIdx + c * 4 + 3]); + } + } + locData += numPredsPerClass * numLocClasses * 4; + } + } + + // Get confidence predictions from conf_data. + // conf_data: num x num_preds_per_class * num_classes blob. + // num: the number of images. + // num_preds_per_class: number of predictions per class. + // num_classes: number of classes. + // conf_preds: stores the confidence prediction, where each item contains + // confidence prediction for an image. + void GetConfidenceScores(const float* confData, const int num, + const int numPredsPerClass, const int numClasses, + std::vector > >* confPreds) + { + confPreds->clear(); + confPreds->resize(num); + for (int i = 0; i < num; ++i) + { + std::map >& labelScores = (*confPreds)[i]; + for (int p = 0; p < numPredsPerClass; ++p) + { + int startIdx = p * numClasses; + for (int c = 0; c < numClasses; ++c) + { + labelScores[c].push_back(confData[startIdx + c]); + } + } + confData += numPredsPerClass * numClasses; + } + } + + // Do non maximum suppression given bboxes and scores. + // Inspired by Piotr Dollar's NMS implementation in EdgeBox. + // https://goo.gl/jV3JYS + // bboxes: a set of bounding boxes. + // scores: a set of corresponding confidences. + // score_threshold: a threshold used to filter detection results. + // nms_threshold: a threshold used in non maximum suppression. + // top_k: if not -1, keep at most top_k picked indices. + // indices: the kept indices of bboxes after nms. + void ApplyNMSFast(const std::vector& bboxes, + const std::vector& scores, const float score_threshold, + const float nms_threshold, const float eta, const int top_k, + std::vector* indices) { + // Sanity check. + CV_Assert(bboxes.size() == scores.size()); + + // Get top_k scores (with corresponding indices). + std::vector > score_index_vec; + GetMaxScoreIndex(scores, score_threshold, top_k, &score_index_vec); + + // Do nms. + float adaptive_threshold = nms_threshold; + indices->clear(); + while (score_index_vec.size() != 0) { + const int idx = score_index_vec.front().second; + bool keep = true; + for (int k = 0; k < indices->size(); ++k) { + if (keep) { + const int kept_idx = (*indices)[k]; + float overlap = JaccardOverlap(bboxes[idx], bboxes[kept_idx]); + keep = overlap <= adaptive_threshold; + } else { + break; + } + } + if (keep) { + indices->push_back(idx); + } + score_index_vec.erase(score_index_vec.begin()); + if (keep && eta < 1 && adaptive_threshold > 0.5) { + adaptive_threshold *= eta; + } + } + } + + // Get max scores with corresponding indices. + // scores: a set of scores. + // threshold: only consider scores higher than the threshold. + // top_k: if -1, keep all; otherwise, keep at most top_k. + // score_index_vec: store the sorted (score, index) pair. + void GetMaxScoreIndex(const std::vector& scores, const float threshold,const int top_k, + std::vector >* score_index_vec) + { + // Generate index score pairs. + for (size_t i = 0; i < scores.size(); ++i) + { + if (scores[i] > threshold) + { + score_index_vec->push_back(std::make_pair(scores[i], i)); + } + } + + // Sort the score pair according to the scores in descending order + std::stable_sort(score_index_vec->begin(), score_index_vec->end(), + util::SortScorePairDescend); + + // Keep top_k scores if needed. + if (top_k > -1 && top_k < (int)score_index_vec->size()) + { + score_index_vec->resize(top_k); + } + } + + // Compute the intersection between two bboxes. + void IntersectBBox(const caffe::NormalizedBBox& bbox1, + const caffe::NormalizedBBox& bbox2, + caffe::NormalizedBBox* intersect_bbox) { + if (bbox2.xmin() > bbox1.xmax() || bbox2.xmax() < bbox1.xmin() || + bbox2.ymin() > bbox1.ymax() || bbox2.ymax() < bbox1.ymin()) + { + // Return [0, 0, 0, 0] if there is no intersection. + intersect_bbox->set_xmin(0); + intersect_bbox->set_ymin(0); + intersect_bbox->set_xmax(0); + intersect_bbox->set_ymax(0); + } + else + { + intersect_bbox->set_xmin(std::max(bbox1.xmin(), bbox2.xmin())); + intersect_bbox->set_ymin(std::max(bbox1.ymin(), bbox2.ymin())); + intersect_bbox->set_xmax(std::min(bbox1.xmax(), bbox2.xmax())); + intersect_bbox->set_ymax(std::min(bbox1.ymax(), bbox2.ymax())); + } + } + + // Compute the jaccard (intersection over union IoU) overlap between two bboxes. + float JaccardOverlap(const caffe::NormalizedBBox& bbox1, + const caffe::NormalizedBBox& bbox2, + const bool normalized=true) + { + caffe::NormalizedBBox intersect_bbox; + IntersectBBox(bbox1, bbox2, &intersect_bbox); + float intersect_width, intersect_height; + if (normalized) + { + intersect_width = intersect_bbox.xmax() - intersect_bbox.xmin(); + intersect_height = intersect_bbox.ymax() - intersect_bbox.ymin(); + } + else + { + intersect_width = intersect_bbox.xmax() - intersect_bbox.xmin() + 1; + intersect_height = intersect_bbox.ymax() - intersect_bbox.ymin() + 1; + } + if (intersect_width > 0 && intersect_height > 0) + { + float intersect_size = intersect_width * intersect_height; + float bbox1_size = BBoxSize(bbox1); + float bbox2_size = BBoxSize(bbox2); + return intersect_size / (bbox1_size + bbox2_size - intersect_size); + } + else + { + return 0.; + } + } +}; + +const std::string DetectionOutputLayerImpl::_layerName = std::string("DetectionOutput"); + +Ptr DetectionOutputLayer::create(const LayerParams ¶ms) +{ + return Ptr(new DetectionOutputLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/elementwise_layers.cpp b/modules/dnn/src/layers/elementwise_layers.cpp new file mode 100644 index 0000000000..97f75847ac --- /dev/null +++ b/modules/dnn/src/layers/elementwise_layers.cpp @@ -0,0 +1,502 @@ +#include "../precomp.hpp" +#include "op_halide.hpp" +#include "opencv2/imgproc.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +using std::abs; +using std::exp; +using std::tanh; +using std::pow; + +template +class ElementWiseLayer : public Func::Layer +{ +public: + class PBody : public cv::ParallelLoopBody + { + public: + const Func* func_; + const Mat* src_; + Mat* dst_; + int nstripes_; + + PBody(const Func &func, const Mat &src, Mat& dst, int nstripes) + { + func_ = &func; + src_ = &src; + dst_ = &dst; + nstripes_ = nstripes; + } + + void operator()(const Range &r) const + { + int nstripes = nstripes_, nsamples, outCn; + size_t planeSize; + + if( src_->dims == 4 ) + { + nsamples = src_->size[0]; + outCn = src_->size[1]; + planeSize = (size_t)src_->size[2]*src_->size[3]; + } + else + { + nsamples = outCn = 1; + planeSize = (size_t)src_->total(); + } + + size_t stripeSize = (planeSize + nstripes - 1)/nstripes; + size_t stripeStart = r.start*stripeSize; + size_t stripeEnd = std::min(r.end*stripeSize, planeSize); + + for( int i = 0; i < nsamples; i++ ) + { + const float* srcptr = src_->ptr(i) + stripeStart; + float* dstptr = dst_->ptr(i) + stripeStart; + func_->apply(srcptr, dstptr, (int)(stripeEnd - stripeStart), planeSize, 0, outCn); + } + } + }; + + ElementWiseLayer(const Func &f=Func()) { func = f; } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + virtual Ptr tryAttach(const Ptr& node) + { + switch (node->backendId) + { + case DNN_BACKEND_HALIDE: + { +#ifdef HAVE_HALIDE + auto base = node.dynamicCast(); + Halide::Func& input = base->funcs.back(); + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (this->name.empty() ? Halide::Func() : Halide::Func(this->name)); + func.attachHalide(input(x, y, c, n), top); + return Ptr(new HalideBackendNode(base, top)); +#endif // HAVE_HALIDE + break; + } + } + return Ptr(); + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer input = halideBuffer(inputs[0]); + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (this->name.empty() ? Halide::Func() : Halide::Func(this->name)); + func.attachHalide(input(x, y, c, n), top); + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + return true; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (size_t i = 0; i < inputs.size(); i++) + { + const Mat &src = *inputs[i]; + Mat &dst = outputs[i]; + CV_Assert(src.size == dst.size && src.type() == dst.type() && + src.isContinuous() && dst.isContinuous() && src.type() == CV_32F); + + const int nstripes = getNumThreads(); + PBody body(func, src, dst, nstripes); + parallel_for_(Range(0, nstripes), body, nstripes); + } + } + + void forwardSlice(const float* src, float* dst, int len, size_t planeSize, int cn0, int cn1) const + { + func.apply(src, dst, len, planeSize, cn0, cn1); + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + long flops = 0; + for (int i = 0; i < outputs.size(); i++) + { + flops += total(outputs[i]) * func.getFLOPSPerElement(); + } + return flops; + } + + Func func; + bool run_parallel; +}; + +struct ReLUFunctor +{ + typedef ReLULayer Layer; + float slope; + + explicit ReLUFunctor(float slope_=1.f) : slope(slope_) {} + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + float s = slope; + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + int i = 0; +#if CV_SIMD128 + v_float32x4 s4 = v_setall_f32(s), z = v_setzero_f32(); + for( ; i <= len - 16; i += 16 ) + { + v_float32x4 x0 = v_load(srcptr + i); + v_float32x4 x1 = v_load(srcptr + i + 4); + v_float32x4 x2 = v_load(srcptr + i + 8); + v_float32x4 x3 = v_load(srcptr + i + 12); + x0 = v_select(x0 >= z, x0, x0*s4); + x1 = v_select(x1 >= z, x1, x1*s4); + x2 = v_select(x2 >= z, x2, x2*s4); + x3 = v_select(x3 >= z, x3, x3*s4); + v_store(dstptr + i, x0); + v_store(dstptr + i + 4, x1); + v_store(dstptr + i + 8, x2); + v_store(dstptr + i + 12, x3); + } +#endif + for( ; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = x >= 0.f ? x : s*x; + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + if (slope) + { + top(x, y, c, n) = select(input >= 0.0f, input, slope); + } + else + { + top(x, y, c, n) = max(input, 0.0f); + } + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return 1; } +}; + +struct TanHFunctor +{ + typedef TanHLayer Layer; + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + for( int i = 0; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = tanh(x); + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + top(x, y, c, n) = tanh(input); + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return 1; } +}; + +struct SigmoidFunctor +{ + typedef SigmoidLayer Layer; + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + for( int i = 0; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = 1.f/(1.f + exp(-x)); + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + top(x, y, c, n) = 1.0f / (1.0f + exp(-input)); + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return 3; } +}; + +struct AbsValFunctor +{ + typedef AbsLayer Layer; + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + for( int i = 0; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = abs(x); + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + top(x, y, c, n) = abs(input); + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return 1; } +}; + +struct BNLLFunctor +{ + typedef BNLLLayer Layer; + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + for( int i = 0; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = log(1.f + exp(-abs(x))); + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + top(x, y, c, n) = log(1.0f + exp(-abs(input))); + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return 5; } +}; + +struct PowerFunctor +{ + typedef PowerLayer Layer; + + float power; + float scale; + float shift; + + explicit PowerFunctor(float power_ = 1.f, float scale_ = 1.f, float shift_ = 0.f) + : power(power_), scale(scale_), shift(shift_) {} + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + float a = scale, b = shift, p = power; + if( p == 1.f ) + { + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + for( int i = 0; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = a*x + b; + } + } + } + else + { + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + for( int i = 0; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = pow(a*x + b, p); + } + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Expr topExpr = (scale == 1.0f ? input : input * scale); + if (shift) + { + topExpr += shift; + } + if (power != 1.0f) + { + topExpr = pow(topExpr, power); + } + top(x, y, c, n) = topExpr; + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return power == 1 ? 2 : 10; } +}; + + +struct ChannelsPReLUFunctor +{ + typedef ChannelsPReLULayer Layer; + Mat scale; + + explicit ChannelsPReLUFunctor(const Mat& scale_=Mat()) : scale(scale_) + { + } + + void apply(const float* srcptr, float* dstptr, int len, size_t planeSize, int cn0, int cn1) const + { + CV_Assert(scale.isContinuous() && scale.type() == CV_32F); + + const float* scaleptr = scale.ptr(); + CV_Assert( 0 <= cn0 && cn0 < cn1 && cn1 <= (int)scale.total() ); + + for( int cn = cn0; cn < cn1; cn++, srcptr += planeSize, dstptr += planeSize ) + { + float s = scaleptr[cn]; + int i = 0; + #if CV_SIMD128 + v_float32x4 s4 = v_setall_f32(s), z = v_setzero_f32(); + for( ; i <= len - 16; i += 16 ) + { + v_float32x4 x0 = v_load(ptr + i); + v_float32x4 x1 = v_load(ptr + i + 4); + v_float32x4 x2 = v_load(ptr + i + 8); + v_float32x4 x3 = v_load(ptr + i + 12); + x0 = v_select(x0 >= z, x0, x0*s4); + x1 = v_select(x1 >= z, x1, x1*s4); + x2 = v_select(x2 >= z, x2, x2*s4); + x3 = v_select(x3 >= z, x3, x3*s4); + v_store(ptr + i, x0); + v_store(ptr + i + 4, x1); + v_store(ptr + i + 8, x2); + v_store(ptr + i + 12, x3); + } + #endif + for( ; i < len; i++ ) + { + float x = srcptr[i]; + dstptr[i] = x >= 0.f ? x : s*x; + } + } + } + +#ifdef HAVE_HALIDE + void attachHalide(const Halide::Expr& input, Halide::Func& top) + { + Halide::Var x("x"), y("y"), c("c"), n("n"); + auto weights = wrapToHalideBuffer(scale, {(int)scale.total()}); + top(x, y, c, n) = select(input >= 0.0f, input, weights(c) * input); + } +#endif // HAVE_HALIDE + + int64 getFLOPSPerElement() const { return 1; } +}; + +#define ACTIVATION_CREATOR_FOR(_Layer, _Functor, ...) \ +Ptr<_Layer> _Layer::create() { \ + return return Ptr<_Layer>( new ElementWiseLayer<_Functor>(_Functor()) ); } + + +Ptr ReLULayer::create(const LayerParams& params) +{ + float negativeSlope = params.get("negative_slope", 0.f); + Ptr l(new ElementWiseLayer(ReLUFunctor(negativeSlope))); + l->setParamsFrom(params); + l->negativeSlope = negativeSlope; + + return l; +} + +Ptr TanHLayer::create(const LayerParams& params) +{ + Ptr l(new ElementWiseLayer()); + l->setParamsFrom(params); + + return l; +} + +Ptr SigmoidLayer::create(const LayerParams& params) +{ + Ptr l(new ElementWiseLayer()); + l->setParamsFrom(params); + + return l; +} + +Ptr AbsLayer::create(const LayerParams& params) +{ + Ptr l(new ElementWiseLayer()); + l->setParamsFrom(params); + + return l; +} + +Ptr BNLLLayer::create(const LayerParams& params) +{ + Ptr l(new ElementWiseLayer()); + l->setParamsFrom(params); + + return l; +} + +Ptr PowerLayer::create(const LayerParams& params) +{ + float power = params.get("power", 1.0f); + float scale = params.get("scale", 1.0f); + float shift = params.get("shift", 0.0f); + Ptr l(new ElementWiseLayer(PowerFunctor(power, scale, shift))); + l->setParamsFrom(params); + l->power = power; + l->scale = scale; + l->shift = shift; + + return l; +} + +Ptr ChannelsPReLULayer::create(const LayerParams& params) +{ + Ptr l(new ElementWiseLayer(ChannelsPReLUFunctor(params.blobs[0]))); + l->setParamsFrom(params); + + return l; +} + +} +} diff --git a/modules/dnn/src/layers/eltwise_layer.cpp b/modules/dnn/src/layers/eltwise_layer.cpp new file mode 100644 index 0000000000..e6126c7c57 --- /dev/null +++ b/modules/dnn/src/layers/eltwise_layer.cpp @@ -0,0 +1,219 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" + +namespace cv +{ +namespace dnn +{ + +class EltwiseLayerImpl : public EltwiseLayer +{ +public: + EltwiseOp op; + std::vector coeffs; + + EltwiseLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + op = EltwiseLayer::SUM; + if (params.has("operation")) + { + String operation = params.get("operation").toLowerCase(); + if (operation == "prod") + op = EltwiseLayer::PROD; + else if (operation == "sum") + op = EltwiseLayer::SUM; + else if (operation == "max") + op = EltwiseLayer::MAX; + else + CV_Error(cv::Error::StsBadArg, "Unknown operaticon type \"" + operation + "\""); + } + + if (params.has("coeff")) + { + DictValue paramCoeff = params.get("coeff"); + int i, n = paramCoeff.size(); + coeffs.resize(n); + for (i = 0; i < n; i++) + { + coeffs[i] = paramCoeff.get(i); + } + } + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() >= 2); + CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size()); + CV_Assert(op == SUM || coeffs.size() == 0); + + for (int i = 1; i < inputs.size(); i++) + { + CV_Assert(inputs[0] == inputs[i]); + } + + outputs.assign(1, inputs[0]); + + return false; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + Mat& output = outputs[0]; + switch (op) + { + case SUM: + CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size()); + if (0 < coeffs.size()) + { + output.setTo(0.); + for (size_t i = 0; i < inputs.size(); i++) + { + output += *inputs[i] * coeffs[i]; + } + } + else + { + add(*inputs[0], *inputs[1], output); + for (size_t i = 2; i < inputs.size(); i++) + { + output += *inputs[i]; + } + } + break; + case PROD: + output.setTo(1.); + for (size_t i = 0; i < inputs.size(); i++) + { + output = output.mul(*inputs[i]); + } + break; + case MAX: + cv::max(*inputs[0], *inputs[1], output); + for (size_t i = 2; i < inputs.size(); i++) + { + cv::max(output, *inputs[i], output); + } + break; + default: + CV_Assert(0); + break; + } + } + + virtual Ptr initHalide(const std::vector > &input) + { +#ifdef HAVE_HALIDE + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Expr topExpr; + std::vector > inputBuffers = halideBuffers(input); + switch (op) + { + case SUM: + if (coeffs.empty()) + { + topExpr = inputBuffers[0](x, y, c, n) + + inputBuffers[1](x, y, c, n); + for (int i = 2; i < inputBuffers.size(); ++i) + topExpr += inputBuffers[i](x, y, c, n); + } + else + { + topExpr = coeffs[0] * inputBuffers[0](x, y, c, n) + + coeffs[1] * inputBuffers[1](x, y, c, n); + for (int i = 2; i < inputBuffers.size(); ++i) + topExpr += coeffs[i] * inputBuffers[i](x, y, c, n); + } + break; + case PROD: + topExpr = inputBuffers[0](x, y, c, n) * + inputBuffers[1](x, y, c, n); + for (int i = 2; i < inputBuffers.size(); ++i) + topExpr *= inputBuffers[i](x, y, c, n); + break; + case MAX: + topExpr = max(inputBuffers[0](x, y, c, n), + inputBuffers[1](x, y, c, n)); + for (int i = 2; i < inputBuffers.size(); ++i) + topExpr = max(topExpr, inputBuffers[i](x, y, c, n)); + break; + default: + return Ptr(); + } + top(x, y, c, n) = topExpr; + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + CV_Assert(inputs.size()); + + long flops = inputs.size() * total(inputs[0]); + + return flops; + } +}; + +Ptr EltwiseLayer::create(const LayerParams& params) +{ + return Ptr(new EltwiseLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/flatten_layer.cpp b/modules/dnn/src/layers/flatten_layer.cpp new file mode 100644 index 0000000000..78b373401a --- /dev/null +++ b/modules/dnn/src/layers/flatten_layer.cpp @@ -0,0 +1,125 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include +#include +#include + +namespace cv +{ +namespace dnn +{ + +class FlattenLayerImpl : public FlattenLayer +{ +public: + FlattenLayerImpl(const LayerParams ¶ms) + { + _startAxis = params.get("axis", 1); + _endAxis = params.get("end_axis", -1); + setParamsFrom(params); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() > 0); + for (size_t i = 1; i < inputs.size(); i++) + { + CV_Assert(inputs[i] == inputs[0]); + } + + int numAxes = inputs[0].size(); + int startAxis = clamp(_startAxis, numAxes); + int endAxis = clamp(_endAxis, numAxes); + + for (size_t i = 1; i < inputs.size(); i++) + { + CV_Assert(inputs[i] == inputs[0]); + } + + + CV_Assert(startAxis >= 0); + CV_Assert(endAxis >= startAxis && endAxis < (int)numAxes); + + size_t flattenedDimensionSize = total(inputs[0], startAxis, endAxis + 1); + + MatShape outputShapeVec; + for (int i = 0; i < startAxis; i++) + { + outputShapeVec.push_back(inputs[0][i]); + } + outputShapeVec.push_back(flattenedDimensionSize); + for (size_t i = endAxis + 1; i < numAxes; i++) + { + outputShapeVec.push_back(inputs[0][i]); + } + CV_Assert(outputShapeVec.size() <= 4); + + outputs.resize(inputs.size(), outputShapeVec); + + return true; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (size_t i = 0; i < inputs.size(); i++) + { + MatShape outShape = shape(outputs[i]); + outputs[i] = inputs[i]->reshape(1, (int)outShape.size(), &outShape[0]); + } + } + + int _startAxis; + int _endAxis; +}; + +Ptr FlattenLayer::create(const LayerParams& params) +{ + return Ptr(new FlattenLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/fully_connected_layer.cpp b/modules/dnn/src/layers/fully_connected_layer.cpp new file mode 100644 index 0000000000..9f790da63d --- /dev/null +++ b/modules/dnn/src/layers/fully_connected_layer.cpp @@ -0,0 +1,281 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class FullyConnectedLayerImpl : public InnerProductLayer +{ +public: + enum { VEC_ALIGN = 8 }; + + FullyConnectedLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + CV_Assert(1 <= blobs.size() && blobs.size() <= 2); + + int numOutput = params.get("num_output"); + int innerSize = (int)blobs[0].total() / numOutput; + bias = params.get("bias_term", true); + axis = params.get("axis", 1); + + CV_Assert(blobs[0].dims >= 2 && (size_t)(innerSize * numOutput) == blobs[0].total()); + CV_Assert(!bias || (blobs.size() == 2 && (size_t)numOutput == blobs[1].total())); + + weightsMat = blobs[0] = blobs[0].reshape(1, numOutput); + int vecsize = weightsMat.cols; + if( vecsize % VEC_ALIGN != 0 ) + { + int vecsize_aligned = (int)alignSize(vecsize, VEC_ALIGN); + Mat weightsBuf(weightsMat.rows, vecsize_aligned, weightsMat.type()); + Mat wpadding = weightsBuf.colRange(vecsize, vecsize_aligned); + wpadding.setTo(Scalar::all(0.)); + weightsMat = weightsBuf.colRange(0, vecsize); + blobs[0].copyTo(weightsMat); + blobs[0] = weightsMat; + } + + if (bias) + biasMat = blobs[1] = blobs[1].reshape(1, 1); + else + biasMat = Mat::zeros(1, numOutput, weightsMat.type()); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &) const + { + CV_Assert(inputs.size() > 0); + CV_Assert(1 <= blobs.size() && blobs.size() <= 2); + CV_Assert(blobs[0].dims == 2); + + int cAxis = clamp(axis, inputs[0]); + int outerSize = total(inputs[0], 0, cAxis); + int numOutput = blobs[0].size[0]; + outputs.resize(inputs.size(), shape(outerSize, numOutput)); + + CV_Assert(!bias || (size_t)numOutput == blobs[1].total()); + return false; + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide() && axis == 1; + } + + class FullConnected : public ParallelLoopBody + { + public: + FullConnected(const Mat& srcMat, const Mat& weights, const Mat& biasMat, Mat& dstMat, int nstripes) + { + CV_Assert( srcMat.dims == 2 && srcMat.cols == weights.cols && + dstMat.rows == srcMat.rows && dstMat.cols == weights.rows && + srcMat.type() == weights.type() && weights.type() == dstMat.type() && + srcMat.type() == CV_32F && + (biasMat.empty() || (biasMat.type() == srcMat.type() && + biasMat.isContinuous() && (int)biasMat.total() == dstMat.cols)) ); + + srcMat_ = &srcMat; + weights_ = &weights; + biasMat_ = &biasMat; + dstMat_ = &dstMat; + nstripes_ = nstripes; + useAVX2_ = checkHardwareSupport(CPU_AVX2); + } + + void operator()(const Range& r) const + { + int valign = FullyConnectedLayerImpl::VEC_ALIGN; + int nsamples = srcMat_->rows; + int nw0 = weights_->rows; + int k, vecsize = srcMat_->cols; + int vecsize_aligned = (int)alignSize(vecsize, VEC_ALIGN); + int nstripes = nstripes_; + size_t total = (size_t)nsamples*nw0; + size_t stripeSize = (total + nstripes - 1)/nstripes; + size_t stripeStart = r.start*stripeSize; + size_t stripeEnd = r.end == nstripes ? total : std::min(r.end*stripeSize, total); + size_t wstep = weights_->step1(); + AutoBuffer srcbuf(vecsize_aligned + valign); + float* sptr = alignPtr((float*)srcbuf, (int)(valign*sizeof(float))); + + for( k = vecsize; k < vecsize_aligned; k++ ) + sptr[k] = 0.f; + + for( size_t ofs = stripeStart; ofs < stripeEnd; ) + { + int sampleIdx = (int)(ofs / nw0); + int delta = (int)(ofs - (size_t)sampleIdx*nw0); + const float* sptr_ = srcMat_->ptr(sampleIdx); + const float* wptr = weights_->ptr(delta); + float* dptr = dstMat_->ptr(sampleIdx) + delta; + const float* biasptr = biasMat_->ptr() + delta; + int nw = std::min(nw0 - delta, (int)(stripeEnd - ofs)); + + memcpy(sptr, sptr_, vecsize*sizeof(sptr[0])); + + #if CV_DNN_TRY_AVX2 + if( useAVX2_ ) + fastGEMM1T_avx2( sptr, wptr, wstep, biasptr, dptr, nw, vecsize); + else + #endif + { + int i = 0; + + #if CV_SIMD128 + for( ; i <= nw - 4; i += 4, wptr += 4*wstep ) + { + vfloat32x4 vs0 = v_setall_f32(0.f), vs1 = v_setall_f32(0.f); + vfloat32x4 vs2 = v_setall_f32(0.f), vs3 = v_setall_f32(0.f); + + for( k = 0; k < vecsize; k += 4 ) + { + vfloat32x4 v = v_load_aligned(sptr + k); + vs0 += v*v_load_aligned(wptr + k); + vs1 += v*v_load_aligned(wptr + wstep + k); + vs2 += v*v_load_aligned(wptr + wstep*2 + k); + vs3 += v*v_load_aligned(wptr + wstep*3 + k); + } + + vfloat32x4 s = v_reduce_sum4(vs0, vs1, vs2, vs3); + s += v_load(biasptr + i); + v_store(dptr + i, s); + } + #endif + + for( ; i < nw; i++, wptr += wstep ) + { + float s0=biasptr[i]; + + for( k = 0; k < vecsize; k++ ) + { + float v = sptr[k]; + s0 += v*wptr[k]; + } + dptr[i] = s0; + } + } + ofs += nw; + } + } + + const Mat *srcMat_, *weights_, *biasMat_; + Mat* dstMat_; + int nstripes_; + bool useAVX2_; + }; + + void forward(std::vector &input, std::vector &output, std::vector &) + { + int axisCan = clamp(axis, input[0]->dims); + int outerSize = input[0]->total(0, axisCan); + + for (size_t i = 0; i < input.size(); i++) + { + Mat srcMat = input[i]->reshape(1, outerSize); + Mat dstMat = output[i].reshape(1, outerSize); + + const int nstripes = getNumThreads(); + FullConnected fconn(srcMat, weightsMat, biasMat, dstMat, nstripes); + parallel_for_(Range(0, nstripes), fconn, nstripes); + } + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + int inW, inH, inC, inN, outC = blobs[0].size[0]; + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + getCanonicalSize(inputBuffer, &inW, &inH, &inC, &inN); + auto weights = wrapToHalideBuffer(blobs[0], {inW, inH, inC, outC}); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::RDom r(0, inW, 0, inH, 0, inC); + Halide::Expr topExpr = sum(inputBuffer(r.x, r.y, r.z, n) * + weights(r.x, r.y, r.z, c)); + if (bias) + { + Halide::Buffer bias = wrapToHalideBuffer(blobs[1], {outC}); + topExpr += bias(c); + } + top(x, y, c, n) = topExpr; + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)inputs; // suppress unused variable warning + long flops = 0; + + int innerSize = blobs[0].size[1]; + for(int i = 0; i < outputs.size(); i++) + { + flops += 3*innerSize*total(outputs[i]); + } + + return flops; + + } + + bool bias; + Mat weightsMat, biasMat; +}; + +Ptr InnerProductLayer::create(const LayerParams& params) +{ + return Ptr(new FullyConnectedLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/layers_common.avx2.cpp b/modules/dnn/src/layers/layers_common.avx2.cpp new file mode 100644 index 0000000000..8b08ac0230 --- /dev/null +++ b/modules/dnn/src/layers/layers_common.avx2.cpp @@ -0,0 +1,356 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "precomp.hpp" +#include "layers_common.hpp" +#include "opencv2/core/hal/intrin.hpp" + +#if CV_DNN_TRY_AVX2 + +#include + +namespace cv { +namespace dnn { + +void fastConv_avx2( const float* weights, size_t wstep, const float* bias, + const float* rowbuf, float* output, const int* outShape, + int blockSize, int vecsize, int vecsize_aligned, + const float* relu, bool initOutput ) +{ + int outCn = outShape[1]; + size_t outPlaneSize = outShape[2]*outShape[3]; + float r0 = 1.f, r1 = 1.f, r2 = 1.f; + __m256 vr0 = _mm256_set1_ps(1.f), vr1 = vr0, vr2 = vr0, z = _mm256_setzero_ps(); + + // now compute dot product of the weights + // and im2row-transformed part of the tensor + for( int i = 0; i < outCn; i += 3 ) + { + const float* wptr0 = weights + i*wstep; + const float* wptr1 = wptr0 + wstep; + const float* wptr2 = wptr1 + wstep; + float* outptr0 = output + i*outPlaneSize; + float* outptr1 = outptr0 + outPlaneSize; + float* outptr2 = outptr1 + outPlaneSize; + float bias0 = bias[i], bias1 = bias[i+1], bias2 = bias[i+2]; + + if( i+2 >= outCn ) + { + wptr2 = wptr1; + outptr2 = outptr1; + bias2 = bias1; + if( i+1 >= outCn ) + { + wptr2 = wptr1 = wptr0; + outptr2 = outptr1 = outptr0; + bias2 = bias1 = bias0; + } + } + + if( relu ) + { + r0 = relu[i]; + r1 = relu[i+1]; + r2 = relu[i+2]; + vr0 = _mm256_set1_ps(r0); + vr1 = _mm256_set1_ps(r1); + vr2 = _mm256_set1_ps(r2); + } + + int j = 0; + for( ; j <= blockSize - 4; j += 4 ) + { + const float* rptr = rowbuf + j*vecsize_aligned; + + __m256 vs00 = _mm256_setzero_ps(), vs01 = _mm256_setzero_ps(), + vs02 = _mm256_setzero_ps(), vs03 = _mm256_setzero_ps(), + vs10 = _mm256_setzero_ps(), vs11 = _mm256_setzero_ps(), + vs12 = _mm256_setzero_ps(), vs13 = _mm256_setzero_ps(), + vs20 = _mm256_setzero_ps(), vs21 = _mm256_setzero_ps(), + vs22 = _mm256_setzero_ps(), vs23 = _mm256_setzero_ps(); + + for( int k = 0; k < vecsize; k += 8, rptr += 8 ) + { + __m256 w0 = _mm256_load_ps(wptr0 + k); + __m256 w1 = _mm256_load_ps(wptr1 + k); + __m256 w2 = _mm256_load_ps(wptr2 + k); + __m256 r0 = _mm256_load_ps(rptr); + + vs00 = _mm256_fmadd_ps(w0, r0, vs00); + vs10 = _mm256_fmadd_ps(w1, r0, vs10); + vs20 = _mm256_fmadd_ps(w2, r0, vs20); + + r0 = _mm256_load_ps(rptr + vecsize_aligned); + vs01 = _mm256_fmadd_ps(w0, r0, vs01); + vs11 = _mm256_fmadd_ps(w1, r0, vs11); + vs21 = _mm256_fmadd_ps(w2, r0, vs21); + + r0 = _mm256_load_ps(rptr + vecsize_aligned*2); + vs02 = _mm256_fmadd_ps(w0, r0, vs02); + vs12 = _mm256_fmadd_ps(w1, r0, vs12); + vs22 = _mm256_fmadd_ps(w2, r0, vs22); + + r0 = _mm256_load_ps(rptr + vecsize_aligned*3); + vs03 = _mm256_fmadd_ps(w0, r0, vs03); + vs13 = _mm256_fmadd_ps(w1, r0, vs13); + vs23 = _mm256_fmadd_ps(w2, r0, vs23); + } + + __m256 t0 = _mm256_hadd_ps(_mm256_hadd_ps(vs00, vs01), _mm256_hadd_ps(vs02, vs03)); + __m256 t1 = _mm256_hadd_ps(_mm256_hadd_ps(vs10, vs11), _mm256_hadd_ps(vs12, vs13)); + __m256 t2 = _mm256_hadd_ps(_mm256_hadd_ps(vs20, vs21), _mm256_hadd_ps(vs22, vs23)); + + t0 = _mm256_add_ps(t0, _mm256_permute2f128_ps(t0, t0, 1)); + t1 = _mm256_add_ps(t1, _mm256_permute2f128_ps(t1, t1, 1)); + t2 = _mm256_add_ps(t2, _mm256_permute2f128_ps(t2, t2, 1)); + + __m256 s0, s1, s2; + + if( initOutput ) + { + s0 = _mm256_set1_ps(bias0); + s1 = _mm256_set1_ps(bias1); + s2 = _mm256_set1_ps(bias2); + } + else + { + s0 = _mm256_castps128_ps256(_mm_loadu_ps(outptr0 + j)); + s1 = _mm256_castps128_ps256(_mm_loadu_ps(outptr1 + j)); + s2 = _mm256_castps128_ps256(_mm_loadu_ps(outptr2 + j)); + } + + s0 = _mm256_add_ps(s0, t0); + s1 = _mm256_add_ps(s1, t1); + s2 = _mm256_add_ps(s2, t2); + + if( relu ) + { + __m256 m0 = _mm256_cmp_ps(s0, z, _CMP_GT_OS); + __m256 m1 = _mm256_cmp_ps(s1, z, _CMP_GT_OS); + __m256 m2 = _mm256_cmp_ps(s2, z, _CMP_GT_OS); + s0 = _mm256_xor_ps(s0, _mm256_andnot_ps(m0, _mm256_xor_ps(_mm256_mul_ps(s0, vr0), s0))); + s1 = _mm256_xor_ps(s1, _mm256_andnot_ps(m1, _mm256_xor_ps(_mm256_mul_ps(s1, vr1), s1))); + s2 = _mm256_xor_ps(s2, _mm256_andnot_ps(m2, _mm256_xor_ps(_mm256_mul_ps(s2, vr2), s2))); + } + + _mm_storeu_ps(outptr0 + j, _mm256_castps256_ps128(s0)); + _mm_storeu_ps(outptr1 + j, _mm256_castps256_ps128(s1)); + _mm_storeu_ps(outptr2 + j, _mm256_castps256_ps128(s2)); + } + + for( ; j < blockSize; j++ ) + { + const float* rptr = rowbuf + j*vecsize_aligned; + float s00, s10, s20; + + if( initOutput ) + { + s00 = bias0; + s10 = bias1; + s20 = bias2; + } + else + { + s00 = outptr0[j]; + s10 = outptr1[j]; + s20 = outptr2[j]; + } + + for( int k = 0; k < vecsize; k++ ) + { + float r0 = rptr[k]; + s00 += wptr0[k]*r0; + s10 += wptr1[k]*r0; + s20 += wptr2[k]*r0; + } + + if( relu ) + { + s00 = s00 > 0.f ? s00 : s00*r0; + s10 = s10 > 0.f ? s10 : s10*r1; + s20 = s20 > 0.f ? s20 : s20*r2; + } + + outptr0[j] = s00; + outptr1[j] = s10; + outptr2[j] = s20; + } + } + _mm256_zeroupper(); +} + +// dst = vec * weights^t + bias +void fastGEMM1T_avx2( const float* vec, const float* weights, + size_t wstep, const float* bias, + float* dst, int nvecs, int vecsize ) +{ + int i = 0; + + for( ; i <= nvecs - 8; i += 8 ) + { + const float* wptr = weights + i*wstep; + __m256 vs0 = _mm256_setzero_ps(), vs1 = _mm256_setzero_ps(), + vs2 = _mm256_setzero_ps(), vs3 = _mm256_setzero_ps(), + vs4 = _mm256_setzero_ps(), vs5 = _mm256_setzero_ps(), + vs6 = _mm256_setzero_ps(), vs7 = _mm256_setzero_ps(); + + for( int k = 0; k < vecsize; k += 8, wptr += 8 ) + { + __m256 v = _mm256_load_ps(vec + k); + + vs0 = _mm256_fmadd_ps(_mm256_load_ps(wptr), v, vs0); + vs1 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep), v, vs1); + vs2 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep*2), v, vs2); + vs3 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep*3), v, vs3); + vs4 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep*4), v, vs4); + vs5 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep*5), v, vs5); + vs6 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep*6), v, vs6); + vs7 = _mm256_fmadd_ps(_mm256_load_ps(wptr + wstep*7), v, vs7); + } + + __m256 s0 = _mm256_hadd_ps(_mm256_hadd_ps(vs0, vs1), _mm256_hadd_ps(vs2, vs3)); + __m256 s1 = _mm256_hadd_ps(_mm256_hadd_ps(vs4, vs5), _mm256_hadd_ps(vs6, vs7)); + + s0 = _mm256_add_ps(s0, _mm256_permute2f128_ps(s0, s0, 1)); + s1 = _mm256_add_ps(s1, _mm256_permute2f128_ps(s1, s1, 1)); + + s0 = _mm256_add_ps(s0, _mm256_castps128_ps256(_mm_loadu_ps(bias + i))); + s1 = _mm256_add_ps(s1, _mm256_castps128_ps256(_mm_loadu_ps(bias + i + 4))); + + _mm_storeu_ps(dst + i, _mm256_castps256_ps128(s0)); + _mm_storeu_ps(dst + i + 4, _mm256_castps256_ps128(s1)); + } + + float temp = 0.f; + for( ; i < nvecs; i++ ) + { + const float* wptr = weights + i*wstep; + __m256 vs0 = _mm256_setzero_ps(); + + for( int k = 0; k < vecsize; k += 8, wptr += 8 ) + { + __m256 v = _mm256_load_ps(vec + k); + vs0 = _mm256_fmadd_ps(_mm256_load_ps(wptr), v, vs0); + } + + __m256 s0 = _mm256_hadd_ps(_mm256_hadd_ps(vs0, vs0), vs0); + s0 = _mm256_add_ps(s0, _mm256_permute2f128_ps(s0, s0, 1)); + _mm_store_ss(&temp, _mm256_castps256_ps128(s0)); + dst[i] = temp + bias[i]; + } + + _mm256_zeroupper(); +} + +void fastGEMM_avx2( const float* aptr, size_t astep, const float* bptr, + size_t bstep, float* cptr, size_t cstep, + int ma, int na, int nb ) +{ + int n = 0; + for( ; n <= nb - 16; n += 16 ) + { + for( int m = 0; m < ma; m += 4 ) + { + const float* aptr0 = aptr + astep*m; + const float* aptr1 = aptr + astep*std::min(m+1, ma-1); + const float* aptr2 = aptr + astep*std::min(m+2, ma-1); + const float* aptr3 = aptr + astep*std::min(m+3, ma-1); + + float* cptr0 = cptr + cstep*m; + float* cptr1 = cptr + cstep*std::min(m+1, ma-1); + float* cptr2 = cptr + cstep*std::min(m+2, ma-1); + float* cptr3 = cptr + cstep*std::min(m+3, ma-1); + + __m256 d00 = _mm256_setzero_ps(), d01 = _mm256_setzero_ps(); + __m256 d10 = _mm256_setzero_ps(), d11 = _mm256_setzero_ps(); + __m256 d20 = _mm256_setzero_ps(), d21 = _mm256_setzero_ps(); + __m256 d30 = _mm256_setzero_ps(), d31 = _mm256_setzero_ps(); + + for( int k = 0; k < na; k++ ) + { + __m256 a0 = _mm256_set1_ps(aptr0[k]); + __m256 a1 = _mm256_set1_ps(aptr1[k]); + __m256 a2 = _mm256_set1_ps(aptr2[k]); + __m256 a3 = _mm256_set1_ps(aptr3[k]); + __m256 b0 = _mm256_loadu_ps(bptr + k*bstep + n); + __m256 b1 = _mm256_loadu_ps(bptr + k*bstep + n + 8); + d00 = _mm256_fmadd_ps(a0, b0, d00); + d01 = _mm256_fmadd_ps(a0, b1, d01); + d10 = _mm256_fmadd_ps(a1, b0, d10); + d11 = _mm256_fmadd_ps(a1, b1, d11); + d20 = _mm256_fmadd_ps(a2, b0, d20); + d21 = _mm256_fmadd_ps(a2, b1, d21); + d30 = _mm256_fmadd_ps(a3, b0, d30); + d31 = _mm256_fmadd_ps(a3, b1, d31); + } + + _mm256_storeu_ps(cptr0 + n, d00); + _mm256_storeu_ps(cptr0 + n + 8, d01); + _mm256_storeu_ps(cptr1 + n, d10); + _mm256_storeu_ps(cptr1 + n + 8, d11); + _mm256_storeu_ps(cptr2 + n, d20); + _mm256_storeu_ps(cptr2 + n + 8, d21); + _mm256_storeu_ps(cptr3 + n, d30); + _mm256_storeu_ps(cptr3 + n + 8, d31); + } + } + _mm256_zeroupper(); + + for( ; n < nb; n++ ) + { + for( int m = 0; m < ma; m++ ) + { + const float* aptr0 = aptr + astep*m; + float* cptr0 = cptr + cstep*m; + float d0 = 0.f; + + for( int k = 0; k < na; k++ ) + d0 += aptr0[k]*bptr[k*bstep + n]; + + cptr0[n] = d0; + } + } +} + +} +} + +#endif diff --git a/modules/dnn/src/layers/layers_common.cpp b/modules/dnn/src/layers/layers_common.cpp new file mode 100644 index 0000000000..038422baca --- /dev/null +++ b/modules/dnn/src/layers/layers_common.cpp @@ -0,0 +1,205 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "layers_common.hpp" + +namespace cv +{ +namespace dnn +{ + +namespace util +{ + +std::string makeName(const std::string& str1, const std::string& str2) +{ + return str1 + str2; +} + +bool getParameter(const LayerParams ¶ms, const std::string& nameBase, const std::string& nameAll, + int ¶meterH, int ¶meterW, bool hasDefault = false, const int& defaultValue = 0) +{ + std::string nameH = makeName(nameBase, std::string("_h")); + std::string nameW = makeName(nameBase, std::string("_w")); + std::string nameAll_ = nameAll; + if(nameAll_ == "") + { + nameAll_ = nameBase; + } + + if (params.has(nameH) && params.has(nameW)) + { + parameterH = params.get(nameH); + parameterW = params.get(nameW); + return true; + } + else + { + if (params.has(nameAll_)) + { + parameterH = parameterW = params.get(nameAll_); + return true; + } + else + { + if(hasDefault) + { + parameterH = parameterW = defaultValue; + return true; + } + else + { + return false; + } + } + } +} + +void getKernelSize(const LayerParams ¶ms, int &kernelH, int &kernelW) +{ + if(!util::getParameter(params, "kernel", "kernel_size", kernelH, kernelW)) + { + CV_Error(cv::Error::StsBadArg, "kernel_size (or kernel_h and kernel_w) not specified"); + } + + CV_Assert(kernelH > 0 && kernelW > 0); +} + +void getStrideAndPadding(const LayerParams ¶ms, int &padH, int &padW, int &strideH, int &strideW, cv::String& padMode) +{ + util::getParameter(params, "pad", "pad", padH, padW, true, 0); + util::getParameter(params, "stride", "stride", strideH, strideW, true, 1); + + padMode = ""; + if (params.has("pad_mode")) + { + padMode = params.get("pad_mode"); + } + + CV_Assert(padH >= 0 && padW >= 0 && strideH > 0 && strideW > 0); +} +} + + +void getPoolingKernelParams(const LayerParams ¶ms, int &kernelH, int &kernelW, bool &globalPooling, + int &padH, int &padW, int &strideH, int &strideW, cv::String &padMode) +{ + util::getStrideAndPadding(params, padH, padW, strideH, strideW, padMode); + + globalPooling = params.has("global_pooling"); + + if (globalPooling) + { + if(params.has("kernel_h") || params.has("kernel_w") || params.has("kernel_size")) + { + CV_Error(cv::Error::StsBadArg, "In global_pooling mode, kernel_size (or kernel_h and kernel_w) cannot be specified"); + } + if(padH != 0 || padW != 0 || strideH != 1 || strideW != 1) + { + CV_Error(cv::Error::StsBadArg, "In global_pooling mode, pad_h and pad_w must be = 0, and stride_h and stride_w must be = 1"); + } + } + else + { + util::getKernelSize(params, kernelH, kernelW); + } +} + +void getConvolutionKernelParams(const LayerParams ¶ms, int &kernelH, int &kernelW, int &padH, int &padW, + int &strideH, int &strideW, int &dilationH, int &dilationW, cv::String &padMode) +{ + util::getKernelSize(params, kernelH, kernelW); + util::getStrideAndPadding(params, padH, padW, strideH, strideW, padMode); + + util::getParameter(params, "dilation", "dilation", dilationH, dilationW, true, 1); + + CV_Assert(dilationH > 0 && dilationW > 0); +} + +// From TensorFlow code: +// Total padding on rows and cols is +// Pr = (R' - 1) * S + Kr - R +// Pc = (C' - 1) * S + Kc - C +// where (R', C') are output dimensions, (R, C) are input dimensions, S +// is stride, (Kr, Kc) are filter dimensions. +// We pad Pr/2 on the left and Pr - Pr/2 on the right, Pc/2 on the top +// and Pc - Pc/2 on the bottom. When Pr or Pc is odd, this means +// we pad more on the right and bottom than on the top and left. +void getConvPoolOutParams(const Size& inp, const Size &kernel, + const Size &stride, const String &padMode, + Size& out) +{ + if (padMode == "VALID") + { + out.height = (inp.height - kernel.height + stride.height) / stride.height; + out.width = (inp.width- kernel.width + stride.width) / stride.width; + } + else if (padMode == "SAME") + { + out.height = (inp.height - 1 + stride.height) / stride.height; + out.width = (inp.width - 1 + stride.width) / stride.width; + } + else + { + CV_Error(Error::StsError, "Unsupported padding mode"); + } +} + +void getConvPoolPaddings(const Size& inp, const Size& out, + const Size &kernel, const Size &stride, + const String &padMode, Size &pad) +{ + if (padMode == "VALID") + { + pad = cv::Size(0,0); + } + else if (padMode == "SAME") + { + int Ph = std::max(0, (out.height - 1) * stride.height + kernel.height - inp.height); + int Pw = std::max(0, (out.width - 1) * stride.width + kernel.width - inp.width); + // For odd values of total padding, add more padding at the 'right' + // side of the given dimension. + pad = cv::Size(Pw / 2, Ph / 2); + } +} + +} +} diff --git a/modules/dnn/src/layers/layers_common.hpp b/modules/dnn/src/layers/layers_common.hpp new file mode 100644 index 0000000000..7f46369888 --- /dev/null +++ b/modules/dnn/src/layers/layers_common.hpp @@ -0,0 +1,87 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_LAYERS_LAYERS_COMMON_HPP__ +#define __OPENCV_DNN_LAYERS_LAYERS_COMMON_HPP__ +#include +#include + +namespace cv +{ +namespace dnn +{ + +void getConvolutionKernelParams(const LayerParams ¶ms, int &kernelH, int &kernelW, int &padH, int &padW, + int &strideH, int &strideW, int &dilationH, int &dilationW, cv::String& padMode); + +void getPoolingKernelParams(const LayerParams ¶ms, int &kernelH, int &kernelW, bool &globalPooling, + int &padH, int &padW, int &strideH, int &strideW, cv::String& padMode); + +void getConvPoolOutParams(const Size& inp, const Size &kernel, + const Size &stride, const String &padMode, + Size& out); + +void getConvPoolPaddings(const Size& inp, const Size& out, + const Size &kernel, const Size &stride, + const String &padMode, Size &pad); + +#if CV_SSE2 +#define CV_DNN_TRY_AVX2 1 + +void fastConv_avx2(const float* weights, size_t wstep, const float* bias, + const float* rowbuf, float* output, const int* outShape, + int blockSize, int vecsize, int vecsize_aligned, + const float* relu, bool initOutput); +void fastGEMM1T_avx2( const float* vec, const float* weights, + size_t wstep, const float* bias, + float* dst, int nvecs, int vecsize ); +void fastGEMM_avx2( const float* aptr, size_t astep, const float* bptr0, + size_t bstep, float* cptr, size_t cstep, + int ma, int na, int nb ); + +#else +#define CV_DNN_TRY_AVX2 0 +#endif + +} +} + +#endif diff --git a/modules/dnn/src/layers/lrn_layer.cpp b/modules/dnn/src/layers/lrn_layer.cpp new file mode 100644 index 0000000000..80b48c8864 --- /dev/null +++ b/modules/dnn/src/layers/lrn_layer.cpp @@ -0,0 +1,341 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/dnn/shape_utils.hpp" +#include "opencv2/core/hal/hal.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class LRNLayerImpl : public LRNLayer +{ +public: + LRNLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + type = -1; + String nrmType = params.get("norm_region", "ACROSS_CHANNELS"); + if (nrmType == "ACROSS_CHANNELS") + type = LRNLayer::CHANNEL_NRM; + else if (nrmType == "WITHIN_CHANNEL") + type = LRNLayer::SPATIAL_NRM; + else + CV_Error(Error::StsBadArg, "Unknown region type \"" + nrmType + "\""); + + size = params.get("local_size", 5); + if (size % 2 != 1 || size <= 0) + CV_Error(Error::StsBadArg, "LRN layer supports only positive odd values for local_size"); + + alpha = params.get("alpha", 1); + beta = params.get("beta", 0.75); + bias = params.get("bias", 1); + normBySize = params.get("norm_by_size", true); + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + CV_Assert(inputs.size() == outputs.size()); + for (int i = 0; i < inputs.size(); i++) + { + CV_Assert(inputs[i]->dims == 4); + + Mat &src = *inputs[i]; + Mat &dst = outputs[i]; + + switch (type) + { + case CHANNEL_NRM: + channelNormalization(src, dst); + break; + case SPATIAL_NRM: + spatialNormalization(src, dst); + break; + default: + CV_Error(Error::StsNotImplemented, "Unimplemented mode of LRN layer"); + break; + } + } + } + + class ChannelLRN : public ParallelLoopBody + { + public: + ChannelLRN(const float* src, float* dst, int channels, int ksize, + float alpha1, float bias1, float beta1, + size_t planeSize, int nsamples, int nstripes) + { + src_ = src; dst_ = dst; + channels_ = channels; + ksize_ = ksize; + alpha1_ = alpha1; bias1_ = bias1; beta1_ = beta1; + planeSize_ = planeSize; nsamples_ = nsamples; nstripes_ = nstripes; + } + + void operator()(const Range& r) const + { + int nsamples = nsamples_, nstripes = nstripes_; + size_t planeSize = planeSize_, planeSize_n = planeSize * nsamples; + size_t elemsPerStripe = (planeSize_n + nstripes - 1)/nstripes; + size_t rstart = r.start*elemsPerStripe; + size_t rend = r.end == nstripes ? planeSize_n : r.end*elemsPerStripe; + rstart = std::min(rstart, planeSize_n); + rend = std::min(rend, planeSize_n); + float alpha1 = alpha1_, bias1 = bias1_, beta1 = beta1_; + int k, channels = channels_, ksize = ksize_; + + AutoBuffer buf_((channels + ksize*2 + 4)*2); + float* acc = (float*)buf_; + float* buf = acc + channels + ksize + 1; + for( k = 0; k <= ksize; k++ ) + buf[-k-1] = buf[channels + k] = 0.f; + + for( size_t ofs = rstart; ofs < rend; ) + { + int sampleIdx = (int)(ofs/planeSize); + if( sampleIdx >= nsamples ) + break; + size_t ofs0 = ofs - sampleIdx*planeSize; + size_t ofs1 = std::min(planeSize - ofs0, rend - ofs) + ofs; + const float* src = src_ + sampleIdx*planeSize*channels + ofs0; + float* dst = dst_ + sampleIdx*planeSize*channels + ofs0; + + for( ; ofs < ofs1; ofs++, src++, dst++ ) + { + for( k = 0; k < channels; k++ ) + buf[k] = src[k*planeSize]; + float s = 0; + for( k = 0; k < ksize; k++ ) + s += buf[k]*buf[k]; + for( k = 0; k < channels; k++ ) + { + float x1 = buf[k + ksize]; + float x0 = buf[k - ksize - 1]; + s = std::max(s + (x1 + x0)*(x1 - x0), 0.f); + acc[k] = (float)(alpha1*s + bias1); + } + + hal::log32f(acc, acc, channels); + for( k = 0; k < channels; k++ ) + acc[k] *= beta1; + hal::exp32f(acc, acc, channels); + + for( k = 0; k < channels; k++ ) + dst[k*planeSize] = buf[k]*acc[k]; + } + } + } + + const float* src_; + float* dst_; + float alpha1_, bias1_, beta1_; + size_t planeSize_; + int channels_, ksize_, nsamples_, nstripes_; + }; + + void channelNormalization(Mat &srcBlob, Mat &dstBlob) + { + int num = srcBlob.size[0]; + int channels = srcBlob.size[1]; + int ksize = (size - 1) / 2; + int sizeNormFactor = normBySize ? size : 1; + size_t planeSize = srcBlob.size[2]*srcBlob.size[3]; + + int nstripes = std::max(getNumThreads(), 1); + + ChannelLRN clrn(srcBlob.ptr(), dstBlob.ptr(), channels, + ksize, alpha/sizeNormFactor, bias, -beta, planeSize, num, nstripes); + parallel_for_(Range(0, nstripes), clrn, nstripes); + } + + void sqrBoxFilter_(const Mat &src, Mat &dst) + { + Mat srcRawWrapper(src.rows, src.cols, src.type(), src.data, src.step[0]); + cv::sqrBoxFilter(srcRawWrapper, dst, dst.depth(), Size(size, size), Point(-1, -1), false, BORDER_CONSTANT); + } + + void spatialNormalization(Mat &srcBlob, Mat &dstBlob) + { + int num = srcBlob.size[0]; + int channels = srcBlob.size[1]; + int sizeNormFactor = normBySize ? size*size : 1; + + Mat srcMat = srcBlob; + Mat dstMat = dstBlob; + + for (int n = 0; n < num; n++) + { + for (int cn = 0; cn < channels; cn++) + { + Mat src = getPlane(srcMat, n, cn); + Mat dst = getPlane(dstMat, n, cn); + + sqrBoxFilter_(src, dst); + + dst.convertTo(dst, dst.type(), alpha/sizeNormFactor, bias); + cv::pow(dst, beta, dst); + cv::divide(src, dst, dst); + } + } + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + float alphaSize = alpha; + if (normBySize) + alphaSize /= (type == CHANNEL_NRM ? size : size * size); + int width, height, channels, numImgs; + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + getCanonicalSize(inputBuffer, &width, &height, &channels, &numImgs); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Func padded_sq(name + "_padded_sq"); + Halide::Func sq("sq"); + sq(x, y, c, n) = inputBuffer(x, y, c, n) * inputBuffer(x, y, c, n); + + Halide::Func bounded = + Halide::BoundaryConditions::constant_exterior(sq, 0, 0, width, + 0, height, + 0, channels, + 0, numImgs); + padded_sq(x, y, c, n) = bounded(x, y, c, n); + + Halide::Expr base; + if (type == CHANNEL_NRM) + { + Halide::RDom r((1 - size) / 2, size); + base = alphaSize * sum(padded_sq(x, y, c + r, n)); + } + else // SPATIAL_NRM + { + Halide::RDom r((1 - size) / 2, size, (1 - size) / 2, size); + base = alphaSize * sum(padded_sq(x + r.x, y + r.y, c, n)); + } + base += static_cast(bias); + top(x, y, c, n) = inputBuffer(x, y, c, n) / pow(base, beta); + return Ptr(new HalideBackendNode({ padded_sq, top })); +#endif // HAVE_HALIDE + return Ptr(); + } + + virtual void applyHalideScheduler(Ptr& node, + const std::vector &inputs, + const std::vector &outputs, + int targetId) const + { +#ifdef HAVE_HALIDE + if (targetId != DNN_TARGET_CPU) + { + Layer::applyHalideScheduler(node, inputs, outputs, targetId); + return; + } + int outW, outH, outC, outN; + getCanonicalSize(outputs[0].size, &outW, &outH, &outC, &outN); + + Halide::Var x("x"), y("y"), c("c"), n("n"), yo("yo"), yi("yi"), tile("tile"); + Halide::Func& top = node.dynamicCast()->funcs[1]; + Halide::Func& padded_sq = node.dynamicCast()->funcs[0]; + + if (outW < 8 || outH <= 2) + return; + + top.reorder(x, c, y, n) + .split(y, yo, yi, 2) + .fuse(yo, n, tile) + .parallel(tile) + .unroll(yi) + .vectorize(x, 8); + padded_sq.store_at(top, tile) + .compute_at(top, yi); +#endif // HAVE_HALIDE + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + CV_Assert(inputs.size() > 0); + long flops = 0; + + for(int i = 0; i < inputs.size(); i++) + { + if (type == CHANNEL_NRM) + { + int channels = inputs[i][1]; + int ksize = (size - 1) / 2; + + flops += inputs[i][0]*(std::min(ksize, channels)*2*total(inputs[i], 2) + channels*4*total(inputs[i], 2)); + + if (ksize < channels) + { + flops += (size + 2*(channels - size))*total(inputs[i], 2); + } + } + else + { + flops += total(inputs[i])*(2*size*size + 2); + } + } + return flops; + } +}; + +Ptr LRNLayer::create(const LayerParams& params) +{ + return Ptr(new LRNLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/max_unpooling_layer.cpp b/modules/dnn/src/layers/max_unpooling_layer.cpp new file mode 100644 index 0000000000..70dc18d737 --- /dev/null +++ b/modules/dnn/src/layers/max_unpooling_layer.cpp @@ -0,0 +1,128 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of Batch Normalization layer. +*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class MaxUnpoolLayerImpl : public MaxUnpoolLayer +{ +public: + MaxUnpoolLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + poolKernel = Size(params.get("pool_k_w"), params.get("pool_k_h")); + poolPad = Size(params.get("pool_pad_w"), params.get("pool_pad_h")); + poolStride = Size(params.get("pool_stride_w"), params.get("pool_stride_h")); + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide() && + !poolPad.width && !poolPad.height; + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() == 2); + CV_Assert(total(inputs[0]) == total(inputs[1])); + + MatShape outShape = inputs[0]; + outShape[2] = (outShape[2] - 1) * poolStride.height + poolKernel.height - 2 * poolPad.height; + outShape[3] = (outShape[3] - 1) * poolStride.width + poolKernel.width - 2 * poolPad.width; + + outputs.clear(); + outputs.push_back(outShape); + + return false; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + CV_Assert(inputs.size() == 2); + Mat& input = *inputs[0]; + Mat& indices = *inputs[1]; + + CV_Assert(input.total() == indices.total()); + CV_Assert(input.size[0] == 1); + CV_Assert(input.isContinuous()); + + for(int i_n = 0; i_n < outputs.size(); i_n++) + { + Mat& outBlob = outputs[i_n]; + outBlob.setTo(0); + CV_Assert(input.size[1] == outBlob.size[1]); + int outPlaneTotal = outBlob.size[2]*outBlob.size[3]; + + for (int i_c = 0; i_c < input.size[1]; i_c++) + { + Mat outPlane = getPlane(outBlob, 0, i_c); + int wh_area = input.size[2]*input.size[3]; + const float* inptr = input.ptr(0, i_c); + const float* idxptr = indices.ptr(0, i_c); + float* outptr = outPlane.ptr(); + + for(int i_wh = 0; i_wh < wh_area; i_wh++) + { + int index = idxptr[i_wh]; + CV_Assert(0 <= index && index < outPlaneTotal); + outptr[index] = inptr[i_wh]; + } + } + } + } + + virtual Ptr initHalide(const std::vector > &input) + { +#ifdef HAVE_HALIDE + // Meaningless operation if false because if kernel > stride + // it is not deterministic and if kernel < stride we just + // skip a part of input data (you'd better change your model). + if (poolKernel.width != poolStride.width || + poolKernel.height != poolStride.height) + CV_Error(cv::Error::StsNotImplemented, + "Halide backend for maximum unpooling " + "is not support cases when kernel != stride"); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Buffer inputBuffer = halideBuffer(input[0]); + Halide::Buffer indices = halideBuffer(input[1]); + + Halide::Expr pooledX = x / poolKernel.width; + Halide::Expr pooledY = y / poolKernel.height; + + const int outW = inputBuffer.width() * poolKernel.width; + top(x, y, c, n) = select(y * outW + x == indices(pooledX, pooledY, c, n), + inputBuffer(pooledX, pooledY, c, n), 0.0f); + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } +}; + +Ptr MaxUnpoolLayer::create(const LayerParams& params) +{ + return Ptr(new MaxUnpoolLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/mvn_layer.cpp b/modules/dnn/src/layers/mvn_layer.cpp new file mode 100644 index 0000000000..e5bdf9ba78 --- /dev/null +++ b/modules/dnn/src/layers/mvn_layer.cpp @@ -0,0 +1,108 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class MVNLayerImpl : public MVNLayer +{ +public: + MVNLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + normVariance = params.get("normalize_variance", true); + acrossChannels = params.get("across_channels", false); + eps = params.get("eps", 1e-9); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (size_t inpIdx = 0; inpIdx < inputs.size(); inpIdx++) + { + Mat &inpBlob = *inputs[inpIdx]; + Mat &outBlob = outputs[inpIdx]; + + int splitDim = (acrossChannels) ? 1 : 2; + int i, newRows = 1; + for( i = 0; i < splitDim; i++ ) + newRows *= inpBlob.size[i]; + Mat inpMat = inpBlob.reshape(1, newRows); + Mat outMat = outBlob.reshape(1, newRows); + + Scalar mean, dev; + for ( i = 0; i < newRows; i++) + { + Mat inpRow = inpMat.row(i); + Mat outRow = outMat.row(i); + + cv::meanStdDev(inpRow, mean, (normVariance) ? dev : noArray()); + double alpha = (normVariance) ? 1/(eps + dev[0]) : 1; + inpRow.convertTo(outRow, outRow.type(), alpha, -mean[0] * alpha); + } + } + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + long flops = 0; + for(int i = 0; i < inputs.size(); i++) + { + flops += 6*total(inputs[i]) + 3*total(inputs[i], 0, normVariance ? 2 : 1); + } + return flops; + } +}; + +Ptr MVNLayer::create(const LayerParams& params) +{ + return Ptr(new MVNLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/normalize_bbox_layer.cpp b/modules/dnn/src/layers/normalize_bbox_layer.cpp new file mode 100644 index 0000000000..8299484fd2 --- /dev/null +++ b/modules/dnn/src/layers/normalize_bbox_layer.cpp @@ -0,0 +1,223 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" + +#include +#include + +namespace cv +{ +namespace dnn +{ + +namespace +{ + const std::string layerName = "NormalizeBBox"; +} + +class NormalizeBBoxLayerImpl : public NormalizeBBoxLayer +{ + float _eps; + bool _across_spatial; + bool _channel_shared; +public: + bool getParameterDict(const LayerParams ¶ms, + const std::string ¶meterName, + DictValue& result) + { + if (!params.has(parameterName)) + { + return false; + } + + result = params.get(parameterName); + return true; + } + + template + T getParameter(const LayerParams ¶ms, + const std::string ¶meterName, + const size_t &idx=0, + const bool required=true, + const T& defaultValue=T()) + { + DictValue dictValue; + bool success = getParameterDict(params, parameterName, dictValue); + if(!success) + { + if(required) + { + std::string message = layerName; + message += " layer parameter does not contain "; + message += parameterName; + message += " parameter."; + CV_Error(Error::StsBadArg, message); + } + else + { + return defaultValue; + } + } + return dictValue.get(idx); + } + + NormalizeBBoxLayerImpl(const LayerParams ¶ms) + { + _eps = getParameter(params, "eps", 0, false, 1e-10f); + _across_spatial = getParameter(params, "across_spatial"); + _channel_shared = getParameter(params, "channel_shared"); + setParamsFrom(params); + } + + void checkInputs(const std::vector &inputs) + { + CV_Assert(inputs.size() > 0); + CV_Assert(inputs[0]->dims == 4 && inputs[0]->type() == CV_32F); + for (size_t i = 1; i < inputs.size(); i++) + { + CV_Assert(inputs[i]->dims == 4 && inputs[i]->type() == CV_32F); + CV_Assert(inputs[i]->size == inputs[0]->size); + } + CV_Assert(inputs[0]->dims > 2); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + bool inplace = Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + size_t channels = inputs[0][1]; + size_t rows = inputs[0][2]; + size_t cols = inputs[0][3]; + size_t channelSize = rows * cols; + + internals.assign(1, shape(channels, channelSize)); + internals.push_back(shape(channels, 1)); + internals.push_back(shape(1, channelSize)); + + return inplace; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + checkInputs(inputs); + + Mat& buffer = internals[0], sumChannelMultiplier = internals[1], + sumSpatialMultiplier = internals[2]; + + sumChannelMultiplier.setTo(1.0); + sumSpatialMultiplier.setTo(1.0); + + const Mat& inp0 = *inputs[0]; + size_t num = inp0.size[0]; + size_t channels = inp0.size[1]; + size_t channelSize = inp0.size[2] * inp0.size[3]; + + Mat zeroBuffer(channels, channelSize, CV_32F, Scalar(0)); + Mat absDiff; + Mat scale = blobs[0]; + for (size_t j = 0; j < inputs.size(); j++) + { + for (size_t n = 0; n < num; ++n) + { + Mat src = Mat(channels, channelSize, CV_32F, inputs[j]->ptr(n)); + Mat dst = Mat(channels, channelSize, CV_32F, outputs[j].ptr(n)); + + buffer = src.mul(src); + + if (_across_spatial) + { + absdiff(buffer, zeroBuffer, absDiff); + + // add eps to avoid overflow + double absSum = sum(absDiff)[0] + _eps; + + float norm = sqrt(absSum); + dst = src / norm; + } + else + { + Mat norm(channelSize, 1, buffer.type()); // 1 x channelSize + + // (_channels x channelSize)T * _channels x 1 -> channelSize x 1 + gemm(buffer, sumChannelMultiplier, 1, norm, 0, norm, GEMM_1_T); + + // compute norm + pow(norm, 0.5f, norm); + + // scale the layer + // _channels x 1 * (channelSize x 1)T -> _channels x channelSize + gemm(sumChannelMultiplier, norm, 1, buffer, 0, buffer, GEMM_2_T); + + dst = src / buffer; + } + + // scale the output + if (_channel_shared) + { + // _scale: 1 x 1 + dst *= scale.at(0, 0); + } + else + { + // _scale: _channels x 1 + // _channels x 1 * 1 x channelSize -> _channels x channelSize + gemm(scale, sumSpatialMultiplier, 1, buffer, 0, buffer); + + dst = dst.mul(buffer); + } + } + } + } + +}; + + +Ptr NormalizeBBoxLayer::create(const LayerParams ¶ms) +{ + return Ptr(new NormalizeBBoxLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/padding_layer.cpp b/modules/dnn/src/layers/padding_layer.cpp new file mode 100644 index 0000000000..4e87426c3c --- /dev/null +++ b/modules/dnn/src/layers/padding_layer.cpp @@ -0,0 +1,131 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of padding layer, which adds paddings to input blob. +*/ + +#include "../precomp.hpp" +#include "op_halide.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class PaddingLayerImpl : public PaddingLayer +{ +public: + PaddingLayerImpl(const LayerParams ¶ms) + { + setParamsFrom(params); + paddingDim = params.get("padding_dim"); + padding = abs(params.get("padding")); + inputDims = params.get("input_dims", 0); + index = params.get("index", 0); + paddingValue = params.get("value", 0); + + if(paddingDim < 0 || padding < 0) + CV_Error(cv::Error::StsNotImplemented, "Negative padding and dim aren't supported"); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + outputs.clear(); + for(int i = 0; i < inputs.size(); i++) + { + MatShape shape = inputs[i]; + int dim = getPadDim(shape); + CV_Assert(dim < shape.size()); + + shape[dim] += padding; + outputs.push_back(shape); + } + + return false; + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for(int i = 0; i < inputs.size(); i++) + { + outputs[i] = paddingValue; + const Mat& inp = *inputs[i]; + Mat& out = outputs[i]; + int dims = inp.dims; + MatShape inShape(inp.size.p, inp.size.p + dims); + MatShape outShape(out.size.p, out.size.p + dims); + int dim = getPadDim(inShape); + + int actualIndex = index; + if(index == 0) + actualIndex = inShape[dim]; + + std::vector > srcDstRanges; + srcDstRanges.push_back(std::make_pair(Range(0, actualIndex), Range(0, actualIndex))); + srcDstRanges.push_back(std::make_pair(Range(actualIndex, inShape[dim]), + Range(actualIndex + padding, outShape[dim]))); + + std::vector srcRanges(dims, Range::all()), dstRanges = srcRanges; + + for(int j = 0; j < srcDstRanges.size(); j++) + { + if(!srcDstRanges[j].first.empty()) + { + srcRanges[dim] = srcDstRanges[j].first; + dstRanges[dim] = srcDstRanges[j].second; + Mat dst = out(&dstRanges[0]); + Mat src = inp(&srcRanges[0]).clone(); + src.copyTo(dst); + } + } + } + } + + int getPadDim(const MatShape& shape) const + { + return inputDims > 0 && (int)shape.size() > inputDims ? paddingDim + 1 : paddingDim; + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + int inW, inH, inC, inN; + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + getCanonicalSize(inputBuffer, &inW, &inH, &inC, &inN); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Func padded = + Halide::BoundaryConditions::constant_exterior(inputBuffer, paddingValue); + top(x, y, c, n) = padded(x, y, c, n); + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + int paddingDim, padding, inputDims, index; + float paddingValue; +}; + +Ptr PaddingLayer::create(const LayerParams ¶ms) +{ + return Ptr(new PaddingLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/permute_layer.cpp b/modules/dnn/src/layers/permute_layer.cpp new file mode 100644 index 0000000000..202359f451 --- /dev/null +++ b/modules/dnn/src/layers/permute_layer.cpp @@ -0,0 +1,243 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include +#include + +namespace cv +{ +namespace dnn +{ +class PermuteLayerImpl : public PermuteLayer +{ +public: + void checkCurrentOrder(int currentOrder) + { + if(currentOrder < 0 || currentOrder > 3) + { + CV_Error( + Error::StsBadArg, + "Orders of dimensions in Permute layer parameter" + "must be in [0...3] interval"); + } + + if(std::find(_order.begin(), _order.end(), currentOrder) != _order.end()) + { + CV_Error(Error::StsBadArg, + "Permute layer parameter contains duplicated orders."); + } + } + + void checkNeedForPermutation() + { + _needsPermute = false; + for (size_t i = 0; i < _numAxes; ++i) + { + if (_order[i] != i) + { + _needsPermute = true; + break; + } + } + } + + PermuteLayerImpl(const LayerParams ¶ms) + { + if (!params.has("order")) + { + _needsPermute = false; + return; + } + + DictValue paramOrder = params.get("order"); + if(paramOrder.size() > 4) + { + CV_Error( + Error::StsBadArg, + "Too many (> 4) orders of dimensions in Permute layer"); + } + + _numAxes = paramOrder.size(); + + for (size_t i = 0; i < _numAxes; i++) + { + int currentOrder = paramOrder.get(i); + checkCurrentOrder(currentOrder); + _order.push_back(currentOrder); + } + + setParamsFrom(params); + checkNeedForPermutation(); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + if(!_needsPermute) + return true; + + CV_Assert(inputs.size() > 0); + CV_Assert((int)_numAxes == inputs[0].size()); + + MatShape shapeBefore = inputs[0], shapeAfter; + for (size_t i = 0; i < _numAxes; i++) + { + shapeAfter.push_back(shapeBefore[_order[i]]); + } + + outputs.clear(); + + for (size_t i = 0; i < inputs.size(); i++) + { + CV_Assert(inputs[i][2] == shapeBefore[2] && inputs[i][3] == shapeBefore[3]); + CV_Assert(total(inputs[i]) == total(shapeAfter)); + outputs.push_back(shapeAfter); + } + + return false; + } + + void computeStrides(const MatShape &shapeBefore, const MatShape &shapeAfter) + { + _oldStride.resize(_numAxes); + _newStride.resize(_numAxes); + + _oldStride[_numAxes - 1] = 1; + _newStride[_numAxes - 1] = 1; + + for(int i = _numAxes - 2; i >= 0; i--) + { + _oldStride[i] = _oldStride[i + 1] * shapeBefore[i + 1]; + _newStride[i] = _newStride[i + 1] * shapeAfter[i + 1]; + } + + _count = _oldStride[0] * shapeBefore[0]; + } + + void finalize(const std::vector &inputs, std::vector &outputs) + { + if(!_needsPermute) + { + return; + } + + CV_Assert(inputs.size() > 0); + const Mat& inp0 = *inputs[0]; + CV_Assert((int)_numAxes == inp0.dims); + + computeStrides(shape(*inputs[0]), shape(outputs[0])); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + size_t k, ninputs = inputs.size(); + if(!_needsPermute) + { + for (k = 0; k < ninputs; k++) + outputs[k] = *inputs[k]; + } + else + { + size_t i, j, count = _count, numAxes = _numAxes; + const size_t* newStride = &_newStride[0]; + const size_t* oldStride = &_oldStride[0]; + const size_t* order = &_order[0]; + + for (k = 0; k < ninputs; k++) + { + const Mat& inp = *inputs[k]; + Mat& out = outputs[k]; + + CV_Assert(inp.dims == numAxes && inp.size == inputs[0]->size); + CV_Assert(out.dims == numAxes && out.size == outputs[0].size); + +// for( i = 0; i < numAxes; i++ ) +// { +// CV_Assert(inp.size[i] == _oldDimensionSize[i]); +// CV_Assert(out.size[i] == _newDimensionSize[i]); +// } + + CV_Assert(inp.isContinuous() && out.isContinuous()); + CV_Assert(inp.type() == CV_32F && out.type() == CV_32F); + + const float *srcData = inp.ptr(); + float *dstData = out.ptr(); + + for (i = 0; i < count; ++i) + { + size_t oldPosition = 0; + size_t newPosition = i; + + for (j = 0; j < numAxes; ++j) + { + oldPosition += (newPosition / newStride[j]) * oldStride[order[j]]; + newPosition %= newStride[j]; + } + dstData[i] = srcData[oldPosition]; + } + } + } + } + + size_t _count; + std::vector _order; + + std::vector _oldDimensionSize; + std::vector _newDimensionSize; + + std::vector _oldStride; + std::vector _newStride; + bool _needsPermute; + + size_t _numAxes; +}; + +Ptr PermuteLayer::create(const LayerParams ¶ms) +{ + return Ptr(new PermuteLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp new file mode 100644 index 0000000000..25fe46889d --- /dev/null +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -0,0 +1,566 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "opencv2/core/hal/intrin.hpp" +#include "op_halide.hpp" +#include +#include +using std::max; +using std::min; + +namespace cv +{ +namespace dnn +{ + +//TODO: add ceil_mode param +class PoolingLayerImpl : public PoolingLayer +{ +public: + PoolingLayerImpl(const LayerParams& params) + { + type = PoolingLayer::MAX; + computeMaxIdx = true; + + if (params.has("pool")) + { + String pool = params.get("pool").toLowerCase(); + if (pool == "max") + type = PoolingLayer::MAX; + else if (pool == "ave") + type = PoolingLayer::AVE; + else if (pool == "stochastic") + type = PoolingLayer::STOCHASTIC; + else + CV_Error(Error::StsBadArg, "Unknown pooling type \"" + pool + "\""); + } + + getPoolingKernelParams(params, kernel.height, kernel.width, globalPooling, + pad.height, pad.width, stride.height, stride.width, padMode); + setParamsFrom(params); + } + + void finalize(const std::vector &inputs, std::vector &outputs) + { + CV_Assert(inputs.size() == 1); + + cv::Size inp(inputs[0]->size[3], inputs[0]->size[2]), + out(outputs[0].size[3], outputs[0].size[2]); + + if(globalPooling) + { + kernel = inp; + } + + getConvPoolPaddings(inp, out, kernel, stride, padMode, pad); + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide() && + (type == PoolingLayer::MAX || + type == PoolingLayer::AVE && !pad.width && !pad.height); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (size_t ii = 0; ii < inputs.size(); ii++) + { + switch (type) + { + case MAX: + maxPooling(*inputs[ii], outputs[2 * ii], outputs[2 * ii + 1]); + break; + case AVE: + avePooling(*inputs[ii], outputs[ii]); + break; + default: + CV_Error(Error::StsNotImplemented, "Not implemented"); + break; + } + } + } + + virtual Ptr initHalide(const std::vector > &inputs) + { + if (type == PoolingLayer::MAX) + return initMaxPoolingHalide(inputs); + else if (type == PoolingLayer::AVE) + return initAvePoolingHalide(inputs); + else + return Ptr(); + } + + class MaxPoolingInvoker : public ParallelLoopBody + { + public: + const Mat* src_; + Mat *dst_, *mask_; + Size kernel_, stride_, pad_; + int nstripes_; + bool computeMaxIdx_; + + MaxPoolingInvoker(const Mat& src, Mat& dst, Mat& mask, Size kernel, + Size stride, Size pad, int nstripes, bool computeMaxIdx) + { + src_ = &src; + dst_ = &dst; + mask_ = &mask; + kernel_ = kernel; + stride_ = stride; + pad_ = pad; + nstripes_ = nstripes; + computeMaxIdx_ = computeMaxIdx; + + CV_Assert(src.isContinuous() && dst.isContinuous() && + src.type() == CV_32F && src.type() == dst.type() && + mask.type() == src.type() && src.dims == 4 && dst.dims == 4 && + src.size[0] == dst.size[0] && src.size[1] == dst.size[1] && + mask.size == dst.size); + } + + void operator()(const Range& r) const + { + int nimgs = dst_->size[0], channels = dst_->size[1]; + int width = dst_->size[3], height = dst_->size[2]; + int inp_width = src_->size[3], inp_height = src_->size[2]; + size_t total = dst_->total(); + size_t stripeSize = (total + nstripes_ - 1)/nstripes_; + size_t stripeStart = r.start*stripeSize; + size_t stripeEnd = std::min(r.end*stripeSize, total); + size_t ofs = stripeStart; + int x0 = (int)(ofs % width); + ofs /= width; + int y0 = (int)(ofs % height); + ofs /= height; + int c = (int)(ofs % channels); + int n = (int)(ofs / channels); + const float *srcData = src_->ptr(n, c); + float *dstData = dst_->ptr(n, c, y0) + x0; + float *dstMaskData = mask_->ptr(n, c, y0) + x0; + int kernel_w = kernel_.width, kernel_h = kernel_.height; + int pad_w = pad_.width, pad_h = pad_.height; + int stride_w = stride_.width, stride_h = stride_.height; + bool compMaxIdx = computeMaxIdx_; + #if CV_SIMD128 + v_float32x4 idx00(0.f, (float)stride_w, (float)(stride_w*2), (float)(stride_w*3)); + v_float32x4 ones = v_setall_f32(1.f); + v_float32x4 delta = v_setall_f32((float)(inp_width - kernel_w)); + #endif + + for( ofs = stripeStart; ofs < stripeEnd; ofs++ ) + { + int ystart = y0 * stride_h - pad_h; + int xstart = x0 * stride_w - pad_w; + int yend = min(ystart + kernel_h, inp_height); + int xend = min(xstart + kernel_w, inp_width); + ystart = max(ystart, 0); + xstart = max(xstart, 0); + float max_val = -FLT_MAX; + int max_index = -1; + + #if CV_SIMD128 + if( xstart > 0 && (x0 + 7) * stride_w - pad_w + kernel_w < inp_width ) + { + if( compMaxIdx ) + { + v_float32x4 max_val0 = v_setall_f32(max_val); + v_float32x4 max_val1 = max_val0; + v_float32x4 max_idx0 = v_setall_f32(-1.f); + v_float32x4 max_idx1 = max_idx0; + int index0 = ystart * inp_width + xstart; + v_float32x4 idx0 = idx00 + v_setall_f32((float)index0); + v_float32x4 idx1 = idx0 + v_setall_f32((float)(stride_w*4)); + + for (int y = ystart; y < yend; ++y) + { + for (int x = xstart; x < xend; ++x, idx0 += ones, idx1 += ones) + { + const int index = y * inp_width + x; + v_float32x4 v0(srcData[index], srcData[index + stride_w], + srcData[index + stride_w*2], srcData[index + stride_w*3]); + v_float32x4 v1(srcData[index + stride_w*4], srcData[index + stride_w*5], + srcData[index + stride_w*6], srcData[index + stride_w*7]); + max_idx0 = v_select(v0 > max_val0, idx0, max_idx0); + max_idx1 = v_select(v1 > max_val1, idx1, max_idx1); + max_val0 = v_max(max_val0, v0); + max_val1 = v_max(max_val1, v1); + } + idx0 += delta; + idx1 += delta; + } + v_store(dstData, max_val0); + v_store(dstData + 4, max_val1); + v_store(dstMaskData, max_idx0); + v_store(dstMaskData + 4, max_idx1); + ofs += 7; + dstData += 8; + dstMaskData += 8; + x0 += 7; + } + else + { + v_float32x4 max_val0 = v_setall_f32(max_val); + v_float32x4 max_val1 = max_val0; + + for (int y = ystart; y < yend; ++y) + { + for (int x = xstart; x < xend; ++x) + { + const int index = y * inp_width + x; + v_float32x4 v0(srcData[index], srcData[index + stride_w], + srcData[index + stride_w*2], srcData[index + stride_w*3]); + v_float32x4 v1(srcData[index + stride_w*4], srcData[index + stride_w*5], + srcData[index + stride_w*6], srcData[index + stride_w*7]); + max_val0 = v_max(max_val0, v0); + max_val1 = v_max(max_val1, v1); + } + } + v_store(dstData, max_val0); + v_store(dstData + 4, max_val1); + ofs += 7; + dstData += 8; + x0 += 7; + } + } + else + #endif + { + if( compMaxIdx ) + { + for (int y = ystart; y < yend; ++y) + for (int x = xstart; x < xend; ++x) + { + const int index = y * inp_width + x; + float val = srcData[index]; + if (val > max_val) + { + max_val = val; + max_index = index; + } + } + + *dstData++ = max_val; + *dstMaskData++ = max_index; + } + else + { + for (int y = ystart; y < yend; ++y) + for (int x = xstart; x < xend; ++x) + { + const int index = y * inp_width + x; + float val = srcData[index]; + max_val = std::max(max_val, val); + } + + *dstData++ = max_val; + } + } + + if( ++x0 >= width ) + { + x0 = 0; + if( ++y0 >= height ) + { + y0 = 0; + if( ++c >= channels ) + { + c = 0; + if( ++n >= nimgs ) + break; + } + srcData = src_->ptr(n, c); + } + } + } + } + }; + + void maxPooling(Mat &src, Mat &dst, Mat &mask) + { + const int nstripes = getNumThreads(); + MaxPoolingInvoker mp(src, dst, mask, kernel, stride, pad, nstripes, computeMaxIdx); + parallel_for_(Range(0, nstripes), mp, nstripes); + } + + void avePooling(Mat &src, Mat &dst) + { + Size inp(src.size[3], src.size[2]), + out(dst.size[3], dst.size[2]); + for (int n = 0; n < src.size[0]; ++n) + { + for (int c = 0; c < src.size[1]; ++c) + { + const float *srcData = src.ptr(n, c); + float *dstData = dst.ptr(n, c); + + for (int ph = 0; ph < out.height; ++ph) + { + for (int pw = 0; pw < out.width; ++pw) + { + int hstart = ph * stride.height - pad.height; + int wstart = pw * stride.width - pad.width; + int hend = min(hstart + kernel.height, inp.height + pad.height); + int wend = min(wstart + kernel.width, inp.width + pad.width); + int poolSize = (hend - hstart) * (wend - wstart); + hstart = max(hstart, 0); + wstart = max(wstart, 0); + hend = min(hend, inp.height); + wend = min(wend, inp.width); + + dstData[ph * out.width + pw] = 0.f; + + for (int h = hstart; h < hend; ++h) + for (int w = wstart; w < wend; ++w) + dstData[ph * out.width + pw] += srcData[h * inp.width + w]; + + dstData[ph * out.width + pw] /= poolSize; + } + } + } + } + } + + virtual Ptr initMaxPoolingHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + const int inWidth = inputBuffer.width(); + const int inHeight = inputBuffer.height(); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::RDom r(0, kernel.width, 0, kernel.height); + Halide::Expr kx, ky; + if (pad.width || pad.height) + { + kx = clamp(x * stride.width + r.x - pad.width, 0, inWidth - 1); + ky = clamp(y * stride.height + r.y - pad.height, 0, inHeight - 1); + } + else + { + kx = min(x * stride.width + r.x, inWidth - 1); + ky = min(y * stride.height + r.y, inHeight - 1); + } + + // Halide::argmax returns tuple (r.x, r.y, max). + Halide::Tuple res = argmax(inputBuffer(kx, ky, c, n)); + + // Compute offset from argmax in range [0, kernel_size). + Halide::Expr max_index; + if (pad.width || pad.height) + { + max_index = clamp(y * stride.height + res[1] - pad.height, + 0, inHeight - 1) * inWidth + + clamp(x * stride.width + res[0] - pad.width, + 0, inWidth - 1); + } + else + { + max_index = min(y * stride.height + res[1], inHeight - 1) * inWidth + + min(x * stride.width + res[0], inWidth - 1); + } + top(x, y, c, n) = { res[2], Halide::cast(max_index) }; + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + virtual Ptr initAvePoolingHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + + const int inW = inputBuffer.width(), inH = inputBuffer.height(); + if ((inW - kernel.width) % stride.width || (inH - kernel.height) % stride.height) + { + CV_Error(cv::Error::StsNotImplemented, + "Halide backend for average pooling with partial " + "kernels is not implemented"); + } + + const float norm = 1.0f / (kernel.width * kernel.height); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::RDom r(0, kernel.width, 0, kernel.height); + top(x, y, c, n) = sum( + inputBuffer(x * stride.width + r.x, + y * stride.height + r.y, c, n)) * norm; + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + virtual void applyHalideScheduler(Ptr& node, + const std::vector &inputs, + const std::vector &outputs, + int targetId) const + { +#ifdef HAVE_HALIDE + if (targetId != DNN_TARGET_CPU) + { + Layer::applyHalideScheduler(node, inputs, outputs, targetId); + return; + } + Halide::Var x("x"), y("y"), c("c"), n("n"), tile("tile"), + xi("xi"), yi("yi"), ci("ci"), xo("xo"), yo("yo"), co("co"); + Halide::Func& top = node.dynamicCast()->funcs.back(); + + int outW, outH, outC, outN; + getCanonicalSize(outputs[0].size, &outW, &outH, &outC, &outN); + + if (outW < 8 || outH < 8) + { + if (outC > 8) + top.split(c, co, ci, 8) + .fuse(x, y, tile).fuse(co, tile, tile).fuse(n, tile, tile) + .parallel(tile) + .vectorize(ci); + else + { + top.fuse(y, c, tile).fuse(n, tile, tile) + .parallel(tile); + if (outW > 1) + top.vectorize(x); + } + } + else + { + if (outC > 8) + top.split(x, xo, xi, 8).split(y, yo, yi, 8).split(c, co, ci, 8) + .fuse(xo, yo, tile).fuse(co, tile, tile).fuse(n, tile, tile) + .parallel(tile) + .vectorize(xi); + else + top.split(x, xo, xi, 8).split(y, yo, yi, 8) + .fuse(xo, yo, tile).fuse(c, tile, tile).fuse(n, tile, tile) + .parallel(tile) + .vectorize(xi); + } +#endif // HAVE_HALIDE + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() != 0); + Size in(inputs[0][3], inputs[0][2]), out; + + if (globalPooling) + { + out.height = 1; + out.width = 1; + } + else if (padMode.empty()) + { + //Yeah, something strange Caffe scheme-) + out.height = static_cast(ceil(static_cast(in.height + 2 * pad.height - + kernel.height) / stride.height)) + 1; + out.width = static_cast(ceil(static_cast(in.width + 2 * pad.width - + kernel.width) / stride.width)) + 1; + + if (pad.height || pad.width) + { + // If we have padding, ensure that the last pooling starts strictly + // inside the image (instead of at the padding); otherwise clip the last. + if ((out.height - 1) * stride.height >= in.height + pad.height) + --out.height; + if ((out.width - 1) * stride.width >= in.width + pad.width) + --out.width; + CV_Assert((out.height - 1) * stride.height < in.height + pad.height); + CV_Assert((out.width - 1) * stride.width < in.width + pad.width); + } + } + else + { + getConvPoolOutParams(in, kernel, stride, + padMode, out); + } + + outputs.resize(type == MAX ? 2 * inputs.size() : inputs.size()); + for (size_t i = 0; i < inputs.size(); i++) + { + size_t index = type == MAX ? 2*i : i; + int dims[] = {inputs[i][0], inputs[i][1], out.height, out.width}; + outputs[index] = shape(dims); + + if (type == MAX) + outputs[index + 1] = shape(dims); + } + + return false; + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)inputs; // suppress unused variable warning + long flops = 0; + + for(int i = 0; i < outputs.size(); i++) + { + if (type == MAX) + { + if (i%2 == 0) + flops += total(outputs[i])*kernel.area(); + } + else + { + flops += total(outputs[i])*(kernel.area() + 1); + } + } + return flops; + } +}; + +Ptr PoolingLayer::create(const LayerParams& params) +{ + return Ptr(new PoolingLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/prior_box_layer.cpp b/modules/dnn/src/layers/prior_box_layer.cpp new file mode 100644 index 0000000000..aee04e2801 --- /dev/null +++ b/modules/dnn/src/layers/prior_box_layer.cpp @@ -0,0 +1,379 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include +#include +#include + +namespace cv +{ +namespace dnn +{ + +class PriorBoxLayerImpl : public PriorBoxLayer +{ +public: + bool getParameterDict(const LayerParams ¶ms, + const std::string ¶meterName, + DictValue& result) + { + if (!params.has(parameterName)) + { + return false; + } + + result = params.get(parameterName); + return true; + } + + template + T getParameter(const LayerParams ¶ms, + const std::string ¶meterName, + const size_t &idx=0, + const bool required=true, + const T& defaultValue=T()) + { + DictValue dictValue; + bool success = getParameterDict(params, parameterName, dictValue); + if(!success) + { + if(required) + { + std::string message = _layerName; + message += " layer parameter does not contain "; + message += parameterName; + message += " parameter."; + CV_Error(Error::StsBadArg, message); + } + else + { + return defaultValue; + } + } + return dictValue.get(idx); + } + + void getAspectRatios(const LayerParams ¶ms) + { + DictValue aspectRatioParameter; + bool aspectRatioRetieved = getParameterDict(params, "aspect_ratio", aspectRatioParameter); + CV_Assert(aspectRatioRetieved); + + for (int i = 0; i < aspectRatioParameter.size(); ++i) + { + float aspectRatio = aspectRatioParameter.get(i); + bool alreadyExists = false; + + for (size_t j = 0; j < _aspectRatios.size(); ++j) + { + if (fabs(aspectRatio - _aspectRatios[j]) < 1e-6) + { + alreadyExists = true; + break; + } + } + if (!alreadyExists) + { + _aspectRatios.push_back(aspectRatio); + if (_flip) + { + _aspectRatios.push_back(1./aspectRatio); + } + } + } + } + + void getVariance(const LayerParams ¶ms) + { + DictValue varianceParameter; + bool varianceParameterRetrieved = getParameterDict(params, "variance", varianceParameter); + CV_Assert(varianceParameterRetrieved); + + int varianceSize = varianceParameter.size(); + if (varianceSize > 1) + { + // Must and only provide 4 variance. + CV_Assert(varianceSize == 4); + + for (int i = 0; i < varianceSize; ++i) + { + float variance = varianceParameter.get(i); + CV_Assert(variance > 0); + _variance.push_back(variance); + } + } + else + { + if (varianceSize == 1) + { + float variance = varianceParameter.get(0); + CV_Assert(variance > 0); + _variance.push_back(variance); + } + else + { + // Set default to 0.1. + _variance.push_back(0.1f); + } + } + } + + PriorBoxLayerImpl(const LayerParams ¶ms) + { + setParamsFrom(params); + _minSize = getParameter(params, "min_size"); + CV_Assert(_minSize > 0); + + _flip = getParameter(params, "flip"); + _clip = getParameter(params, "clip"); + + _aspectRatios.clear(); + _aspectRatios.push_back(1.); + + getAspectRatios(params); + getVariance(params); + + _numPriors = _aspectRatios.size(); + + _maxSize = -1; + if (params.has("max_size")) + { + _maxSize = params.get("max_size").get(0); + CV_Assert(_maxSize > _minSize); + + _numPriors += 1; + } + + if (params.has("step_h") || params.has("step_w")) { + CV_Assert(!params.has("step")); + _stepY = getParameter(params, "step_h"); + CV_Assert(_stepY > 0.); + _stepX = getParameter(params, "step_w"); + CV_Assert(_stepX > 0.); + } else if (params.has("step")) { + const float step = getParameter(params, "step"); + CV_Assert(step > 0); + _stepY = step; + _stepX = step; + } else { + _stepY = 0; + _stepX = 0; + } + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() == 2); + + int layerHeight = inputs[0][2]; + int layerWidth = inputs[0][3]; + + // Since all images in a batch has same height and width, we only need to + // generate one set of priors which can be shared across all images. + size_t outNum = 1; + // 2 channels. First channel stores the mean of each prior coordinate. + // Second channel stores the variance of each prior coordinate. + size_t outChannels = 2; + + outputs.resize(1, shape(outNum, outChannels, + layerHeight * layerWidth * _numPriors * 4)); + + return false; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + int _layerWidth = inputs[0]->size[3]; + int _layerHeight = inputs[0]->size[2]; + + int _imageWidth = inputs[1]->size[3]; + int _imageHeight = inputs[1]->size[2]; + + float stepX, stepY; + if (_stepX == 0 || _stepY == 0) { + stepX = static_cast(_imageWidth) / _layerWidth; + stepY = static_cast(_imageHeight) / _layerHeight; + } else { + stepX = _stepX; + stepY = _stepY; + } + + int _outChannelSize = _layerHeight * _layerWidth * _numPriors * 4; + + float* outputPtr = outputs[0].ptr(); + + // first prior: aspect_ratio = 1, size = min_size + int idx = 0; + for (size_t h = 0; h < _layerHeight; ++h) + { + for (size_t w = 0; w < _layerWidth; ++w) + { + _boxWidth = _boxHeight = _minSize; + + float center_x = (w + 0.5) * stepX; + float center_y = (h + 0.5) * stepY; + // xmin + outputPtr[idx++] = (center_x - _boxWidth / 2.) / _imageWidth; + // ymin + outputPtr[idx++] = (center_y - _boxHeight / 2.) / _imageHeight; + // xmax + outputPtr[idx++] = (center_x + _boxWidth / 2.) / _imageWidth; + // ymax + outputPtr[idx++] = (center_y + _boxHeight / 2.) / _imageHeight; + + if (_maxSize > 0) + { + // second prior: aspect_ratio = 1, size = sqrt(min_size * max_size) + _boxWidth = _boxHeight = sqrt(_minSize * _maxSize); + // xmin + outputPtr[idx++] = (center_x - _boxWidth / 2.) / _imageWidth; + // ymin + outputPtr[idx++] = (center_y - _boxHeight / 2.) / _imageHeight; + // xmax + outputPtr[idx++] = (center_x + _boxWidth / 2.) / _imageWidth; + // ymax + outputPtr[idx++] = (center_y + _boxHeight / 2.) / _imageHeight; + } + + // rest of priors + for (size_t r = 0; r < _aspectRatios.size(); ++r) + { + float ar = _aspectRatios[r]; + if (fabs(ar - 1.) < 1e-6) + { + continue; + } + _boxWidth = _minSize * sqrt(ar); + _boxHeight = _minSize / sqrt(ar); + // xmin + outputPtr[idx++] = (center_x - _boxWidth / 2.) / _imageWidth; + // ymin + outputPtr[idx++] = (center_y - _boxHeight / 2.) / _imageHeight; + // xmax + outputPtr[idx++] = (center_x + _boxWidth / 2.) / _imageWidth; + // ymax + outputPtr[idx++] = (center_y + _boxHeight / 2.) / _imageHeight; + } + } + } + // clip the prior's coordidate such that it is within [0, 1] + if (_clip) + { + for (size_t d = 0; d < _outChannelSize; ++d) + { + outputPtr[d] = std::min(std::max(outputPtr[d], 0.), 1.); + } + } + // set the variance. + outputPtr = outputs[0].ptr(0, 1); + if(_variance.size() == 1) + { + Mat secondChannel(outputs[0].size[2], outputs[0].size[3], CV_32F, outputPtr); + secondChannel.setTo(Scalar(_variance[0])); + } + else + { + int count = 0; + for (size_t h = 0; h < _layerHeight; ++h) + { + for (size_t w = 0; w < _layerWidth; ++w) + { + for (size_t i = 0; i < _numPriors; ++i) + { + for (int j = 0; j < 4; ++j) + { + outputPtr[count] = _variance[j]; + ++count; + } + } + } + } + } + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + long flops = 0; + + for (int i = 0; i < inputs.size(); i++) + { + flops += total(inputs[i], 2) * _numPriors * 4; + } + + return flops; + } + + float _minSize; + float _maxSize; + + float _boxWidth; + float _boxHeight; + + float _stepX, _stepY; + + std::vector _aspectRatios; + std::vector _variance; + + bool _flip; + bool _clip; + + size_t _numPriors; + + static const size_t _numAxes = 4; + static const std::string _layerName; +}; + +const std::string PriorBoxLayerImpl::_layerName = std::string("PriorBox"); + +Ptr PriorBoxLayer::create(const LayerParams ¶ms) +{ + return Ptr(new PriorBoxLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/recurrent_layers.cpp b/modules/dnn/src/layers/recurrent_layers.cpp new file mode 100644 index 0000000000..aa3d0df912 --- /dev/null +++ b/modules/dnn/src/layers/recurrent_layers.cpp @@ -0,0 +1,443 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include +#include +#include +#include + +namespace cv +{ +namespace dnn +{ + +template +static void tanh(const Mat &src, Mat &dst) +{ + MatConstIterator_ itSrc = src.begin(); + MatIterator_ itDst = dst.begin(); + + for (; itSrc != src.end(); itSrc++, itDst++) + *itDst = std::tanh(*itSrc); +} + +//TODO: make utils method +static void tanh(const Mat &src, Mat &dst) +{ + dst.create(src.dims, (const int*)src.size, src.type()); + + if (src.type() == CV_32F) + tanh(src, dst); + else if (src.type() == CV_64F) + tanh(src, dst); + else + CV_Error(Error::StsUnsupportedFormat, "Function supports only floating point types"); +} + +static void sigmoid(const Mat &src, Mat &dst) +{ + cv::exp(-src, dst); + cv::pow(1 + dst, -1, dst); +} + +class LSTMLayerImpl : public LSTMLayer +{ + int numTimeStamps, numSamples; + bool allocated; + + MatShape outTailShape; //shape of single output sample + MatShape outTsShape; //shape of N output samples + + bool useTimestampDim; + bool produceCellOutput; + +public: + + LSTMLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + type = "LSTM"; + useTimestampDim = true; + produceCellOutput = false; + allocated = false; + outTailShape.clear(); + } + + void setUseTimstampsDim(bool use) + { + CV_Assert(!allocated); + useTimestampDim = use; + } + + void setProduceCellOutput(bool produce) + { + CV_Assert(!allocated); + produceCellOutput = produce; + } + + void setOutShape(const MatShape &outTailShape_) + { + CV_Assert(!allocated || total(outTailShape) == total(outTailShape_)); + outTailShape = outTailShape_; + } + + void setWeights(const Mat &Wh, const Mat &Wx, const Mat &bias) + { + CV_Assert(Wh.dims == 2 && Wx.dims == 2); + CV_Assert(Wh.rows == Wx.rows); + CV_Assert(Wh.rows == 4*Wh.cols); + CV_Assert(Wh.rows == (int)bias.total()); + CV_Assert(Wh.type() == Wx.type() && Wx.type() == bias.type()); + + blobs.resize(3); + blobs[0] = Mat(Wh.clone()); + blobs[1] = Mat(Wx.clone()); + blobs[2] = Mat(bias.clone()).reshape(1, 1); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(blobs.size() == 3); + CV_Assert(inputs.size() == 1); + const MatShape& inp0 = inputs[0]; + + const Mat &Wh = blobs[0], &Wx = blobs[1]; + int _numOut = Wh.size[1]; + int _numInp = Wx.size[1]; + MatShape outTailShape_(outTailShape), outResShape; + + if (!outTailShape_.empty()) + CV_Assert(total(outTailShape_) == _numOut); + else + outTailShape_.assign(1, _numOut); + + int _numTimeStamps, _numSamples; + if (useTimestampDim) + { + CV_Assert(inp0.size() >= 2 && total(inp0, 2) == _numInp); + _numTimeStamps = inp0[0]; + _numSamples = inp0[1]; + outResShape.push_back(_numTimeStamps); + } + else + { + CV_Assert(inp0.size() >= 2 && total(inp0, 1) == _numInp); + _numTimeStamps = 1; + _numSamples = inp0[0]; + } + + outResShape.push_back(_numSamples); + outResShape.insert(outResShape.end(), outTailShape_.begin(), outTailShape_.end()); + + size_t noutputs = produceCellOutput ? 2 : 1; + outputs.assign(noutputs, outResShape); + + internals.assign(1, shape(_numSamples, _numOut)); // hInternal + internals.push_back(shape(_numSamples, _numOut)); // cInternal + internals.push_back(shape(_numSamples, 1)); // dummyOnes + internals.push_back(shape(_numSamples, 4*_numOut)); // gates + + return false; + } + + void finalize(const std::vector &input, std::vector &output) + { + CV_Assert(blobs.size() == 3); + CV_Assert(input.size() == 1); + const Mat& inp0 = *input[0]; + + Mat &Wh = blobs[0], &Wx = blobs[1]; + int numOut = Wh.size[1]; + int numInp = Wx.size[1]; + + if (!outTailShape.empty()) + CV_Assert(total(outTailShape) == numOut); + else + outTailShape.assign(1, numOut); + + if (useTimestampDim) + { + CV_Assert(inp0.dims >= 2 && (int)inp0.total(2) == numInp); + numTimeStamps = inp0.size[0]; + numSamples = inp0.size[1]; + } + else + { + CV_Assert(inp0.dims >= 2 && (int)inp0.total(1) == numInp); + numTimeStamps = 1; + numSamples = inp0.size[0]; + } + + outTsShape.clear(); + outTsShape.push_back(numSamples); + outTsShape.insert(outTsShape.end(), outTailShape.begin(), outTailShape.end()); + + allocated = true; + } + + void forward(std::vector &input, std::vector &output, std::vector &internals) + { + const Mat &Wh = blobs[0]; + const Mat &Wx = blobs[1]; + const Mat &bias = blobs[2]; + + int numOut = Wh.size[1]; + + Mat hInternal = internals[0], cInternal = internals[1], + dummyOnes = internals[2], gates = internals[3]; + hInternal.setTo(0.); + cInternal.setTo(0.); + dummyOnes.setTo(1.); + + int numSamplesTotal = numTimeStamps*numSamples; + Mat xTs = input[0]->reshape(1, numSamplesTotal); + + Mat hOutTs = output[0].reshape(1, numSamplesTotal); + Mat cOutTs = produceCellOutput ? output[1].reshape(1, numSamplesTotal) : Mat(); + + for (int ts = 0; ts < numTimeStamps; ts++) + { + Range curRowRange(ts*numSamples, (ts + 1)*numSamples); + Mat xCurr = xTs.rowRange(curRowRange); + + gemm(xCurr, Wx, 1, gates, 0, gates, GEMM_2_T); // Wx * x_t + gemm(hInternal, Wh, 1, gates, 1, gates, GEMM_2_T); //+Wh * h_{t-1} + gemm(dummyOnes, bias, 1, gates, 1, gates); //+b + + Mat getesIFO = gates.colRange(0, 3*numOut); + Mat gateI = gates.colRange(0*numOut, 1*numOut); + Mat gateF = gates.colRange(1*numOut, 2*numOut); + Mat gateO = gates.colRange(2*numOut, 3*numOut); + Mat gateG = gates.colRange(3*numOut, 4*numOut); + + sigmoid(getesIFO, getesIFO); + tanh(gateG, gateG); + + //compute c_t + multiply(gateF, cInternal, gateF); // f_t (*) c_{t-1} + multiply(gateI, gateG, gateI); // i_t (*) g_t + add(gateF, gateI, cInternal); // c_t = f_t (*) c_{t-1} + i_t (*) g_t + + //compute h_t + tanh(cInternal, hInternal); + multiply(gateO, hInternal, hInternal); + + //save results in output blobs + hInternal.copyTo(hOutTs.rowRange(curRowRange)); + if (produceCellOutput) + cInternal.copyTo(cOutTs.rowRange(curRowRange)); + } + } +}; + +Ptr LSTMLayer::create(const LayerParams& params) +{ + return Ptr(new LSTMLayerImpl(params)); +} + +int LSTMLayer::inputNameToIndex(String inputName) +{ + if (inputName.toLowerCase() == "x") + return 0; + return -1; +} + +int LSTMLayer::outputNameToIndex(String outputName) +{ + if (outputName.toLowerCase() == "h") + return 0; + else if (outputName.toLowerCase() == "c") + return 1; + return -1; +} + + +class RNNLayerImpl : public RNNLayer +{ + int numX, numH, numO; + int numSamples, numTimestamps, numSamplesTotal; + int dtype; + Mat Whh, Wxh, bh; + Mat Who, bo; + bool produceH; + +public: + + RNNLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + type = "RNN"; + produceH = false; + } + + void setProduceHiddenOutput(bool produce = false) + { + produceH = produce; + } + + void setWeights(const Mat &W_xh, const Mat &b_h, const Mat &W_hh, const Mat &W_ho, const Mat &b_o) + { + CV_Assert(W_hh.dims == 2 && W_xh.dims == 2); + CV_Assert(W_hh.size[0] == W_xh.size[0] && W_hh.size[0] == W_hh.size[1] && (int)b_h.total() == W_xh.size[0]); + CV_Assert(W_ho.size[0] == (int)b_o.total()); + CV_Assert(W_ho.size[1] == W_hh.size[1]); + + blobs.resize(5); + blobs[0] = Mat(W_xh.clone()); + blobs[1] = Mat(b_h.clone()); + blobs[2] = Mat(W_hh.clone()); + blobs[3] = Mat(W_ho.clone()); + blobs[4] = Mat(b_o.clone()); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() >= 1 && inputs.size() <= 2); + + Mat Who_ = blobs[3]; + Mat Wxh_ = blobs[0]; + + int numTimestamps_ = inputs[0][0]; + int numSamples_ = inputs[0][1]; + + int numO_ = Who_.rows; + int numH_ = Wxh_.rows; + + outputs.clear(); + int dims[] = {numTimestamps_, numSamples_, numO_}; + outputs.push_back(shape(dims, 3)); + dims[2] = numH_; + if (produceH) + outputs.push_back(shape(dims, 3)); + + internals.assign(2, shape(numSamples_, numH_)); + internals.push_back(shape(numSamples_, 1)); + + return false; + } + + void finalize(const std::vector &input, std::vector &output) + { + CV_Assert(input.size() >= 1 && input.size() <= 2); + + Wxh = blobs[0]; + bh = blobs[1]; + Whh = blobs[2]; + Who = blobs[3]; + bo = blobs[4]; + + numH = Wxh.rows; + numX = Wxh.cols; + numO = Who.rows; + + const Mat& inp0 = *input[0]; + + CV_Assert(inp0.dims >= 2); + CV_Assert(inp0.total(2) == numX); + dtype = CV_32F; + CV_Assert(inp0.type() == dtype); + numTimestamps = inp0.size[0]; + numSamples = inp0.size[1]; + numSamplesTotal = numTimestamps * numSamples; + + bh = bh.reshape(1, 1); //is 1 x numH Mat + bo = bo.reshape(1, 1); //is 1 x numO Mat + } + + void reshapeOutput(std::vector &output) + { + output.resize(produceH ? 2 : 1); + int sz0[] = { numTimestamps, numSamples, numO }; + output[0].create(3, sz0, dtype); + if (produceH) + { + int sz1[] = { numTimestamps, numSamples, numH }; + output[1].create(3, sz1, dtype); + } + } + + void forward(std::vector &input, std::vector &output, std::vector &internals) + { + Mat xTs = input[0]->reshape(1, numSamplesTotal); + Mat oTs = output[0].reshape(1, numSamplesTotal); + Mat hTs = produceH ? output[1].reshape(1, numSamplesTotal) : Mat(); + Mat hCurr = internals[0]; + Mat hPrev = internals[1]; + Mat dummyBiasOnes = internals[2]; + + hPrev.setTo(0.); + dummyBiasOnes.setTo(1.); + + for (int ts = 0; ts < numTimestamps; ts++) + { + Range curRowRange = Range(ts * numSamples, (ts + 1) * numSamples); + Mat xCurr = xTs.rowRange(curRowRange); + + gemm(hPrev, Whh, 1, hCurr, 0, hCurr, GEMM_2_T); // W_{hh} * h_{prev} + gemm(xCurr, Wxh, 1, hCurr, 1, hCurr, GEMM_2_T); //+W_{xh} * x_{curr} + gemm(dummyBiasOnes, bh, 1, hCurr, 1, hCurr); //+bh + tanh(hCurr, hPrev); + + Mat oCurr = oTs.rowRange(curRowRange); + gemm(hPrev, Who, 1, oCurr, 0, oCurr, GEMM_2_T); // W_{ho} * h_{prev} + gemm(dummyBiasOnes, bo, 1, oCurr, 1, oCurr); //+b_o + tanh(oCurr, oCurr); + + if (produceH) + hPrev.copyTo(hTs.rowRange(curRowRange)); + } + } +}; + +CV_EXPORTS_W Ptr RNNLayer::create(const LayerParams& params) +{ + return Ptr(new RNNLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/reshape_layer.cpp b/modules/dnn/src/layers/reshape_layer.cpp new file mode 100644 index 0000000000..a5fa088668 --- /dev/null +++ b/modules/dnn/src/layers/reshape_layer.cpp @@ -0,0 +1,247 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +static void computeShapeByReshapeMask(const MatShape &srcShape, + const MatShape &maskShape, + Range srcRange /*= Range::all()*/, + MatShape& dstShape) +{ + int srcShapeSize = (int)srcShape.size(); + int maskShapeSize = (int)maskShape.size(); + + if (srcRange == Range::all()) + srcRange = Range(0, srcShapeSize); + else + { + int sz = srcRange.size(); + srcRange.start = clamp(srcRange.start, srcShapeSize); + srcRange.end = srcRange.end == INT_MAX ? srcShapeSize : srcRange.start + sz; + } + + bool explicitMask = !maskShape.empty(); // All mask values are positive. + for (int i = 0, n = maskShape.size(); i < n && explicitMask; ++i) + { + explicitMask = maskShape[i] > 0; + } + // Working range of source shape is a range where area(src) == area(mask). + if (explicitMask) + { + int maskTotal = total(maskShape); + for (int i = srcRange.start + 1; i < srcRange.end; ++i) + { + if (total(srcShape, i, srcRange.end) != maskTotal) + { + srcRange.start = i - 1; + break; + } + } + CV_Assert(total(srcShape, srcRange.start, srcRange.end) == maskTotal); + } + + CV_Assert(0 <= srcRange.start && srcRange.start <= srcRange.end && srcRange.end <= srcShapeSize); + int dstShapeSize = srcShapeSize - srcRange.size() + maskShapeSize; + dstShape.resize(dstShapeSize); + + std::copy(srcShape.begin(), srcShape.begin() + srcRange.start, dstShape.begin()); + std::copy(srcShape.begin() + srcRange.end, srcShape.begin() + srcShapeSize, dstShape.begin() + srcRange.start + maskShapeSize); + + int inferDim = -1; + for (int i = 0; i < maskShapeSize; i++) + { + if (maskShape[i] > 0) + { + dstShape[srcRange.start + i] = maskShape[i]; + } + else if (maskShape[i] == 0) + { + if (srcRange.start + i >= srcShapeSize) + CV_Error(Error::StsBadArg, format("Copy dim[%d] (which has zero size) is out of the source shape bounds", srcRange.start + i)); + dstShape[srcRange.start + i] = srcShape[srcRange.start + i]; + } + else if (maskShape[i] == -1) + { + if (inferDim != -1) + CV_Error(Error::StsAssert, "Duplicate of inferred dim (which is denoted by -1)"); + inferDim = srcRange.start + i; + dstShape[inferDim] = 1; + } + else + CV_Error(Error::StsBadArg, "maskShape[i] >= -1"); + } + + size_t srcTotal = total(srcShape); + size_t dstTotal = total(dstShape); + + if (inferDim != -1) + { + if (srcTotal % dstTotal != 0) + CV_Error(Error::StsBackTrace, "Can't infer a dim denoted by -1"); + + dstShape[inferDim] = (int)(srcTotal / dstTotal); + } + else + { + CV_Assert(srcTotal == dstTotal); + } +} + + +class ReshapeLayerImpl : public ReshapeLayer +{ +public: + ReshapeLayerImpl(const LayerParams& params): + performReordering(false) + { + setParamsFrom(params); + int axis = params.get("axis", 0); + int numAxes = params.get("num_axes", -1); + enableReordering = params.get("reorder_dims", false); + CV_Assert(numAxes >= -1); + newShapeRange = (numAxes == -1) ? Range(axis, INT_MAX) : Range(axis, axis + numAxes); + + newShapeDesc.clear(); + if (params.has("dim")) + { + const DictValue ¶mShape = params.get("dim"); + int i, dims = paramShape.size(); + newShapeDesc.resize(dims); + for (i = 0; i < dims; i++) + newShapeDesc[i] = paramShape.get(i); + } + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + outputs.clear(); + + for (size_t i = 0; i < inputs.size(); i++) + { + outputs.push_back(MatShape()); + computeShapeByReshapeMask(inputs[i], newShapeDesc, newShapeRange, outputs.back()); + } + internals = outputs; + + return true; + } + + void finalize(const std::vector &inputs, std::vector &outputs) + { + CV_Assert(inputs.size()); + CV_Assert(outputs.size()); + Mat srcBlob = *inputs[0]; + int dims = srcBlob.dims; + MatShape inputShape = shape(srcBlob), outShape = shape(outputs[0]); + + // input.total() == output.total(). So if reordering is require, + // one of the sizes will be are not equal. + // Example where reordering is require: from 1x128x4x4 to 1x2048 + // Example where reordering is NOT require: from 1x1024x1x1 to 1x1024. + bool reorderingRequire = false; + const int minDims = min(dims, (int)outShape.size()); + for (int i = 0; !reorderingRequire && i < minDims; ++i) + reorderingRequire = inputShape[i] != outShape[i]; + performReordering = enableReordering && reorderingRequire; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (size_t i = 0; i < inputs.size(); i++) + { + Mat srcBlob = *inputs[i]; + MatShape inputShape = shape(srcBlob), outShape = shape(outputs[i]); + + if (performReordering) + { + float *dstData = internals[i].ptr(); + const float *srcData = srcBlob.ptr(); + + int num = inputShape[0], channels = inputShape[1], height = inputShape[2], width = inputShape[3]; + int total = num*channels*height*width; + for(int i_n = 0; i_n < num; i_n++) { + for(int i_c = 0; i_c < channels; i_c++) { + for(int i_h = 0; i_h < height; i_h++) { + for(int i_w = 0; i_w < width; i_w++) { + int src_i = channels*height*width*i_n + height*width*i_c + width*i_h + i_w; + int dst_i = channels*height*width*i_n + i_c + channels*width*i_h + channels*i_w; + + CV_Assert(dst_i < total); + CV_Assert(src_i < total); + + dstData[dst_i] = srcData[src_i]; + } + } + } + } + internals[i].copyTo(outputs[i]); + } + else + { + if (outputs[i].data != srcBlob.data) + srcBlob.reshape(1, outShape).copyTo(outputs[i]); + } + } + } + +private: + std::vector > outShapes; + bool enableReordering, performReordering; +}; + +Ptr ReshapeLayer::create(const LayerParams& params) +{ + return Ptr(new ReshapeLayerImpl(params)); +} + + +} +} diff --git a/modules/dnn/src/layers/scale_layer.cpp b/modules/dnn/src/layers/scale_layer.cpp new file mode 100644 index 0000000000..738b7d031c --- /dev/null +++ b/modules/dnn/src/layers/scale_layer.cpp @@ -0,0 +1,147 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of Scale layer. +*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class ScaleLayerImpl : public ScaleLayer +{ +public: + ScaleLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + hasBias = params.get("bias_term", false); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + return true; + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide(); + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + CV_Assert(blobs.size() == 1 + hasBias); + + for (size_t ii = 0; ii < outputs.size(); ii++) + { + Mat &inpBlob = *inputs[ii]; + Mat &outBlob = outputs[ii]; + + CV_Assert(inpBlob.size[1] == blobs[0].total()); + if (hasBias) + CV_Assert(inpBlob.size[1] == blobs[1].total()); + + CV_Assert(inpBlob.type() == CV_32F && outBlob.type() == CV_32F); + + for( int cn = 0; cn < inpBlob.size[0]; cn++ ) + { + for (int n = 0; n < inpBlob.size[1]; n++) + { + float w = blobs[0].at(n); + float b = hasBias ? blobs[1].at(n) : 0; + Mat outBlobPlane = getPlane(outBlob, cn, n); + Mat inpBlobPlane = getPlane(inpBlob, cn, n); + inpBlobPlane.convertTo(outBlobPlane, CV_32F, w, b); + } + } + } + } + + virtual Ptr tryAttach(const Ptr& node) + { + switch (node->backendId) + { + case DNN_BACKEND_HALIDE: + { +#ifdef HAVE_HALIDE + auto base = node.dynamicCast(); + Halide::Func& input = base->funcs.back(); + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = attachHalide(input(x, y, c, n)); + return Ptr(new HalideBackendNode(base, top)); +#endif // HAVE_HALIDE + break; + } + } + return Ptr(); + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer input = halideBuffer(inputs[0]); + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = attachHalide(input(x, y, c, n)); + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + +#ifdef HAVE_HALIDE + // attachHalide can work both with Halide::Buffer and Halide::Func. In the + // second case it will be a fusion. + Halide::Func attachHalide(const Halide::Expr& input) + { + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + Halide::Var x("x"), y("y"), c("c"), n("n"); + + const int numChannels = blobs[0].total(); + + auto weights = wrapToHalideBuffer(blobs[0], {numChannels}); + Halide::Expr topExpr = input * weights(c); + if (hasBias) + { + auto bias = wrapToHalideBuffer(blobs[1], {numChannels}); + topExpr += bias(c); + } + top(x, y, c, n) = topExpr; + return top; + } +#endif // HAVE_HALIDE + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + long flops = 0; + for(int i = 0; i < inputs.size(); i++) + { + flops += 2*total(inputs[i]); + } + return flops; + } +}; + + +Ptr ScaleLayer::create(const LayerParams& params) +{ + return Ptr(new ScaleLayerImpl(params)); +} + +} // namespace dnn +} // namespace cv diff --git a/modules/dnn/src/layers/shift_layer.cpp b/modules/dnn/src/layers/shift_layer.cpp new file mode 100644 index 0000000000..a26157f2bb --- /dev/null +++ b/modules/dnn/src/layers/shift_layer.cpp @@ -0,0 +1,96 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of shift layer, which adds up const values to blob. +*/ + +#include "../precomp.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class ShiftLayerImpl : public ShiftLayer +{ +public: + ShiftLayerImpl(const LayerParams ¶ms) + { + setParamsFrom(params); + CV_Assert(blobs.size() == 1); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + internals.assign(1, shape(1, total(inputs[0], 2))); + return true; + } + + virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + CV_Assert(inputs.size() > 0); + CV_Assert(blobs.size() > 0); + + if(inputs[0]->dims == blobs[0].dims) + { + for (size_t ii = 0; ii < outputs.size(); ii++) + { + Mat &inpBlob = *inputs[ii]; + Mat &outBlob = outputs[ii]; + + outBlob = inpBlob + blobs[0]; + } + } + else + { + Mat biasOnesMat = internals[0]; + biasOnesMat.setTo(1); + for (size_t ii = 0; ii < outputs.size(); ii++) + { + Mat &inpBlob = *inputs[ii]; + Mat &outBlob = outputs[ii]; + + inpBlob.copyTo(outBlob); + + for (int n = 0; n < inpBlob.size[0]; n++) + { + Mat dstMat(inpBlob.size[1], inpBlob.size[2] * inpBlob.size[3], + outBlob.type(), outBlob.ptr(n)); + gemm(blobs[0], biasOnesMat, 1, dstMat, 1, dstMat); //TODO: gemv + } + } + } + } + + virtual int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + long flops = 0; + + for(int i= 0; i < inputs.size(); i++) + { + flops += total(inputs[i]); + } + + return flops; + } +}; + +Ptr ShiftLayer::create(const LayerParams& params) +{ + return Ptr(new ShiftLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/slice_layer.cpp b/modules/dnn/src/layers/slice_layer.cpp new file mode 100644 index 0000000000..4449f93e4c --- /dev/null +++ b/modules/dnn/src/layers/slice_layer.cpp @@ -0,0 +1,140 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include + +namespace cv +{ +namespace dnn +{ + +class SliceLayerImpl : public SliceLayer +{ +public: + SliceLayerImpl(const LayerParams& params) + { + setParamsFrom(params); + axis = params.get("axis", 1); + + if (params.has("slice_point")) + { + const DictValue &indicesValue = params.get("slice_point"); + int i, n = indicesValue.size(); + sliceIndices.resize(n); + for (i = 0; i < n; i++) + sliceIndices[i] = indicesValue.get(i); + } + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() == 1); + + outputs.clear(); + + MatShape inpShape = inputs[0]; + int cAxis = clamp(axis, inpShape.size()); + int axisSize = inpShape[cAxis]; + + if (sliceIndices.size()) //divide blob with respect to passed parameters + { + std::vector outAxisSize; + int prevSlice = 0; + + for (size_t i = 0; i < sliceIndices.size(); i++) + { + if (!(prevSlice < sliceIndices[i] && sliceIndices[i] < axisSize)) + CV_Error(Error::StsBadArg, "Slice indices should be positive, increased and don't exceed size of sliced dimension"); + + outAxisSize.push_back(sliceIndices[i] - prevSlice); + prevSlice = sliceIndices[i]; + } + outAxisSize.push_back(axisSize - prevSlice); + + for (size_t i = 0; i < outAxisSize.size(); i++) + { + inpShape[cAxis] = outAxisSize[i]; + outputs.push_back(inpShape); + } + } + else //divide blob with respect to count of output blobs + { + CV_Assert(requiredOutputs > 0 && axisSize % requiredOutputs == 0); + int outAxisSize = axisSize / (int)requiredOutputs; + + for (size_t i = 0; i < requiredOutputs; i++) + { + inpShape[cAxis] = outAxisSize; + outputs.push_back(inpShape); + } + } + + return false; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + const Mat& inpMat = *inputs[0]; + std::vector ranges(inpMat.dims, Range::all()); + int cAxis = clamp(axis, inpMat.dims); + + ranges[cAxis].start = 0; + for (size_t i = 0; i < outputs.size(); i++) + { + ranges[cAxis].end = ranges[cAxis].start + outputs[i].size[cAxis]; + inpMat(&ranges[0]).copyTo(outputs[i]); + ranges[cAxis].start = ranges[cAxis].end; + } + } +}; + +Ptr SliceLayer::create(const LayerParams& params) +{ + return Ptr(new SliceLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/softmax_layer.cpp b/modules/dnn/src/layers/softmax_layer.cpp new file mode 100644 index 0000000000..fc80fc1cd5 --- /dev/null +++ b/modules/dnn/src/layers/softmax_layer.cpp @@ -0,0 +1,213 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" +#include "op_halide.hpp" +#include +#include +using std::max; + +namespace cv +{ +namespace dnn +{ + +class SoftMaxLayerImpl : public SoftmaxLayer +{ +public: + + SoftMaxLayerImpl(const LayerParams& params) + { + axisRaw = params.get("axis", 1); + logSoftMax = params.get("log_softmax", false); + setParamsFrom(params); + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + bool inplace = Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals); + MatShape shape = inputs[0]; + int cAxis = clamp(axisRaw, shape.size()); + shape[cAxis] = 1; + internals.assign(1, shape); + return inplace; + } + + virtual bool supportBackend(int backendId) + { + return backendId == DNN_BACKEND_DEFAULT || + backendId == DNN_BACKEND_HALIDE && haveHalide() && axisRaw == 1; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + const Mat &src = *inputs[0]; + Mat &dst = outputs[0]; + + int axis = clamp(axisRaw, src.dims); + size_t outerSize = src.total(0, axis), channels = src.size[axis], + innerSize = src.total(axis + 1); + + CV_Assert(src.type() == CV_32F); + CV_Assert(src.isContinuous() && dst.isContinuous()); + + const float *srcPtr = src.ptr(); + float *dstPtr = dst.ptr(); + float *bufPtr = internals[0].ptr(); + + size_t outerStep = src.total(axis); + size_t cnStep = src.total(axis + 1); + + //compute max along axis + for (size_t outerDim = 0; outerDim < outerSize; outerDim++) + { + size_t srcOffset = outerDim * outerStep; + size_t bufOffset = outerDim * cnStep; + + memcpy(bufPtr + bufOffset, srcPtr + srcOffset, innerSize * sizeof(float)); + + for (size_t cnDim = 1; cnDim < channels; cnDim++) + { + for (size_t i = 0; i < innerSize; i++) + bufPtr[bufOffset + i] = std::max(bufPtr[bufOffset + i], srcPtr[srcOffset + cnDim * cnStep + i]); + } + } + + //subtract max + for (size_t outerDim = 0; outerDim < outerSize; outerDim++) + { + size_t srcOffset = outerDim * outerStep; + size_t bufOffset = outerDim * cnStep; + + for (size_t cnDim = 0; cnDim < channels; cnDim++) + { + for (size_t i = 0; i < innerSize; i++) + dstPtr[srcOffset + cnDim * cnStep + i] = srcPtr[srcOffset + cnDim * cnStep + i] - bufPtr[bufOffset + i]; + } + } + + cv::exp(dst, dst); + + for (size_t outerDim = 0; outerDim < outerSize; outerDim++) + { + size_t srcOffset = outerDim * outerStep; + size_t bufOffset = outerDim * cnStep; + + //sum exp along axis + for (size_t i = 0; i < innerSize; i++) + bufPtr[bufOffset + i] = 0.f; + + for (size_t cnDim = 0; cnDim < channels; cnDim++) + { + for (size_t i = 0; i < innerSize; i++) + bufPtr[bufOffset + i] += dstPtr[srcOffset + cnDim * cnStep + i]; + } + + //divide by computed sum + for (size_t cnDim = 0; cnDim < channels; cnDim++) + { + for (size_t i = 0; i < innerSize; i++) + dstPtr[srcOffset + cnDim * cnStep + i] /= bufPtr[bufOffset + i]; + } + if (logSoftMax) + { + for (size_t cnDim = 0; cnDim < channels; cnDim++) + { + for (size_t i = 0; i < innerSize; i++) + dstPtr[srcOffset + cnDim * cnStep + i] = log(dstPtr[srcOffset + cnDim * cnStep + i]); + } + } + } + } + + virtual Ptr initHalide(const std::vector > &inputs) + { +#ifdef HAVE_HALIDE + Halide::Buffer inputBuffer = halideBuffer(inputs[0]); + int inW, inH, inC, inN; + getCanonicalSize(inputBuffer, &inW, &inH, &inC, &inN); + + if (inW != 1 || inH != 1) + CV_Error(cv::Error::StsNotImplemented, + "Halide backend for SoftMax with spatial size " + "more than 1x1 is not implemented"); + + Halide::Var x("x"), y("y"), c("c"), n("n"); + Halide::Func top = (name.empty() ? Halide::Func() : Halide::Func(name)); + + Halide::Func expInput("expInput"); + Halide::RDom r(0, inW, 0, inH, 0, inC); + expInput(x, y, c, n) = exp(inputBuffer(x, y, c, n)); + Halide::Expr globalSum = sum(expInput(r.x, r.y, r.z, n)); + top(x, y, c, n) = expInput(x, y, c, n) / globalSum; + return Ptr(new HalideBackendNode(top)); +#endif // HAVE_HALIDE + return Ptr(); + } + + int64 getFLOPS(const std::vector &inputs, + const std::vector &outputs) const + { + (void)outputs; // suppress unused variable warning + int64 flops = 0; + + for (int i = 0; i < inputs.size(); i++) + { + flops += 4*total(inputs[i]); + } + + return flops; + } + + int axisRaw; +}; + +Ptr SoftmaxLayer::create(const LayerParams& params) +{ + return Ptr(new SoftMaxLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/layers/split_layer.cpp b/modules/dnn/src/layers/split_layer.cpp new file mode 100644 index 0000000000..6242172d08 --- /dev/null +++ b/modules/dnn/src/layers/split_layer.cpp @@ -0,0 +1,97 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include "layers_common.hpp" + +namespace cv +{ +namespace dnn +{ + +class SplitLayerImpl : public SplitLayer +{ +public: + SplitLayerImpl(const LayerParams ¶ms) + { + setParamsFrom(params); + //TODO: maybe "top_count" param is useless because it can be determined by output connections number + if (params.has("top_count")) + { + outputsCount = params.get("top_count"); + CV_Assert(outputsCount >= 0); + } + else + { + outputsCount = -1; + } + } + + bool getMemoryShapes(const std::vector &inputs, + const int requiredOutputs, + std::vector &outputs, + std::vector &internals) const + { + CV_Assert(inputs.size() == 1); + + Layer::getMemoryShapes(inputs, max(1, outputsCount >= 0 ? outputsCount : requiredOutputs), + outputs, internals); + return true; + } + + void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + { + for (size_t i = 0; i < outputs.size(); i++) + { + CV_Assert(inputs[0]->total() == outputs[i].total()); + if (outputs[i].data != inputs[0]->data) + inputs[0]->copyTo(outputs[i]); + } + } +}; + +Ptr SplitLayer::create(const LayerParams& params) +{ + return Ptr(new SplitLayerImpl(params)); +} + +} +} diff --git a/modules/dnn/src/op_halide.cpp b/modules/dnn/src/op_halide.cpp new file mode 100644 index 0000000000..9678359137 --- /dev/null +++ b/modules/dnn/src/op_halide.cpp @@ -0,0 +1,206 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +#include "op_halide.hpp" + +#ifdef HAVE_HALIDE +#include +#endif // HAVE_HALIDE + +namespace cv +{ +namespace dnn +{ + +#ifdef HAVE_HALIDE +Halide::Buffer wrapToHalideBuffer(const Mat& mat) +{ + int n, c, w, h; + getCanonicalSize(mat.size, &w, &h, &c, &n); + return wrapToHalideBuffer(mat, {w, h, c, n}); +} + +Halide::Buffer wrapToHalideBuffer(const Mat& mat, + const std::vector& sizes) +{ + Halide::Buffer buffer((float*)mat.data, sizes); + buffer.set_host_dirty(); // Indicate that data is on CPU. + return buffer; +} + +Halide::Buffer<> halideBuffer(const Ptr& ptr) +{ + CV_Assert(!ptr.empty()); + return ptr.dynamicCast()->buffer; +} + +std::vector > halideBuffers(const std::vector >& ptrs) +{ + std::vector > vec; + vec.reserve(ptrs.size()); + for (const Ptr& ptr : ptrs) + { + vec.push_back(halideBuffer(ptr)); + } + return vec; +} + +void getCanonicalSize(const Halide::Buffer<>& buffer, int* width, int* height, + int* channels, int* batch) +{ + CV_Assert(buffer.dimensions() == 4); + *width = buffer.extent(0); + *height = buffer.extent(1); + *channels = buffer.extent(2); + *batch = buffer.extent(3); +} + +HalideBackendNode::HalideBackendNode(const Halide::Func& func) + : BackendNode(DNN_BACKEND_HALIDE), funcs(1, func) {} + +HalideBackendNode::HalideBackendNode(const std::vector& funcs) + : BackendNode(DNN_BACKEND_HALIDE), funcs(funcs) {} + +HalideBackendNode::HalideBackendNode(const Ptr& base, + const Halide::Func& top) + : BackendNode(DNN_BACKEND_HALIDE), funcs(base->funcs) +{ + funcs.back() = top; +} + +HalideBackendWrapper::HalideBackendWrapper(int targetId, const cv::Mat& m) + : BackendWrapper(DNN_BACKEND_HALIDE, targetId) +{ + buffer = wrapToHalideBuffer(m); + if (targetId == DNN_TARGET_CPU) + { + return; + } + else if (targetId == DNN_TARGET_OPENCL) + { + buffer.copy_to_device(halide_opencl_device_interface()); + } + else + CV_Error(Error::StsNotImplemented, "Unknown target identifier"); +} + +HalideBackendWrapper::HalideBackendWrapper(const Ptr& base, + const MatShape& shape) + : BackendWrapper(DNN_BACKEND_HALIDE, base->targetId) +{ + int w, h, c, n; + getCanonicalSize(shape, &w, &h, &c, &n); + Halide::Buffer baseBuffer = halideBuffer(base); + buffer = Halide::Buffer((float*)baseBuffer.raw_buffer()->host, + {w, h, c, n}); + if (baseBuffer.has_device_allocation()) + { + buffer.raw_buffer()->device = baseBuffer.raw_buffer()->device; + buffer.raw_buffer()->device_interface = baseBuffer.raw_buffer()->device_interface; + buffer.set_device_dirty(); + } + else + { + buffer.set_host_dirty(); // Indicate that data is on CPU. + CV_Assert(targetId == DNN_TARGET_CPU); + } +} + +void HalideBackendWrapper::copyToHost() +{ + CV_Assert(targetId == DNN_TARGET_CPU || buffer.device_dirty()); + if (buffer.device_dirty()) + { + buffer.device_sync(); + buffer.copy_to_host(); + } +} +#endif // HAVE_HALIDE + +void getCanonicalSize(const MatSize& size, int* width, int* height, + int* channels, int* batch) +{ + const int dims = size.p[-1]; + CV_Assert(dims == 2 || dims == 4); + *batch = size[0]; + *channels = size[1]; + if (dims == 4) + { + *width = size[3]; + *height = size[2]; + } + else + { + *width = 1; + *height = 1; + } +} + +void getCanonicalSize(const MatShape& shape, int* width, int* height, + int* channels, int* batch) +{ + const int dims = shape.size(); + CV_Assert(dims == 2 || dims == 4); + *batch = shape[0]; + *channels = shape[1]; + if (dims == 4) + { + *width = shape[3]; + *height = shape[2]; + } + else + { + *width = 1; + *height = 1; + } +} + +void compileHalide(std::vector &outputs, Ptr& node, int targetId) +{ +#ifdef HAVE_HALIDE + CV_Assert(!node.empty()); + Halide::Func& top = node.dynamicCast()->funcs.back(); + + int outW, outH, outC, outN; + Halide::Var x("x"), y("y"), c("c"), n("n"); + getCanonicalSize(outputs[0].size, &outW, &outH, &outC, &outN); + top.bound(x, 0, outW).bound(y, 0, outH) + .bound(c, 0, outC).bound(n, 0, outN); + + Halide::Target target = Halide::get_host_target(); + target.set_feature(Halide::Target::NoAsserts); + if (targetId == DNN_TARGET_OPENCL) + { + target.set_feature(Halide::Target::OpenCL); + } + CV_Assert(target.supported()); + top.compile_jit(target); +#endif // HAVE_HALIDE +} + +void forwardHalide(std::vector > &outputs, + const Ptr& node) +{ +#ifdef HAVE_HALIDE + CV_Assert(!node.empty()); + Halide::Func& top = node.dynamicCast()->funcs.back(); + auto outputBuffers = halideBuffers(outputs); + top.realize(Halide::Realization(outputBuffers)); +#endif // HAVE_HALIDE +} + +bool haveHalide() +{ +#ifdef HAVE_HALIDE + return true; +#else + return false; +#endif // HAVE_HALIDE +} + +} // namespace dnn +} // namespace cv diff --git a/modules/dnn/src/op_halide.hpp b/modules/dnn/src/op_halide.hpp new file mode 100644 index 0000000000..f91e3fb65a --- /dev/null +++ b/modules/dnn/src/op_halide.hpp @@ -0,0 +1,84 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +#ifndef __OPENCV_DNN_OP_HALIDE_HPP__ +#define __OPENCV_DNN_OP_HALIDE_HPP__ + +#include "precomp.hpp" + +#ifdef HAVE_HALIDE +#include +#endif // HAVE_HALIDE + +namespace cv +{ +namespace dnn +{ +#ifdef HAVE_HALIDE + // Returns four-dimensional buffer with float32 type that wrap cv::Mat data. + // No data copy here. + Halide::Buffer wrapToHalideBuffer(const Mat& mat); + + Halide::Buffer wrapToHalideBuffer(const Mat& mat, + const std::vector& shape); + + // Extract batch size, number of channels, width and height from buffer. + void getCanonicalSize(const Halide::Buffer<>& buffer, int* width, int* height, + int* channels, int* batch); + + // Cast pointer and create copy of Halide buffer. No data copy. + Halide::Buffer<> halideBuffer(const Ptr& ptr); + + std::vector > halideBuffers(const std::vector >& ptrs); + + class HalideBackendNode : public BackendNode + { + public: + HalideBackendNode(const Halide::Func& func); + + HalideBackendNode(const std::vector& funcs); + + // Initialize from the node but replace last function to . + // It's using in case of layers fusing when we want to keep functions of + // root layer but replace top by fused one (i.e. conv+padding to relu+padding). + HalideBackendNode(const Ptr& base, const Halide::Func& top); + + std::vector funcs; + }; + + class HalideBackendWrapper : public BackendWrapper + { + public: + HalideBackendWrapper(int targetId, const cv::Mat& m); + + HalideBackendWrapper(const Ptr& base, const MatShape& shape); + + virtual void copyToHost(); + + Halide::Buffer buffer; + }; +#endif // HAVE_HALIDE + + // Extract batch size, number of channels, width and height from MatSize. + void getCanonicalSize(const MatSize& size, int* width, int* height, + int* channels, int* batch); + + void getCanonicalSize(const MatShape& shape, int* width, int* height, + int* channels, int* batch); + + // Realize Halide pipeline into output blobs. + void forwardHalide(std::vector > &outputs, + const Ptr& node); + + // Compile Halide pipeline to specific target. Use outputs to set bounds of functions. + void compileHalide(std::vector &outputs, Ptr& node, int targetId); + + bool haveHalide(); +} // namespace dnn +} // namespace cv + +#endif // __OPENCV_DNN_OP_HALIDE_HPP__ diff --git a/modules/dnn/src/opencl/activations.cl b/modules/dnn/src/opencl/activations.cl new file mode 100644 index 0000000000..58da4db4d0 --- /dev/null +++ b/modules/dnn/src/opencl/activations.cl @@ -0,0 +1,44 @@ +__kernel void ReLUForward(const int count, __global const T* in, __global T* out +#ifndef RELU_NO_SLOPE +, T negative_slope +#endif +) { + int index = get_global_id(0); + if(index < count) +#ifndef RELU_NO_SLOPE + out[index] = in[index] > 0 ? in[index] : in[index] * negative_slope; +#else + out[index] = in[index] > 0 ? in[index] : 0; +#endif +} + +__kernel void TanHForward(const int count, __global T* in, __global T* out) { + int index = get_global_id(0); + if(index < count) + out[index] = tanh(in[index]); +} + +__kernel void SigmoidForward(const int count, __global const T* in, __global T* out) { + int index = get_global_id(0); + if(index < count) + out[index] = 1. / (1. + exp(-in[index])); +} + +__kernel void BNLLForward(const int n, __global const T* in, __global T* out) { + int index = get_global_id(0); + if (index < n) { + out[index] = in[index] > 0 ? in[index] + log(1. + exp(-in[index])) : log(1. + exp(in[index])); + } +} + +__kernel void AbsValForward(const int n, __global const T* in, __global T* out) { + int index = get_global_id(0); + if (index < n) + out[index] = fabs(in[index]); +} + +__kernel void PowForward(const int n, __global const T* in, __global T* out, const T power, const T scale, const T shift) { + int index = get_global_id(0); + if (index < n) + out[index] = pow(shift + scale * in[index], power); +} \ No newline at end of file diff --git a/modules/dnn/src/opencl/col2im.cl b/modules/dnn/src/opencl/col2im.cl new file mode 100644 index 0000000000..30d4664df8 --- /dev/null +++ b/modules/dnn/src/opencl/col2im.cl @@ -0,0 +1,62 @@ +/************************************************************************************* + * Copyright (c) 2015, Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************/ + +__kernel void col2im(const int n, __global const T* data_col, const int col_offset, + const int height, const int width, const int channels, + const int patch_h, const int patch_w, + const int pad_h, const int pad_w, + const int stride_h, const int stride_w, + const int height_col, const int width_col, + __global T* data_im, const int img_offset) +{ + data_col = data_col + col_offset; + data_im = data_im + img_offset; + int index = get_global_id(0); + if(index < n) { + T val = 0; + int w = index % width + pad_w; + int h = (index / width) % height + pad_h; + int c = index / (width * height); + + // compute the start and end of the output + int w_col_start = (w < patch_w) ? 0 : (w - patch_w) / stride_w + 1; + int w_col_end = min(w / stride_w + 1, width_col); + int h_col_start = (h < patch_h) ? 0 : (h - patch_h) / stride_h + 1; + int h_col_end = min(h / stride_h + 1, height_col); + + // equivalent implementation + int offset = + (c * patch_h * patch_w + h * patch_w + w) * height_col * width_col; + int coeff_h_col = (1 - stride_h * patch_w * height_col) * width_col; + int coeff_w_col = (1 - stride_w * height_col * width_col); + for (int h_col = h_col_start; h_col < h_col_end; ++h_col) { + for (int w_col = w_col_start; w_col < w_col_end; ++w_col) { + val += data_col[offset + h_col * coeff_h_col + w_col * coeff_w_col]; + } + } + data_im[index] = val; + } +} diff --git a/modules/dnn/src/opencl/im2col.cl b/modules/dnn/src/opencl/im2col.cl new file mode 100644 index 0000000000..f3f18b5136 --- /dev/null +++ b/modules/dnn/src/opencl/im2col.cl @@ -0,0 +1,71 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +__kernel void im2col(__global const T *im_src, int im_src_offset, + int channels, int height_inp, int width_inp, + int kernel_h, int kernel_w, int pad_h, int pad_w, int stride_h, int stride_w, + int height_out, int width_out, + __global T *im_col, int im_col_offset + ) +{ + int index = get_global_id(0); + if (index >= height_out * width_out * channels) + return; + int j_out = index % width_out; + int i_out = (index / width_out) % height_out; + int c_inp = (index / width_out) / height_out; + + int c_out = c_inp * kernel_h * kernel_w; + int i_inp = i_out * stride_h - pad_h; + int j_inp = j_out * stride_w - pad_w; + + im_src += (c_inp * height_inp + i_inp) * width_inp + j_inp + im_src_offset; + im_col += (c_out * height_out + i_out) * width_out + j_out + im_col_offset; + + for (int ki = 0; ki < kernel_h; ++ki) + for (int kj = 0; kj < kernel_w; ++kj) { + int i = i_inp + ki; + int j = j_inp + kj; + *im_col = (i >= 0 && j >= 0 && i < height_inp && j < width_inp) ? + im_src[ki * width_inp + kj] : 0; + im_col += height_out * width_out; + } +} diff --git a/modules/dnn/src/opencl/lrn.cl b/modules/dnn/src/opencl/lrn.cl new file mode 100644 index 0000000000..2ff03f0edf --- /dev/null +++ b/modules/dnn/src/opencl/lrn.cl @@ -0,0 +1,76 @@ +/************************************************************************************* + * Copyright (c) 2015, Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************/ + +__kernel void LRNComputeOutput(const int nthreads, __global T* in, __global T* scale, const T negative_beta, __global T* out) { + int index = get_global_id(0); + int tmp = get_global_size(0); + for(index; index < nthreads; index += tmp) + out[index] = in[index] * pow(scale[index], negative_beta); +} + +__kernel void LRNFillScale(const int nthreads, __global T* in, const int num, const int channels, const int height, const int width, const int size, const T alpha_over_size, const T k, __global T* scale) { + int index = get_global_id(0); + int tmp = get_global_size(0); + for(index; index < nthreads; index += tmp) { + // find out the local offset + const int w = index % width; + const int h = (index / width) % height; + const int n = index / width / height; + const int offset = (n * channels * height + h) * width + w; + const int step = height * width; + in = in + offset; + scale = scale + offset; + int head = 0; + const int pre_pad = (size - 1) / 2; + const int post_pad = size - pre_pad - 1; + T accum_scale = 0; + // fill the scale at [n, :, h, w] + // accumulate values + while (head < post_pad && head < channels) { + accum_scale += in[head * step] * in[head * step]; + ++head; + } + // both add and subtract + while (head < channels) { + accum_scale += in[head * step] * in[head * step]; + if (head - size >= 0) { + accum_scale -= in[(head - size) * step] + * in[(head - size) * step]; + } + scale[(head - post_pad) * step] = k + accum_scale * alpha_over_size; + ++head; + } + // subtract only + while (head < channels + post_pad) { + if (head - size >= 0) { + accum_scale -= in[(head - size) * step] + * in[(head - size) * step]; + } + scale[(head - post_pad) * step] = k + accum_scale * alpha_over_size; + ++head; + } + } +} \ No newline at end of file diff --git a/modules/dnn/src/opencl/pooling.cl b/modules/dnn/src/opencl/pooling.cl new file mode 100644 index 0000000000..adfd59e6d9 --- /dev/null +++ b/modules/dnn/src/opencl/pooling.cl @@ -0,0 +1,106 @@ +/************************************************************************************* + * Copyright (c) 2015, Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************/ + +__kernel void MaxPoolForward(const int nthreads, + __global T* bottom_data, const int num, const int channels, const int height, const int width, + const int pooled_height, const int pooled_width, const int kernel_h, const int kernel_w, + const int stride_h, const int stride_w, const int pad_h, const int pad_w, + __global T* top_data +#ifdef MASK + , __global float* mask +#endif + ) +{ + int index = get_global_id(0); + int tmp = get_global_size(0); + for(index; index < nthreads; index += tmp) { + int pw = index % pooled_width; + int ph = (index / pooled_width) % pooled_height; + int c = (index / pooled_width / pooled_height) % channels; + int n = index / pooled_width / pooled_height / channels; + int hstart = ph * stride_h - pad_h; + int wstart = pw * stride_w - pad_w; + const int hend = min(hstart + kernel_h, height); + const int wend = min(wstart + kernel_w, width); + hstart = max(hstart, 0); + wstart = max(wstart, 0); + T maxval = -FLT_MAX; + int maxidx = -1; + bottom_data = + bottom_data + (n * channels + c) * height * width; + for (int h = hstart; h < hend; ++h) { + for (int w = wstart; w < wend; ++w) { + if (bottom_data[h * width + w] > maxval) { + maxidx = h * width + w; + maxval = bottom_data[maxidx]; + } + } + } + + top_data[index] = maxval; + +#ifdef MASK + mask[index] = maxidx; +#endif + } +} + +__kernel void AvePoolForward(const int nthreads, + __global T* bottom_data, const int num, const int channels, const int height, const int width, + const int pooled_height, const int pooled_width, const int kernel_h, const int kernel_w, + const int stride_h, const int stride_w, const int pad_h, const int pad_w, + __global T* top_data +#ifdef MASK + , __global float* mask // NOT USED +#endif + ) +{ + int index = get_global_id(0); + int tmp = get_global_size(0); + for(index; index < nthreads; index+=tmp) { + int pw = index % pooled_width; + int ph = (index / pooled_width) % pooled_height; + int c = (index / pooled_width / pooled_height) % channels; + int n = index / pooled_width / pooled_height / channels; int hstart = ph * stride_h - pad_h; int wstart = pw * stride_w - pad_w; + int hend = min(hstart + kernel_h, height + pad_h); + int wend = min(wstart + kernel_w, width + pad_w); + const int pool_size = (hend - hstart) * (wend - wstart); + hstart = max(hstart, 0); + wstart = max(wstart, 0); + hend = min(hend, height); + wend = min(wend, width); + T aveval = 0; + bottom_data = + bottom_data + (n * channels + c) * height * width; + for (int h = hstart; h < hend; ++h) { + for (int w = wstart; w < wend; ++w) { + aveval += bottom_data[h * width + w]; + } + } + top_data[index] = aveval / pool_size; + } + +} diff --git a/modules/dnn/src/opencl/softmax.cl b/modules/dnn/src/opencl/softmax.cl new file mode 100644 index 0000000000..e9fcadce39 --- /dev/null +++ b/modules/dnn/src/opencl/softmax.cl @@ -0,0 +1,75 @@ +/************************************************************************************* + * Copyright (c) 2015, Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************/ + +__kernel void kernel_channel_max(const int num, const int channels, + const int spatial_dim, __global const T* data, __global T* out) { + int index = get_global_id(0); + if(index < num * spatial_dim) { + int n = index / spatial_dim; + int s = index % spatial_dim; + T maxval = -FLT_MAX; + for (int c = 0; c < channels; ++c) { + maxval = max(data[(n * channels + c) * spatial_dim + s], maxval); + } + out[index] = maxval; + } +} + +__kernel void kernel_channel_subtract(const int count, + const int num, const int channels, + const int spatial_dim, __global const T* channel_max, __global T* data) { + int index = get_global_id(0); + if(index < count) { + int n = index / channels / spatial_dim; + int s = index % spatial_dim; + data[index] -= channel_max[n * spatial_dim + s]; + } +} + +__kernel void kernel_channel_sum(const int num, const int channels, + const int spatial_dim, __global const T* data, __global T* channel_sum) { + int index = get_global_id(0); + if(index < num * spatial_dim) { + int n = index / spatial_dim; + int s = index % spatial_dim; + T sum = 0; + for (int c = 0; c < channels; ++c) { + sum += data[(n * channels + c) * spatial_dim + s]; + } + channel_sum[index] = sum; + } +} + +__kernel void kernel_channel_div(const int count, + const int num, const int channels, + const int spatial_dim, __global const T* channel_sum, __global T* data) { + int index = get_global_id(0); + if(index < count) { + int n = index / channels / spatial_dim; + int s = index % spatial_dim; + data[index] /= channel_sum[n * spatial_dim + s]; + } +} \ No newline at end of file diff --git a/modules/dnn/src/precomp.hpp b/modules/dnn/src/precomp.hpp new file mode 100644 index 0000000000..b622e38da2 --- /dev/null +++ b/modules/dnn/src/precomp.hpp @@ -0,0 +1,45 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include +#include "cvconfig.h" +#include +#include diff --git a/modules/dnn/src/tensorflow/attr_value.proto b/modules/dnn/src/tensorflow/attr_value.proto new file mode 100644 index 0000000000..26e42bc1a1 --- /dev/null +++ b/modules/dnn/src/tensorflow/attr_value.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "AttrValueProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +import "tensor.proto"; +import "tensor_shape.proto"; +import "types.proto"; + +// Protocol buffer representing the value for an attr used to configure an Op. +// Comment indicates the corresponding attr type. Only the field matching the +// attr type may be filled. +message AttrValue { + message ListValue { + repeated bytes s = 2; // "list(string)" + repeated int64 i = 3 [packed = true]; // "list(int)" + repeated float f = 4 [packed = true]; // "list(float)" + repeated bool b = 5 [packed = true]; // "list(bool)" + repeated DataType type = 6 [packed = true]; // "list(type)" + repeated TensorShapeProto shape = 7; // "list(shape)" + repeated TensorProto tensor = 8; // "list(tensor)" + // TODO(zhifengc/josh11b): implements list(func) if needed. + } + + oneof value { + bytes s = 2; // "string" + int64 i = 3; // "int" + float f = 4; // "float" + bool b = 5; // "bool" + DataType type = 6; // "type" + TensorShapeProto shape = 7; // "shape" + TensorProto tensor = 8; // "tensor" + ListValue list = 1; // any "list(...)" + + // "func" represents a function. func.name is a function's name or + // a primitive op's name. func.attr.first is the name of an attr + // defined for that function. func.attr.second is the value for + // that attr in the instantiation. + NameAttrList func = 10; + + // This is a placeholder only used in nodes defined inside a + // function. It indicates the attr value will be supplied when + // the function is instantiated. For example, let us suppose a + // node "N" in function "FN". "N" has an attr "A" with value + // placeholder = "foo". When FN is instantiated with attr "foo" + // set to "bar", the instantiated node N's attr A will have been + // given the value "bar". + string placeholder = 9; + } +} + +// A list of attr names and their values. The whole list is attached +// with a string name. E.g., MatMul[T=float]. +message NameAttrList { + string name = 1; + map attr = 2; +} diff --git a/modules/dnn/src/tensorflow/function.proto b/modules/dnn/src/tensorflow/function.proto new file mode 100644 index 0000000000..144c75bf32 --- /dev/null +++ b/modules/dnn/src/tensorflow/function.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "FunctionProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +import "attr_value.proto"; +import "op_def.proto"; + +// A library is a set of named functions. +message FunctionDefLibrary { + repeated FunctionDef function = 1; + repeated GradientDef gradient = 2; +} + +// A function can be instantiated when the runtime can bind every attr +// with a value. When a GraphDef has a call to a function, it must +// have binding for every attr defined in the signature. +// +// TODO(zhifengc): +// * device spec, etc. +message FunctionDef { + // The definition of the function's name, arguments, return values, + // attrs etc. + OpDef signature = 1; + + // The body of the function. + repeated Node node = 2; // function.node.ret[*] are unique. + + // A node is a multi-value assignment: + // (ret[0], ret[1], ...) = func(arg[0], arg[1], ...) + // + // By convention, "func" is resolved by consulting with a user-defined + // library first. If not resolved, "func" is assumed to be a builtin op. + message Node { + // This node produces multiple outputs. They are named ret[0], + // ret[1], ..., etc. + // + // REQUIRES: function.node.ret[*] are unique across all nodes. + // REQUIRES: ret.size == func/op def's number of output args. + repeated string ret = 1; + + // The op/function name. + string op = 2; + + // Arguments passed to this func/op. + // + // arg[i] must be either one of + // function.signature.input_args[*].name or one of + // function.node[*].ret[*]. + // + // REQUIRES: arg.size == func/op def's number of input args. + repeated string arg = 3; + + // Control dependencies. + // + // dep[i] must be one of function.node[*].ret[*] or one of + // function.signature.input_args[*].name. + repeated string dep = 4; + + // Attrs. + // + // 'attr' maps names defined by 'func's attr defs to attr values. + // attr values may have placeholders which are substituted + // recursively by concrete values when this node is instantiated. + // These placeholders must name an attr listed in the FunctionDef's + // signature. + map attr = 5; + } +} + +// GradientDef defines the gradient function of a function defined in +// a function library. +// +// A gradient function g (specified by gradient_func) for a function f +// (specified by function_name) must follow the following: +// +// The function 'f' must be a numerical function which takes N inputs +// and produces M outputs. Its gradient function 'g', which is a +// function taking N + M inputs and produces N outputs. +// +// I.e. if we have +// (y1, y2, ..., y_M) = f(x1, x2, ..., x_N), +// then, g is +// (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N, +// dL/dy1, dL/dy2, ..., dL/dy_M), +// where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the +// loss function). dL/dx_i is the partial derivative of L with respect +// to x_i. +message GradientDef { + string function_name = 1; // The function name. + string gradient_func = 2; // The gradient function's name. +} diff --git a/modules/dnn/src/tensorflow/graph.proto b/modules/dnn/src/tensorflow/graph.proto new file mode 100644 index 0000000000..f945201399 --- /dev/null +++ b/modules/dnn/src/tensorflow/graph.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "GraphProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +import "attr_value.proto"; +import "function.proto"; +import "versions.proto"; + +// Represents the graph of operations +message GraphDef { + repeated NodeDef node = 1; + + // Compatibility versions of the graph. See core/public/version.h for version + // history. The GraphDef version is distinct from the TensorFlow version, and + // each release of TensorFlow will support a range of GraphDef versions. + VersionDef versions = 4; + + // Deprecated single version field; use versions above instead. Since all + // GraphDef changes before "versions" was introduced were forward + // compatible, this field is entirely ignored. + int32 version = 3 [deprecated = true]; + + // EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET. + // + // "library" provides user-defined functions. + // + // Naming: + // * library.function.name are in a flat namespace. + // NOTE: We may need to change it to be hierarchical to support + // different orgs. E.g., + // { "/google/nn", { ... }}, + // { "/google/vision", { ... }} + // { "/org_foo/module_bar", {...}} + // map named_lib; + // * If node[i].op is the name of one function in "library", + // node[i] is deemed as a function call. Otherwise, node[i].op + // must be a primitive operation supported by the runtime. + // + // + // Function call semantics: + // + // * The callee may start execution as soon as some of its inputs + // are ready. The caller may want to use Tuple() mechanism to + // ensure all inputs are ready in the same time. + // + // * The consumer of return values may start executing as soon as + // the return values the consumer depends on are ready. The + // consumer may want to use Tuple() mechanism to ensure the + // consumer does not start until all return values of the callee + // function are ready. + FunctionDefLibrary library = 2; +}; + +message NodeDef { + // The name given to this operator. Used for naming inputs, + // logging, visualization, etc. Unique within a single GraphDef. + // Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*". + string name = 1; + + // The operation name. There may be custom parameters in attrs. + // Op names starting with an underscore are reserved for internal use. + string op = 2; + + // Each input is "node:src_output" with "node" being a string name and + // "src_output" indicating which output tensor to use from "node". If + // "src_output" is 0 the ":0" suffix can be omitted. Regular inputs + // may optionally be followed by control inputs that have the format + // "^node". + repeated string input = 3; + + // A (possibly partial) specification for the device on which this + // node should be placed. + // The expected syntax for this string is as follows: + // + // DEVICE_SPEC ::= COLOCATED_NODE | PARTIAL_SPEC + // + // COLOCATED_NODE ::= "@" NODE_NAME // See NodeDef.name above. + // PARTIAL_SPEC ::= ("/" CONSTRAINT) * + // CONSTRAINT ::= ("job:" JOB_NAME) + // | ("replica:" [1-9][0-9]*) + // | ("task:" [1-9][0-9]*) + // | ( ("gpu" | "cpu") ":" ([1-9][0-9]* | "*") ) + // + // Valid values for this string include: + // * "@other/node" (colocate with "other/node") + // * "/job:worker/replica:0/task:1/gpu:3" (full specification) + // * "/job:worker/gpu:3" (partial specification) + // * "" (no specification) + // + // If the constraints do not resolve to a single device (or if this + // field is empty or not present), the runtime will attempt to + // choose a device automatically. + string device = 4; + + // Operation-specific graph-construction-time configuration. + // Note that this should include all attrs defined in the + // corresponding OpDef, including those with a value matching + // the default -- this allows the default to change and makes + // NodeDefs easier to interpret on their own. However, if + // an attr with a default is not specified in this list, the + // default will be used. + // The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and + // one of the names from the corresponding OpDef's attr field). + // The values must have a type matching the corresponding OpDef + // attr's type field. + // TODO(josh11b): Add some examples here showing best practices. + map attr = 5; +}; diff --git a/modules/dnn/src/tensorflow/op_def.proto b/modules/dnn/src/tensorflow/op_def.proto new file mode 100644 index 0000000000..baf68eaad3 --- /dev/null +++ b/modules/dnn/src/tensorflow/op_def.proto @@ -0,0 +1,157 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "OpDefProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +import "attr_value.proto"; +import "types.proto"; + +// Defines an operation. A NodeDef in a GraphDef specifies an Op by +// using the "op" field which should match the name of a OpDef. +message OpDef { + // Op names starting with an underscore are reserved for internal use. + // Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9_]*". + string name = 1; + + // For describing inputs and outputs. + message ArgDef { + // Name for the input/output. Should match the regexp "[a-z][a-z0-9_]*". + string name = 1; + + // Human readable description. + string description = 2; + + // Describes the type of one or more tensors that are accepted/produced + // by this input/output arg. The only legal combinations are: + // * For a single tensor: either the "type" field is set or the + // "type_attr" field is set to the name of an attr with type "type". + // * For a sequence of tensors with the same type: the "number_attr" + // field will be set to the name of an attr with type "int", and + // either the "type" or "type_attr" field will be set as for + // single tensors. + // * For a sequence of tensors, the "type_list_attr" field will be set + // to the name of an attr with type "list(type)". + DataType type = 3; + string type_attr = 4; // if specified, attr must have type "type" + string number_attr = 5; // if specified, attr must have type "int" + // If specified, attr must have type "list(type)", and none of + // type, type_attr, and number_attr may be specified. + string type_list_attr = 6; + + // For inputs: if true, the inputs are required to be refs. + // By default, inputs can be either refs or non-refs. + // For outputs: if true, outputs are refs, otherwise they are not. + bool is_ref = 16; + }; + + // Description of the input(s). + repeated ArgDef input_arg = 2; + + // Description of the output(s). + repeated ArgDef output_arg = 3; + + // Description of the graph-construction-time configuration of this + // Op. That is to say, this describes the attr fields that will + // be specified in the NodeDef. + message AttrDef { + // A descriptive name for the argument. May be used, e.g. by the + // Python client, as a keyword argument name, and so should match + // the regexp "[a-z][a-z0-9_]+". + string name = 1; + + // One of the type names from attr_value.proto ("string", "list(string)", + // "int", etc.). + string type = 2; + + // A reasonable default for this attribute if the user does not supply + // a value. If not specified, the user must supply a value. + AttrValue default_value = 3; + + // Human-readable description. + string description = 4; + + // TODO(josh11b): bool is_optional? + + // --- Constraints --- + // These constraints are only in effect if specified. Default is no + // constraints. + + // For type == "int", this is a minimum value. For "list(___)" + // types, this is the minimum length. + bool has_minimum = 5; + int64 minimum = 6; + + // The set of allowed values. Has type that is the "list" version + // of the "type" field above (uses the "list" field of AttrValue). + // If type == "type" or "list(type)" above, then the "type" field + // of "allowed_values.list" has the set of allowed DataTypes. + // If type == "string" or "list(string)", then the "s" field of + // "allowed_values.list" has the set of allowed strings. + AttrValue allowed_values = 7; + } + repeated AttrDef attr = 4; + + // Optional deprecation based on GraphDef versions. + OpDeprecation deprecation = 8; + + // One-line human-readable description of what the Op does. + string summary = 5; + + // Additional, longer human-readable description of what the Op does. + string description = 6; + + // ------------------------------------------------------------------------- + // Which optimizations this operation can participate in. + + // True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs) + bool is_commutative = 18; + + // If is_aggregate is true, then this operation accepts N >= 2 + // inputs and produces 1 output all of the same type. Should be + // associative and commutative, and produce output with the same + // shape as the input. The optimizer may replace an aggregate op + // taking input from multiple devices with a tree of aggregate ops + // that aggregate locally within each device (and possibly within + // groups of nearby devices) before communicating. + // TODO(josh11b): Implement that optimization. + bool is_aggregate = 16; // for things like add + + // Other optimizations go here, like + // can_alias_input, rewrite_when_output_unused, partitioning_strategy, etc. + + // ------------------------------------------------------------------------- + // Optimization constraints. + + // By default Ops may be moved between devices. Stateful ops should + // either not be moved, or should only be moved if that state can also + // be moved (e.g. via some sort of save / restore). + // Stateful ops are guaranteed to never be optimized away by Common + // Subexpression Elimination (CSE). + bool is_stateful = 17; // for things like variables, queue + + // ------------------------------------------------------------------------- + // Non-standard options. + + // By default, all inputs to an Op must be initialized Tensors. Ops + // that may initialize tensors for the first time should set this + // field to true, to allow the Op to take an uninitialized Tensor as + // input. + bool allows_uninitialized_input = 19; // for Assign, etc. +}; + +// Information about version-dependent deprecation of an op +message OpDeprecation { + // First GraphDef version at which the op is disallowed. + int32 version = 1; + + // Explanation of why it was deprecated and what to use instead. + string explanation = 2; +}; + +// A collection of OpDefs +message OpList { + repeated OpDef op = 1; +}; diff --git a/modules/dnn/src/tensorflow/tensor.proto b/modules/dnn/src/tensorflow/tensor.proto new file mode 100644 index 0000000000..080421809e --- /dev/null +++ b/modules/dnn/src/tensorflow/tensor.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "TensorProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +import "tensor_shape.proto"; +import "types.proto"; + +// Protocol buffer representing a tensor. +message TensorProto { + DataType dtype = 1; + + // Shape of the tensor. TODO(touts): sort out the 0-rank issues. + TensorShapeProto tensor_shape = 2; + + // Only one of the representations below is set, one of "tensor_contents" and + // the "xxx_val" attributes. We are not using oneof because as oneofs cannot + // contain repeated fields it would require another extra set of messages. + + // Version number. + // + // In version 0, if the "repeated xxx" representations contain only one + // element, that element is repeated to fill the shape. This makes it easy + // to represent a constant Tensor with a single value. + int32 version_number = 3; + + // Serialized content from Tensor::AsProtoTensorContent(). This representation + // can be used for all tensor types. + bytes tensor_content = 4; + + // Type specific representations that make it easy to create tensor protos in + // all languages. Only the representation corresponding to "dtype" can + // be set. The values hold the flattened representation of the tensor in + // row major order. + + // DT_HALF. Note that since protobuf has no int16 type, we'll have some + // pointless zero padding for each value here. + repeated int32 half_val = 13 [packed = true]; + + // DT_FLOAT. + repeated float float_val = 5 [packed = true]; + + // DT_DOUBLE. + repeated double double_val = 6 [packed = true]; + + // DT_INT32, DT_INT16, DT_INT8, DT_UINT8. + repeated int32 int_val = 7 [packed = true]; + + // DT_STRING + repeated bytes string_val = 8; + + // DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real + // and imaginary parts of i-th single precision complex. + repeated float scomplex_val = 9 [packed = true]; + + // DT_INT64 + repeated int64 int64_val = 10 [packed = true]; + + // DT_BOOL + repeated bool bool_val = 11 [packed = true]; + + // DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real + // and imaginary parts of i-th double precision complex. + repeated double dcomplex_val = 12 [packed = true]; +}; diff --git a/modules/dnn/src/tensorflow/tensor_shape.proto b/modules/dnn/src/tensorflow/tensor_shape.proto new file mode 100644 index 0000000000..1ec3c5323c --- /dev/null +++ b/modules/dnn/src/tensorflow/tensor_shape.proto @@ -0,0 +1,45 @@ +// Protocol buffer representing the shape of tensors. + +syntax = "proto3"; +option cc_enable_arenas = true; +option java_outer_classname = "TensorShapeProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +package tensorflow; + +// Dimensions of a tensor. +message TensorShapeProto { + // One dimension of the tensor. + message Dim { + // Size of the tensor in that dimension. + // This value must be >= -1, but values of -1 are reserved for "unknown" + // shapes (values of -1 mean "unknown" dimension). Certain wrappers + // that work with TensorShapeProto may fail at runtime when deserializing + // a TensorShapeProto containing a dim value of -1. + int64 size = 1; + + // Optional name of the tensor dimension. + string name = 2; + }; + + // Dimensions of the tensor, such as {"input", 30}, {"output", 40} + // for a 30 x 40 2D tensor. If an entry has size -1, this + // corresponds to a dimension of unknown size. The names are + // optional. + // + // The order of entries in "dim" matters: It indicates the layout of the + // values in the tensor in-memory representation. + // + // The first entry in "dim" is the outermost dimension used to layout the + // values, the last entry is the innermost dimension. This matches the + // in-memory layout of RowMajor Eigen tensors. + // + // If "dim.size()" > 0, "unknown_rank" must be false. + repeated Dim dim = 2; + + // If true, the number of dimensions in the shape is unknown. + // + // If true, "dim.size()" must be 0. + bool unknown_rank = 3; +}; diff --git a/modules/dnn/src/tensorflow/tf_importer.cpp b/modules/dnn/src/tensorflow/tf_importer.cpp new file mode 100644 index 0000000000..0ff2dd3b5d --- /dev/null +++ b/modules/dnn/src/tensorflow/tf_importer.cpp @@ -0,0 +1,759 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of Tensorflow models parser +*/ + +#include "../precomp.hpp" +using namespace cv; +using namespace cv::dnn; + +#if HAVE_PROTOBUF +#include "graph.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include "tf_io.hpp" + +using ::google::protobuf::RepeatedField; +using ::google::protobuf::RepeatedPtrField; +using ::google::protobuf::Message; +using ::google::protobuf::Descriptor; +using ::google::protobuf::FieldDescriptor; +using ::google::protobuf::Reflection; + +namespace +{ + +static int toNCHW[] = {0, 2, 3, 1}; + +typedef std::vector > StrIntVector; + +struct Pin +{ + Pin(const std::string &_name, int _blobIndex = 0) : + name(_name), blobIndex(_blobIndex) {} + + Pin() : + name(""), blobIndex(-1) {} + + std::string name; + int blobIndex; +}; + +void blobShapeFromTensor(const tensorflow::TensorProto &tensor, MatShape& shape) +{ + shape.clear(); + if (tensor.has_tensor_shape()) + { + const tensorflow::TensorShapeProto &_shape = tensor.tensor_shape(); + int i, n = _shape.dim_size(); + shape.resize(n); + + for (i = 0; i < n; i++) + shape[i] = (int)_shape.dim(i).size(); + } + else + { + CV_Error(Error::StsError, "Unknown shape of input tensor"); + } +} + +template +void parseTensor(const tensorflow::TensorProto &tensor, Mat &dstBlob) +{ + MatShape shape; + blobShapeFromTensor(tensor, shape); + int dims = (int)shape.size(); + + if (dims == 4) + { + // REORDER blob NHWC to NCHW + swap(shape[2], shape[3]); // NHCW + swap(shape[1], shape[2]); // NCHW + } + + dstBlob.create(shape, CV_32F); + + int size = tensor.tensor_content().size() / sizeof(T); + CV_Assert(size == (int)dstBlob.total()); + + float *dstData = dstBlob.ptr(); + const T *data = reinterpret_cast(tensor.tensor_content().c_str()); + + if (dims == 4) + { + int num = shape[0], channels = shape[1], height = shape[2], width = shape[3]; + int total = num*channels*height*width; + for(int i_n = 0; i_n < shape[0]; i_n++) { + for(int i_c = 0; i_c < shape[1]; i_c++) { + for(int i_h = 0; i_h < shape[2]; i_h++) { + for(int i_w = 0; i_w < shape[3]; i_w++) { + int dst_i = channels*height*width*i_n + height*width*i_c + width*i_h + i_w; + int src_i = channels*height*width*i_n + i_c + channels*width*i_h + channels*i_w; + + CV_Assert(dst_i < total); + CV_Assert(src_i < total); + + dstData[dst_i] = data[src_i]; + } + } + } + } + } else { + for (int i = 0; i < size; i++) + dstData[i] = data[i]; + } +} + +void blobFromTensor(const tensorflow::TensorProto &tensor, Mat &dstBlob) +{ + switch (tensor.dtype()) { + case tensorflow::DT_FLOAT: + parseTensor(tensor, dstBlob); + break; + case tensorflow::DT_DOUBLE: + parseTensor(tensor, dstBlob); + break; + default: + CV_Error(Error::StsError, "Tensor's data type is not supported"); + break; + } +} + +void printList(const tensorflow::AttrValue::ListValue &val) +{ + std::cout << "("; + for (int i = 0; i < val.i_size(); i++) + std::cout << " " << val.i(i); + std::cout << " )"; +} + +void printTensorShape(const tensorflow::TensorShapeProto &shape) +{ + std::cout << "[ "; + for (int d = 0; d < shape.dim_size(); d++) + std::cout << shape.dim(d).name() << + ":" << shape.dim(d).size() << " "; + std::cout << "]"; +} + +void printTensor(const tensorflow::TensorProto &tensor) +{ + printTensorShape(tensor.tensor_shape()); + + if (tensor.tensor_content().empty()) + return; + + switch (tensor.dtype()) + { + case 1: // float + { + const float *data = reinterpret_cast(tensor.tensor_content().c_str()); + int size = tensor.tensor_content().size() / sizeof(float); + for (int i = 0; i < std::min(10, size); i++) + std::cout << " " << data[i]; + if (size > 10) + std::cout << " ... " << size - 10 << " more"; + break; + } + case 3: // int32 + { + const int *data = reinterpret_cast(tensor.tensor_content().c_str()); + int size = tensor.tensor_content().size() / sizeof(int); + for (int i = 0; i < std::min(10, size); i++) + std::cout << " " << data[i]; + if (size > 10) + std::cout << " ... " << size - 10 << " more"; + break; + } + default: + CV_Error(Error::StsError, "Tensor type is not supported"); + break; + } +} + +void printLayerAttr(const tensorflow::NodeDef &layer) +{ + std::cout << std::endl << layer.name() << ":" << layer.op(); + for (int ii = 0; ii < layer.input_size(); ii++) + std::cout << "(" << layer.input(ii) << ")"; + std::cout << std::endl; + google::protobuf::Map attr + = layer.attr(); + for (google::protobuf::Map::const_iterator ai = attr.begin(); + ai != attr.end(); ++ai) + { + std::cout << ai->first << ":"; + if (ai->first == "dtype" || ai->first == "T") + std::cout << ai->second.i(); + else if (ai->first == "padding") + std::cout << ai->second.s(); + else if (ai->first == "transpose_a" || ai->first == "transpose_b") + std::cout << ai->second.b(); + // else if (ai->first == "shape") + // printTensorShape(ai->second.shape()); + else if (ai->first == "strides" || ai->first == "ksize") + printList(ai->second.list()); + else + printTensor(ai->second.tensor()); + std::cout << std::endl; + } +} + +bool hasLayerAttr(const tensorflow::NodeDef &layer, const std::string &name) +{ + google::protobuf::Map attr = layer.attr(); + return attr.find(name) != attr.end(); +} + +const tensorflow::AttrValue& getLayerAttr(const tensorflow::NodeDef &layer, const std::string &name) +{ + return layer.attr().at(name); +} + +void setStrides(LayerParams &layerParams, const tensorflow::NodeDef &layer) +{ + if (hasLayerAttr(layer, "strides")) + { + const tensorflow::AttrValue& val = getLayerAttr(layer, "strides"); + if (val.list().i_size() != 4 || + val.list().i(0) != 1 || val.list().i(3) != 1) + CV_Error(Error::StsError, "Unsupported strides"); + layerParams.set("stride_h", static_cast(val.list().i(1))); + layerParams.set("stride_w", static_cast(val.list().i(2))); + } +} + +DictValue parseDims(const tensorflow::TensorProto &tensor) { + MatShape shape; + blobShapeFromTensor(tensor, shape); + int dims = (int)shape.size(); + + CV_Assert(tensor.dtype() == tensorflow::DT_INT32); + CV_Assert(dims == 1); + + int size = tensor.tensor_content().size() / sizeof(int); + const int *data = reinterpret_cast(tensor.tensor_content().c_str()); + // TODO: add reordering shape if dims == 4 + return DictValue::arrayInt(data, size); +} + +void setKSize(LayerParams &layerParams, const tensorflow::NodeDef &layer) +{ + if (hasLayerAttr(layer, "ksize")) + { + const tensorflow::AttrValue& val = getLayerAttr(layer, "ksize"); + if (val.list().i_size() != 4 || + val.list().i(0) != 1 || val.list().i(3) != 1) + CV_Error(Error::StsError, "Unsupported ksize"); + layerParams.set("kernel_h", static_cast(val.list().i(1))); + layerParams.set("kernel_w", static_cast(val.list().i(2))); + } + else + { + layerParams.set("kernel_h", 1); + layerParams.set("kernel_w", 1); + } +} + +void setPadding(LayerParams &layerParams, const tensorflow::NodeDef &layer) +{ + if (hasLayerAttr(layer, "padding")) + layerParams.set("pad_mode", getLayerAttr(layer, "padding").s()); +} + +void RemoveIdentityOps(tensorflow::GraphDef& net) { + typedef std::map IdentityOpsMap; + IdentityOpsMap identity_ops; + + std::vector identity_ops_idx; + + int layersCount = net.node_size(); + for (int li = 0; li < layersCount; li++) + { + const tensorflow::NodeDef &layer = net.node(li); + String type = layer.op(); + + if (type == "Identity") { + identity_ops_idx.push_back(li); + identity_ops[layer.name()] = layer.input(0); + } + } + + for (int li = 0; li < layersCount; li++) + { + tensorflow::NodeDef* layer = net.mutable_node(li); + for (int input_id = 0; input_id < layer->input_size(); input_id++) { + String input_op_name = layer->input(input_id); + IdentityOpsMap::iterator it = identity_ops.find(input_op_name); + + if (it != identity_ops.end()) { + layer->set_input(input_id, it->second); + } + } + } + + std::sort(identity_ops_idx.begin(), identity_ops_idx.end()); + + int removed_nodes = 0; + for(size_t i = 0; i < identity_ops_idx.size(); i++) { + int start_id = identity_ops_idx[i] - removed_nodes; + net.mutable_node()->DeleteSubrange(start_id, 1); + removed_nodes++; + } +} + +Pin parsePin(const std::string &name) +{ + Pin pin(name); + + size_t delimiter_pos = name.find_first_of(":"); + if (delimiter_pos != std::string::npos) + { + pin.name = name.substr(0, delimiter_pos); + std::istringstream(name.substr(delimiter_pos + 1)) >> pin.blobIndex; + } + + return pin; +} + +StrIntVector getNextLayers(const tensorflow::GraphDef& net, const String& layer_name, const String& type = "") +{ + StrIntVector layers; + + for (int li = 0; li < net.node_size(); li++) + { + const tensorflow::NodeDef& layer = net.node(li); + for (int input_id = 0; input_id < layer.input_size(); input_id++) { + String input_op_name = parsePin(layer.input(input_id)).name; + bool type_ok = type.empty() ? true : type == layer.op(); + if (input_op_name == layer_name && type_ok) + layers.push_back(std::make_pair(layer.name(), li)); + } + } + + return layers; +} + +void ExcludeLayer(tensorflow::GraphDef& net, const int layer_index, const int input_blob_index, bool remove_from_net = true) { + String layer_name = net.node(layer_index).name(); + StrIntVector layers = getNextLayers(net, layer_name); + + String removed_layer_input = net.node(layer_index).input(input_blob_index); + + for (size_t i = 0; i < layers.size(); i++) + { + tensorflow::NodeDef* layer = net.mutable_node(layers[i].second); + for (int input_id = 0; input_id < layer->input_size(); input_id++) { + String input_op_name = layer->input(input_id); + + if (input_op_name == layer_name) { + layer->set_input(input_id, removed_layer_input); + } + } + } + + if (remove_from_net) + net.mutable_node()->DeleteSubrange(layer_index, 1); +} + +class TFImporter : public Importer { +public: + TFImporter(const char *model); + void populateNet(Net dstNet); + ~TFImporter() {} + +private: + void kernelFromTensor(const tensorflow::TensorProto &tensor, Mat &dstBlob); + + void connect(const std::map& layers_name_id_map, Net& network, const Pin& outPin, + const int input_layer_id, const int input_blob_id); + void connectToAllBlobs(const std::map& layer_id, Net& network, const Pin& outPin, + const int input_layer_id, const int input_blobs_count); + const tensorflow::TensorProto& getConstBlob(const tensorflow::NodeDef &layer, std::map const_layers, + int input_blob_index = -1, int* actual_inp_blob_idx = 0); + + + tensorflow::GraphDef net; +}; + +TFImporter::TFImporter(const char *model) +{ + if (model && model[0]) + ReadTFNetParamsFromBinaryFileOrDie(model, &net); +} + +void TFImporter::kernelFromTensor(const tensorflow::TensorProto &tensor, Mat &dstBlob) +{ + MatShape shape; + blobShapeFromTensor(tensor, shape); + int dims = (int)shape.size(); + + // TODO: other blob types + CV_Assert(tensor.dtype() == tensorflow::DT_FLOAT); + CV_Assert(dims == 4); + + // REORDER kernel HWIO to OIHW + swap(shape[0], shape[2]); // IWHO + swap(shape[1], shape[3]); // IOHW + swap(shape[0], shape[1]); // OIHW + + dstBlob.create(shape, CV_32F); + + int size = tensor.tensor_content().size() / sizeof(float); + CV_Assert(size == (int)dstBlob.total()); + + float *dstData = dstBlob.ptr(); + const float *data = reinterpret_cast(tensor.tensor_content().c_str()); + + int out_c = shape[0], input_c = shape[1], height = shape[2], width = shape[3]; + int total = out_c*input_c*height*width; + for(int i_oc = 0; i_oc < out_c; i_oc++) { + for(int i_ic = 0; i_ic < input_c; i_ic++) { + for(int i_h = 0; i_h < height; i_h++) { + for(int i_w = 0; i_w < width; i_w++) { + int dst_i = input_c*height*width*i_oc + height*width*i_ic + width*i_h + i_w; + int src_i = out_c*input_c*width*i_h + out_c*input_c*i_w + out_c*i_ic + i_oc; + CV_Assert(dst_i < total); + CV_Assert(src_i < total); + dstData[dst_i] = data[src_i]; + } + } + } + } +} + +void TFImporter::connect(const std::map& layers_name_id_map, Net& network, const Pin& outPin, + const int input_layer_id, const int input_blob_id) +{ + std::map::const_iterator it = layers_name_id_map.find(outPin.name); + if (it == layers_name_id_map.end()) + CV_Error(Error::StsError, "Input layer not found: " + outPin.name); + network.connect(it->second, outPin.blobIndex, input_layer_id, input_blob_id); +} + +void TFImporter::connectToAllBlobs(const std::map& layer_id, Net& network, const Pin& outPin, + const int input_layer_id, const int input_blobs_count) +{ + for (int input_blob_id = 0; input_blob_id < input_blobs_count; input_blob_id++) + connect(layer_id, network, outPin, input_layer_id, input_blob_id); +} + +const tensorflow::TensorProto& TFImporter::getConstBlob(const tensorflow::NodeDef &layer, std::map const_layers, + int input_blob_index, int* actual_inp_blob_idx) { + if (input_blob_index == -1) { + for(int i = 0; i < layer.input_size(); i++) { + Pin input = parsePin(layer.input(i)); + if (const_layers.find(input.name) != const_layers.end()) { + if (input_blob_index != -1) + CV_Error(Error::StsError, "More than one input is Const op"); + + input_blob_index = i; + } + } + } + + if (input_blob_index == -1) + CV_Error(Error::StsError, "Const input blob for weights not found"); + + Pin kernel_inp = parsePin(layer.input(input_blob_index)); + if (const_layers.find(kernel_inp.name) == const_layers.end()) + CV_Error(Error::StsError, "Const kernel input not found"); + if (kernel_inp.blobIndex != 0) + CV_Error(Error::StsError, "Unsupported kernel input"); + + if(actual_inp_blob_idx) { + *actual_inp_blob_idx = input_blob_index; + } + + return net.node(const_layers.at(kernel_inp.name)).attr().at("value").tensor(); +} + + +void TFImporter::populateNet(Net dstNet) +{ + RemoveIdentityOps(net); + + std::map layers_to_ignore; + + int layersSize = net.node_size(); + + // find all Const layers for params + std::map value_id; + for (int li = 0; li < layersSize; li++) + { + const tensorflow::NodeDef &layer = net.node(li); + String name = layer.name(); + String type = layer.op(); + + if (type != "Const") + continue; // only Const parameters are supported + + if (layer.attr().find("value") != layer.attr().end()) + { + value_id.insert(std::make_pair(name, li)); + } + + layers_to_ignore[li] = name; + } + + std::map layer_id; + + for (int li = 0; li < layersSize; li++) + { + const tensorflow::NodeDef &layer = net.node(li); + String name = layer.name(); + String type = layer.op(); + LayerParams layerParams; + + if(layers_to_ignore.find(li) != layers_to_ignore.end()) + continue; + + if (type == "Conv2D") + { + layerParams.set("bias_term", false); + layerParams.blobs.resize(1); + + StrIntVector next_layers = getNextLayers(net, name, "BiasAdd"); + if (next_layers.size() == 1) { + layerParams.set("bias_term", true); + layerParams.blobs.resize(2); + + int weights_layer_index = next_layers[0].second; + + blobFromTensor(getConstBlob(net.node(weights_layer_index), value_id), layerParams.blobs[1]); + ExcludeLayer(net, weights_layer_index, 0, false); + layers_to_ignore[weights_layer_index] = next_layers[0].first; + } + + kernelFromTensor(getConstBlob(layer, value_id), layerParams.blobs[0]); + const int* kshape = layerParams.blobs[0].size.p; + layerParams.set("kernel_h", kshape[2]); + layerParams.set("kernel_w", kshape[3]); + layerParams.set("num_output", kshape[0]); + + setStrides(layerParams, layer); + setPadding(layerParams, layer); + + int id = dstNet.addLayer(name, "Convolution", layerParams); + layer_id[name] = id; + + // one input only + connect(layer_id, dstNet, parsePin(layer.input(0)), id, 0); + } + else if (type == "BiasAdd" || type == "Add") + { + layerParams.blobs.resize(1); + blobFromTensor(getConstBlob(layer, value_id), layerParams.blobs[0]); + + int id = dstNet.addLayer(name, "Shift", layerParams); + layer_id[name] = id; + + // one input only + connect(layer_id, dstNet, parsePin(layer.input(0)), id, 0); + } + else if (type == "Identity") + { + int id = dstNet.addLayer(name, "Identity", layerParams); + layer_id[name] = id; + + connectToAllBlobs(layer_id, dstNet, parsePin(layer.input(0)), id, layer.input_size()); + } + else if (type == "MatMul") + { + CV_Assert(layer.input_size() == 2); + + layerParams.set("bias_term", false); + layerParams.blobs.resize(1); + + StrIntVector next_layers = getNextLayers(net, name, "BiasAdd"); + if (next_layers.size() == 1) { + layerParams.set("bias_term", true); + layerParams.blobs.resize(2); + + int weights_layer_index = next_layers[0].second; + blobFromTensor(getConstBlob(net.node(weights_layer_index), value_id), layerParams.blobs[1]); + ExcludeLayer(net, weights_layer_index, 0, false); + layers_to_ignore[weights_layer_index] = next_layers[0].first; + } + + int kernel_blob_index = -1; + blobFromTensor(getConstBlob(layer, value_id, -1, &kernel_blob_index), layerParams.blobs[0]); + + if (kernel_blob_index == 1) { // In this case output is computed by x*W formula - W should be transposed + Mat data = layerParams.blobs[0].t(); + layerParams.blobs[0] = data.clone(); + } + + layerParams.set("num_output", layerParams.blobs[0].size[0]); + + int id = dstNet.addLayer(name, "InnerProduct", layerParams); + layer_id[name] = id; + + // one input only + int input_blob_index = kernel_blob_index == 0 ? 1 : 0; + connect(layer_id, dstNet, parsePin(layer.input(input_blob_index)), id, 0); + } + else if (type == "Reshape") + { + layerParams.set("dim", parseDims(getConstBlob(layer, value_id, 1))); + layerParams.set("reorder_dims", true); + + int id = dstNet.addLayer(name, "Reshape", layerParams); + layer_id[name] = id; + + // one input only + connect(layer_id, dstNet, parsePin(layer.input(0)), id, 0); + } + else if (type == "Const") + { + } + else if (type == "Softmax") + { + int id = dstNet.addLayer(name, "Softmax", layerParams); + layer_id[name] = id; + + connectToAllBlobs(layer_id, dstNet, parsePin(layer.input(0)), id, layer.input_size()); + } + else if (type == "LRN") + { + if(hasLayerAttr(layer, "alpha")) { + layerParams.set("alpha", getLayerAttr(layer, "alpha").f()); + } + if(hasLayerAttr(layer, "beta")) { + layerParams.set("beta", getLayerAttr(layer, "beta").f()); + } + if(hasLayerAttr(layer, "depth_radius")) { + int radius = (int)getLayerAttr(layer, "depth_radius").i(); + layerParams.set("local_size", 2*radius + 1); + } + if(hasLayerAttr(layer, "bias")) { + layerParams.set("bias", getLayerAttr(layer, "bias").f()); + } + layerParams.set("norm_by_size", false); + + int id = dstNet.addLayer(name, "LRN", layerParams); + layer_id[name] = id; + + connectToAllBlobs(layer_id, dstNet, parsePin(layer.input(0)), id, layer.input_size()); + } + else if (type == "Concat") + { + int axis = getConstBlob(layer, value_id, 0).int_val().Get(0); + layerParams.set("axis", toNCHW[axis]); + + int id = dstNet.addLayer(name, "Concat", layerParams); + layer_id[name] = id; + + // input(0) is concat_dim + for (int ii = 1; ii < layer.input_size(); ii++) + { + Pin inp = parsePin(layer.input(ii)); + if (layer_id.find(inp.name) == layer_id.end()) + CV_Error(Error::StsError, "Input layer not found: " + inp.name); + dstNet.connect(layer_id.at(inp.name), inp.blobIndex, id, ii - 1); + } + } + else if (type == "Relu") + { + int id = dstNet.addLayer(name, "ReLU", layerParams); + layer_id[name] = id; + + connectToAllBlobs(layer_id, dstNet, parsePin(layer.input(0)), id, layer.input_size()); + } + else if (type == "MaxPool") + { + layerParams.set("pool", "max"); + + setKSize(layerParams, layer); + setStrides(layerParams, layer); + setPadding(layerParams, layer); + + int id = dstNet.addLayer(name, "Pooling", layerParams); + layer_id[name] = id; + + connectToAllBlobs(layer_id, dstNet, parsePin(layer.input(0)), id, layer.input_size()); + } + else if (type == "AvgPool") + { + layerParams.set("pool", "ave"); + + setKSize(layerParams, layer); + setStrides(layerParams, layer); + setPadding(layerParams, layer); + + int id = dstNet.addLayer(name, "Pooling", layerParams); + layer_id[name] = id; + + connectToAllBlobs(layer_id, dstNet, parsePin(layer.input(0)), id, layer.input_size()); + } + else if (type == "Placeholder") + { + std::vector netInputs(1); + netInputs[0] = name; + layer_id[name] = 0; + dstNet.setInputsNames(netInputs); + } + else if (type == "Split") { + // TODO: determing axis index remapping by input dimensions order of input blob + // TODO: slicing input may be Const op + // TODO: slicing kernels for convolutions - in current implenmentation it is impossible + // TODO: add parsing num of slices parameter + CV_Assert(layer.input_size() == 2); + // num_split + // 1st blob is dims tensor + layerParams.set("slice_point", DictValue::arrayReal((double*)0, 0)); + + int axis = getConstBlob(layer, value_id, 0).int_val().Get(0); + layerParams.set("axis", toNCHW[axis]); + + int id = dstNet.addLayer(name, "Slice", layerParams); + layer_id[name] = id; + + // one input only + connect(layer_id, dstNet, parsePin(layer.input(1)), id, 0); + } + else + { + printLayerAttr(layer); + CV_Error_(Error::StsError, ("Unknown layer type %s in op %s", type.c_str(), name.c_str())); + } + } +} + +} // namespace + +Ptr cv::dnn::createTensorflowImporter(const String &model) +{ + return Ptr(new TFImporter(model.c_str())); +} + +#else //HAVE_PROTOBUF + +Ptr cv::dnn::createTensorflowImporter(const String&) +{ + CV_Error(cv::Error::StsNotImplemented, "libprotobuf required to import data from TensorFlow models"); + return Ptr(); +} + +#endif //HAVE_PROTOBUF + +Net cv::dnn::readNetFromTensorflow(const String &model) +{ + Ptr importer = createTensorflowImporter(model); + Net net; + if (importer) + importer->populateNet(net); + return net; +} diff --git a/modules/dnn/src/tensorflow/tf_io.cpp b/modules/dnn/src/tensorflow/tf_io.cpp new file mode 100644 index 0000000000..fafe3cfa9f --- /dev/null +++ b/modules/dnn/src/tensorflow/tf_io.cpp @@ -0,0 +1,63 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Implementation of various functions which are related to Tensorflow models reading. +*/ + +#if HAVE_PROTOBUF +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "graph.pb.h" +#include "tf_io.hpp" +#include "../caffe/glog_emulator.hpp" + +namespace cv { +namespace dnn { + +using std::string; +using std::map; +using namespace tensorflow; +using namespace ::google::protobuf; +using namespace ::google::protobuf::io; + +const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 byte. + +// TODO: remove Caffe duplicate +bool ReadProtoFromBinaryFileTF(const char* filename, Message* proto) { + std::ifstream fs(filename, std::ifstream::in | std::ifstream::binary); + CHECK(fs.is_open()) << "Can't open \"" << filename << "\""; + ZeroCopyInputStream* raw_input = new IstreamInputStream(&fs); + CodedInputStream* coded_input = new CodedInputStream(raw_input); + coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); + + bool success = proto->ParseFromCodedStream(coded_input); + + delete coded_input; + delete raw_input; + fs.close(); + return success; +} + +void ReadTFNetParamsFromBinaryFileOrDie(const char* param_file, + tensorflow::GraphDef* param) { + CHECK(ReadProtoFromBinaryFileTF(param_file, param)) + << "Failed to parse GraphDef file: " << param_file; +} + +} +} +#endif diff --git a/modules/dnn/src/tensorflow/tf_io.hpp b/modules/dnn/src/tensorflow/tf_io.hpp new file mode 100644 index 0000000000..db9612fc3c --- /dev/null +++ b/modules/dnn/src/tensorflow/tf_io.hpp @@ -0,0 +1,29 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Declaration of various functions which are related to Tensorflow models reading. +*/ + +#ifndef __OPENCV_DNN_TF_IO_HPP__ +#define __OPENCV_DNN_TF_IO_HPP__ +#if HAVE_PROTOBUF + +#include "graph.pb.h" + +namespace cv { +namespace dnn { + +// Read parameters from a file into a GraphDef proto message. +void ReadTFNetParamsFromBinaryFileOrDie(const char* param_file, + tensorflow::GraphDef* param); + +} +} + +#endif +#endif diff --git a/modules/dnn/src/tensorflow/types.proto b/modules/dnn/src/tensorflow/types.proto new file mode 100644 index 0000000000..051361bbed --- /dev/null +++ b/modules/dnn/src/tensorflow/types.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "TypesProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +enum DataType { + // Not a legal value for DataType. Used to indicate a DataType field + // has not been set. + DT_INVALID = 0; + + // Data types that all computation devices are expected to be + // capable to support. + DT_FLOAT = 1; + DT_DOUBLE = 2; + DT_INT32 = 3; + DT_UINT8 = 4; + DT_INT16 = 5; + DT_INT8 = 6; + DT_STRING = 7; + DT_COMPLEX64 = 8; // Single-precision complex + DT_INT64 = 9; + DT_BOOL = 10; + DT_QINT8 = 11; // Quantized int8 + DT_QUINT8 = 12; // Quantized uint8 + DT_QINT32 = 13; // Quantized int32 + DT_BFLOAT16 = 14; // Float32 truncated to 16 bits. Only for cast ops. + DT_QINT16 = 15; // Quantized int16 + DT_QUINT16 = 16; // Quantized uint16 + DT_UINT16 = 17; + DT_COMPLEX128 = 18; // Double-precision complex + DT_HALF = 19; + + // TODO(josh11b): DT_GENERIC_PROTO = ??; + // TODO(jeff,josh11b): DT_UINT64? DT_UINT32? + + // Do not use! These are only for parameters. Every enum above + // should have a corresponding value below (verified by types_test). + DT_FLOAT_REF = 101; + DT_DOUBLE_REF = 102; + DT_INT32_REF = 103; + DT_UINT8_REF = 104; + DT_INT16_REF = 105; + DT_INT8_REF = 106; + DT_STRING_REF = 107; + DT_COMPLEX64_REF = 108; + DT_INT64_REF = 109; + DT_BOOL_REF = 110; + DT_QINT8_REF = 111; + DT_QUINT8_REF = 112; + DT_QINT32_REF = 113; + DT_BFLOAT16_REF = 114; + DT_QINT16_REF = 115; + DT_QUINT16_REF = 116; + DT_UINT16_REF = 117; + DT_COMPLEX128_REF = 118; + DT_HALF_REF = 119; +} diff --git a/modules/dnn/src/tensorflow/versions.proto b/modules/dnn/src/tensorflow/versions.proto new file mode 100644 index 0000000000..7d5e58ae7d --- /dev/null +++ b/modules/dnn/src/tensorflow/versions.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package tensorflow; +option cc_enable_arenas = true; +option java_outer_classname = "VersionsProtos"; +option java_multiple_files = true; +option java_package = "org.tensorflow.framework"; + +// Version information for a piece of serialized data +// +// There are different types of versions for each type of data +// (GraphDef, etc.), but they all have the same common shape +// described here. +// +// Each consumer has "consumer" and "min_producer" versions (specified +// elsewhere). A consumer is allowed to consume this data if +// +// producer >= min_producer +// consumer >= min_consumer +// consumer not in bad_consumers +// +message VersionDef { + // The version of the code that produced this data. + int32 producer = 1; + + // Any consumer below this version is not allowed to consume this data. + int32 min_consumer = 2; + + // Specific consumer versions which are disallowed (e.g. due to bugs). + repeated int32 bad_consumers = 3; +}; diff --git a/modules/dnn/src/torch/COPYRIGHT.txt b/modules/dnn/src/torch/COPYRIGHT.txt new file mode 100644 index 0000000000..bc002b78ab --- /dev/null +++ b/modules/dnn/src/torch/COPYRIGHT.txt @@ -0,0 +1,36 @@ +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) +Copyright (c) 2006 Idiap Research Institute (Samy Bengio) +Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the names of Deepmind Technologies, NYU, NEC Laboratories America + and IDIAP Research Institute nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/modules/dnn/src/torch/THDiskFile.cpp b/modules/dnn/src/torch/THDiskFile.cpp new file mode 100644 index 0000000000..c56b0f4899 --- /dev/null +++ b/modules/dnn/src/torch/THDiskFile.cpp @@ -0,0 +1,798 @@ +#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER +#include "THGeneral.h" +#include "THDiskFile.h" +#include "THFilePrivate.h" + +extern "C" +{ + +typedef struct THDiskFile__ +{ + THFile file; + + FILE *handle; + char *name; + int isNativeEncoding; + int longSize; + +} THDiskFile; + +static int THDiskFile_isOpened(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)self; + return (dfself->handle != NULL); +} + +const char *THDiskFile_name(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)self; + return dfself->name; +} + +/* workaround mac osx lion ***insane*** fread bug */ +#ifdef __APPLE__ +static size_t fread__(void *ptr, size_t size, size_t nitems, FILE *stream) +{ + size_t nread = 0; + while(!feof(stream) && !ferror(stream) && (nread < nitems)) + nread += fread((char*)ptr+nread*size, size, THMin(2147483648UL/size, nitems-nread), stream); + return nread; +} +#else +#define fread__ fread +#endif + +#define READ_WRITE_METHODS(TYPE, TYPEC, ASCII_READ_ELEM, ASCII_WRITE_ELEM) \ + static long THDiskFile_read##TYPEC(THFile *self, TYPE *data, long n) \ + { \ + THDiskFile *dfself = (THDiskFile*)(self); \ + long nread = 0L; \ + \ + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); \ + THArgCheck(dfself->file.isReadable, 1, "attempt to read in a write-only file"); \ + \ + if(dfself->file.isBinary) \ + { \ + nread = fread__(data, sizeof(TYPE), n, dfself->handle); \ + if(!dfself->isNativeEncoding && (sizeof(TYPE) > 1) && (nread > 0)) \ + THDiskFile_reverseMemory(data, data, sizeof(TYPE), nread); \ + } \ + else \ + { \ + long i; \ + for(i = 0; i < n; i++) \ + { \ + ASCII_READ_ELEM; /* increment here result and break if wrong */ \ + } \ + if(dfself->file.isAutoSpacing && (n > 0)) \ + { \ + int c = fgetc(dfself->handle); \ + if( (c != '\n') && (c != EOF) ) \ + ungetc(c, dfself->handle); \ + } \ + } \ + \ + if(nread != n) \ + { \ + dfself->file.hasError = 1; /* shouldn't we put hasError to 0 all the time ? */ \ + if(!dfself->file.isQuiet) \ + THError("read error: read %d blocks instead of %d", nread, n); \ + } \ + \ + return nread; \ + } \ + \ + static long THDiskFile_write##TYPEC(THFile *self, TYPE *data, long n) \ + { \ + THDiskFile *dfself = (THDiskFile*)(self); \ + long nwrite = 0L; \ + \ + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); \ + THArgCheck(dfself->file.isWritable, 1, "attempt to write in a read-only file"); \ + \ + if(dfself->file.isBinary) \ + { \ + if(dfself->isNativeEncoding) \ + { \ + nwrite = fwrite(data, sizeof(TYPE), n, dfself->handle); \ + } \ + else \ + { \ + if(sizeof(TYPE) > 1) \ + { \ + char *buffer = (char*)THAlloc(sizeof(TYPE)*n); \ + THDiskFile_reverseMemory(buffer, data, sizeof(TYPE), n); \ + nwrite = fwrite(buffer, sizeof(TYPE), n, dfself->handle); \ + THFree(buffer); \ + } \ + else \ + nwrite = fwrite(data, sizeof(TYPE), n, dfself->handle); \ + } \ + } \ + else \ + { \ + long i; \ + for(i = 0; i < n; i++) \ + { \ + ASCII_WRITE_ELEM; \ + if( dfself->file.isAutoSpacing && (i < n-1) ) \ + fprintf(dfself->handle, " "); \ + } \ + if(dfself->file.isAutoSpacing && (n > 0)) \ + fprintf(dfself->handle, "\n"); \ + } \ + \ + if(nwrite != n) \ + { \ + dfself->file.hasError = 1; \ + if(!dfself->file.isQuiet) \ + THError("write error: wrote %d blocks instead of %d", nwrite, n); \ + } \ + \ + return nwrite; \ +} + +static int THDiskFile_mode(const char *mode, int *isReadable, int *isWritable) +{ + *isReadable = 0; + *isWritable = 0; + if(strlen(mode) == 1) + { + if(*mode == 'r') + { + *isReadable = 1; + return 1; + } + else if(*mode == 'w') + { + *isWritable = 1; + return 1; + } + } + else if(strlen(mode) == 2) + { + if(mode[0] == 'r' && mode[1] == 'w') + { + *isReadable = 1; + *isWritable = 1; + return 1; + } + } + return 0; +} + +static void THDiskFile_synchronize(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + fflush(dfself->handle); +} + +static void THDiskFile_seek(THFile *self, long position) +{ + THDiskFile *dfself = (THDiskFile*)(self); + + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + +#if defined(_WIN64) + THArgCheck(position <= (_int64)INT64_MAX, 2, "position must be smaller than INT64_MAX"); + if(_fseeki64(dfself->handle, (__int64)position, SEEK_SET) < 0) +#elif defined(_WIN32) + THArgCheck(position <= (long)LONG_MAX, 2, "position must be smaller than LONG_MAX"); + if(fseek(dfself->handle, (long)position, SEEK_SET) < 0) +#else + THArgCheck(position <= (long)LLONG_MAX, 2, "position must be smaller than LLONG_MAX"); + if(fseeko(dfself->handle, (off_t)position, SEEK_SET) < 0) +#endif + { + dfself->file.hasError = 1; + if(!dfself->file.isQuiet) + THError("unable to seek at position %d", position); + } +} + +static void THDiskFile_seekEnd(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + +#if defined(_WIN64) + if(_fseeki64(dfself->handle, 0L, SEEK_END) < 0) +#elif defined(_WIN32) + if(fseek(dfself->handle, 0L, SEEK_END) < 0) +#else + if(fseeko(dfself->handle, 0L, SEEK_END) < 0) +#endif + { + dfself->file.hasError = 1; + if(!dfself->file.isQuiet) + THError("unable to seek at end of file"); + } +} + +static long THDiskFile_position(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + +#if defined(_WIN64) + __int64 offset = _ftelli64(dfself->handle); +#elif defined(_WIN32) + long offset = ftell(dfself->handle); +#else + off_t offset = ftello(dfself->handle); +#endif + if (offset > -1) + return (long)offset; + else if(!dfself->file.isQuiet) + THError("unable to obtain disk file offset (maybe a long overflow occurred)"); + + return 0; +} + +static void THDiskFile_close(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + fclose(dfself->handle); + dfself->handle = NULL; +} + +/* Little and Big Endian */ + +static void THDiskFile_reverseMemory(void *dst, const void *src, long blockSize, long numBlocks) +{ + if(blockSize != 1) + { + long halfBlockSize = blockSize/2; + char *charSrc = (char*)src; + char *charDst = (char*)dst; + long b, i; + for(b = 0; b < numBlocks; b++) + { + for(i = 0; i < halfBlockSize; i++) + { + char z = charSrc[i]; + charDst[i] = charSrc[blockSize-1-i]; + charDst[blockSize-1-i] = z; + } + charSrc += blockSize; + charDst += blockSize; + } + } +} + +int THDiskFile_isLittleEndianCPU(void) +{ + int x = 7; + char *ptr = (char *)&x; + + if(ptr[0] == 0) + return 0; + else + return 1; +} + +int THDiskFile_isBigEndianCPU(void) +{ + return(!THDiskFile_isLittleEndianCPU()); +} + +void THDiskFile_nativeEndianEncoding(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + dfself->isNativeEncoding = 1; +} + +void THDiskFile_littleEndianEncoding(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + dfself->isNativeEncoding = THDiskFile_isLittleEndianCPU(); +} + +void THDiskFile_bigEndianEncoding(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + dfself->isNativeEncoding = !THDiskFile_isLittleEndianCPU(); +} + +/* End of Little and Big Endian Stuff */ + +void THDiskFile_longSize(THFile *self, int size) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + THArgCheck(size == 0 || size == 4 || size == 8, 1, "Invalid long size specified"); + dfself->longSize = size; +} + +void THDiskFile_noBuffer(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + if (setvbuf(dfself->handle, NULL, _IONBF, 0)) { + THError("error: cannot disable buffer"); + } +} + +static void THDiskFile_free(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + if(dfself->handle) + fclose(dfself->handle); + THFree(dfself->name); + THFree(dfself); +} + +/* READ_WRITE_METHODS(int, Bool, */ +/* int value = 0; int ret = fscanf(file->handle, "%d", &value); array[i] = (value ? 1 : 0); if(ret <= 0) break; else result++, */ +/* int value = (array[i] ? 1 : 0); nElemWritten = fprintf(file->handle, "%d", value), */ +/* true) */ + +/* Note that we do a trick */ +READ_WRITE_METHODS(unsigned char, Byte, + nread = fread(data, 1, n, dfself->handle); break, + nwrite = fwrite(data, 1, n, dfself->handle); break) + +READ_WRITE_METHODS(char, Char, + nread = fread(data, 1, n, dfself->handle); break, + nwrite = fwrite(data, 1, n, dfself->handle); break) + +READ_WRITE_METHODS(short, Short, + int ret = fscanf(dfself->handle, "%hd", &data[i]); if(ret <= 0) break; else nread++, + int ret = fprintf(dfself->handle, "%hd", data[i]); if(ret <= 0) break; else nwrite++) + +READ_WRITE_METHODS(int, Int, + int ret = fscanf(dfself->handle, "%d\n\r", &data[i]); if(ret <= 0) break; else nread++, + int ret = fprintf(dfself->handle, "%d", data[i]); if(ret <= 0) break; else nwrite++) + +/*READ_WRITE_METHODS(long, Long, + int ret = fscanf(dfself->handle, "%ld", &data[i]); if(ret <= 0) break; else nread++, + int ret = fprintf(dfself->handle, "%ld", data[i]); if(ret <= 0) break; else nwrite++)*/ + +READ_WRITE_METHODS(float, Float, + int ret = fscanf(dfself->handle, "%g", &data[i]); if(ret <= 0) break; else nread++, + int ret = fprintf(dfself->handle, "%.9g", data[i]); if(ret <= 0) break; else nwrite++) + +READ_WRITE_METHODS(double, Double, + int ret = fscanf(dfself->handle, "%lg", &data[i]); if(ret <= 0) break; else nread++, + int ret = fprintf(dfself->handle, "%.17g", data[i]); if(ret <= 0) break; else nwrite++) + + +/* For Long we need to rewrite everything, because of the special management of longSize */ +static long THDiskFile_readLong(THFile *self, int64 *data, long n) +{ + THDiskFile *dfself = (THDiskFile*)(self); + long nread = 0L; + + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + THArgCheck(dfself->file.isReadable, 1, "attempt to read in a write-only file"); + + if(dfself->file.isBinary) + { + if(dfself->longSize == 0 || dfself->longSize == sizeof(int64)) + { + nread = fread__(data, sizeof(int64), n, dfself->handle); + if(!dfself->isNativeEncoding && (sizeof(int64) > 1) && (nread > 0)) + THDiskFile_reverseMemory(data, data, sizeof(int64), nread); + } else if(dfself->longSize == 4) + { + nread = fread__(data, 4, n, dfself->handle); + if(!dfself->isNativeEncoding && (nread > 0)) + THDiskFile_reverseMemory(data, data, 4, nread); + long i; + for(i = nread; i > 0; i--) + data[i-1] = ((int *)data)[i-1]; + } + else /* if(dfself->longSize == 8) */ + { + int big_endian = !THDiskFile_isLittleEndianCPU(); + int32_t *buffer = (int32_t*)THAlloc(8*n); + nread = fread__(buffer, 8, n, dfself->handle); + long i; + for(i = nread; i > 0; i--) + data[i-1] = buffer[2*(i-1) + big_endian]; + THFree(buffer); + if(!dfself->isNativeEncoding && (nread > 0)) + THDiskFile_reverseMemory(data, data, 4, nread); + } + } + else + { + long i; + for(i = 0; i < n; i++) + { + long d; + int ret = fscanf(dfself->handle, "%ld", &d); if(ret <= 0) break; else nread++; + data[i] = d; + } + if(dfself->file.isAutoSpacing && (n > 0)) + { + int c = fgetc(dfself->handle); + if( (c != '\n') && (c != EOF) ) + ungetc(c, dfself->handle); + } + } + + if(nread != n) + { + dfself->file.hasError = 1; /* shouldn't we put hasError to 0 all the time ? */ + if(!dfself->file.isQuiet) + THError("read error: read %d blocks instead of %d", nread, n); + } + + return nread; +} + +static long THDiskFile_writeLong(THFile *self, int64 *data, long n) +{ + THDiskFile *dfself = (THDiskFile*)(self); + long nwrite = 0L; + + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + THArgCheck(dfself->file.isWritable, 1, "attempt to write in a read-only file"); + + if(dfself->file.isBinary) + { + if(dfself->longSize == 0 || dfself->longSize == sizeof(long)) + { + if(dfself->isNativeEncoding) + { + nwrite = fwrite(data, sizeof(long), n, dfself->handle); + } + else + { + char *buffer = (char*)THAlloc(sizeof(long)*n); + THDiskFile_reverseMemory(buffer, data, sizeof(long), n); + nwrite = fwrite(buffer, sizeof(long), n, dfself->handle); + THFree(buffer); + } + } else if(dfself->longSize == 4) + { + int32_t *buffer = (int32_t *)THAlloc(4*n); + long i; + for(i = 0; i < n; i++) + buffer[i] = data[i]; + if(!dfself->isNativeEncoding) + THDiskFile_reverseMemory(buffer, buffer, 4, n); + nwrite = fwrite(buffer, 4, n, dfself->handle); + THFree(buffer); + } + else /* if(dfself->longSize == 8) */ + { + int big_endian = !THDiskFile_isLittleEndianCPU(); + int32_t *buffer = (int32_t*)THAlloc(8*n); + long i; + for(i = 0; i < n; i++) + { + buffer[2*i + !big_endian] = 0; + buffer[2*i + big_endian] = data[i]; + } + if(!dfself->isNativeEncoding) + THDiskFile_reverseMemory(buffer, buffer, 8, n); + nwrite = fwrite(buffer, 8, n, dfself->handle); + THFree(buffer); + } + } + else + { + long i; + for(i = 0; i < n; i++) + { + long res = 0; + int ret = fprintf(dfself->handle, "%ld", res); data[i] = res; if(ret <= 0) break; else nwrite++; + if( dfself->file.isAutoSpacing && (i < n-1) ) + fprintf(dfself->handle, " "); + } + if(dfself->file.isAutoSpacing && (n > 0)) + fprintf(dfself->handle, "\n"); + } + + if(nwrite != n) + { + dfself->file.hasError = 1; + if(!dfself->file.isQuiet) + THError("write error: wrote %d blocks instead of %d", nwrite, n); + } + + return nwrite; +} + +static long THDiskFile_readString(THFile *self, const char *format, char **str_) +{ + THDiskFile *dfself = (THDiskFile*)(self); + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + THArgCheck(dfself->file.isReadable, 1, "attempt to read in a write-only file"); + THArgCheck((strlen(format) >= 2 ? (format[0] == '*') && (format[1] == 'a' || format[1] == 'l') : 0), 2, "format must be '*a' or '*l'"); + +/* note: the string won't survive long, as it is copied into lua */ +/* so 1024 is not that big... */ +#define TBRS_BSZ 1024L + + if(format[1] == 'a') + { + char *p = (char*)THAlloc(TBRS_BSZ); + long total = TBRS_BSZ; + long pos = 0L; + + for (;;) + { + if(total-pos == 0) /* we need more space! */ + { + total += TBRS_BSZ; + p = (char*)THRealloc(p, total); + } + pos += fread(p+pos, 1, total-pos, dfself->handle); + if (pos < total) /* eof? */ + { + if(pos == 0L) + { + THFree(p); + dfself->file.hasError = 1; + if(!dfself->file.isQuiet) + THError("read error: read 0 blocks instead of 1"); + + *str_ = NULL; + return 0; + } + *str_ = p; + return pos; + } + } + } + else + { + char *p = (char*)THAlloc(TBRS_BSZ); + long total = TBRS_BSZ; + long pos = 0L; + long size; + + for (;;) + { + if(total-pos <= 1) /* we can only write '\0' in there! */ + { + total += TBRS_BSZ; + p = (char*)THRealloc(p, total); + } + if (fgets(p+pos, total-pos, dfself->handle) == NULL) /* eof? */ + { + if(pos == 0L) + { + THFree(p); + dfself->file.hasError = 1; + if(!dfself->file.isQuiet) + THError("read error: read 0 blocks instead of 1"); + + *str_ = NULL; + return 0; + } + *str_ = p; + return pos; + } + size = strlen(p+pos); + if (size == 0L || (p+pos)[size-1] != '\n') + { + pos += size; + } + else + { + pos += size-1L; /* do not include `eol' */ + *str_ = p; + return pos; + } + } + } + + *str_ = NULL; + return 0; +} + + +static long THDiskFile_writeString(THFile *self, const char *str, long size) +{ + THDiskFile *dfself = (THDiskFile*)(self); + long nwrite; + + THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file"); + THArgCheck(dfself->file.isWritable, 1, "attempt to write in a read-only file"); + + nwrite = fwrite(str, 1, size, dfself->handle); + if(nwrite != size) + { + dfself->file.hasError = 1; + if(!dfself->file.isQuiet) + THError("write error: wrote %ld blocks instead of %ld", nwrite, size); + } + + return nwrite; +} + +THFile *THDiskFile_new(const char *name, const char *mode, int isQuiet) +{ + static struct THFileVTable vtable = { + THDiskFile_isOpened, + + THDiskFile_readByte, + THDiskFile_readChar, + THDiskFile_readShort, + THDiskFile_readInt, + THDiskFile_readLong, + THDiskFile_readFloat, + THDiskFile_readDouble, + THDiskFile_readString, + + THDiskFile_writeByte, + THDiskFile_writeChar, + THDiskFile_writeShort, + THDiskFile_writeInt, + THDiskFile_writeLong, + THDiskFile_writeFloat, + THDiskFile_writeDouble, + THDiskFile_writeString, + + THDiskFile_synchronize, + THDiskFile_seek, + THDiskFile_seekEnd, + THDiskFile_position, + THDiskFile_close, + THDiskFile_free + }; + + int isReadable; + int isWritable; + FILE *handle; + THDiskFile *self; + + THArgCheck(THDiskFile_mode(mode, &isReadable, &isWritable), 2, "file mode should be 'r','w' or 'rw'"); + + if( isReadable && isWritable ) + { + handle = fopen(name, "r+b"); + if(!handle) + { + handle = fopen(name, "wb"); + if(handle) + { + fclose(handle); + handle = fopen(name, "r+b"); + } + } + } + else + handle = fopen(name, (isReadable ? "rb" : "wb")); + + if(!handle) + { + if(isQuiet) + return 0; + else + THError("cannot open <%s> in mode %c%c", name, (isReadable ? 'r' : ' '), (isWritable ? 'w' : ' ')); + } + + self = (THDiskFile*)THAlloc(sizeof(THDiskFile)); + + self->handle = handle; + self->name = (char*)THAlloc(strlen(name)+1); + strcpy(self->name, name); + self->isNativeEncoding = 1; + self->longSize = 0; + + self->file.vtable = &vtable; + self->file.isQuiet = isQuiet; + self->file.isReadable = isReadable; + self->file.isWritable = isWritable; + self->file.isBinary = 0; + self->file.isAutoSpacing = 1; + self->file.hasError = 0; + + return (THFile*)self; +} + +/* PipeFile */ + +static int THPipeFile_mode(const char *mode, int *isReadable, int *isWritable) +{ + *isReadable = 0; + *isWritable = 0; + if(strlen(mode) == 1) + { + if(*mode == 'r') + { + *isReadable = 1; + return 1; + } + else if(*mode == 'w') + { + *isWritable = 1; + return 1; + } + } + return 0; +} + +static void THPipeFile_free(THFile *self) +{ + THDiskFile *dfself = (THDiskFile*)(self); + if(dfself->handle) + pclose(dfself->handle); + THFree(dfself->name); + THFree(dfself); +} + +THFile *THPipeFile_new(const char *name, const char *mode, int isQuiet) +{ + static struct THFileVTable vtable = { + THDiskFile_isOpened, + + THDiskFile_readByte, + THDiskFile_readChar, + THDiskFile_readShort, + THDiskFile_readInt, + THDiskFile_readLong, + THDiskFile_readFloat, + THDiskFile_readDouble, + THDiskFile_readString, + + THDiskFile_writeByte, + THDiskFile_writeChar, + THDiskFile_writeShort, + THDiskFile_writeInt, + THDiskFile_writeLong, + THDiskFile_writeFloat, + THDiskFile_writeDouble, + THDiskFile_writeString, + + THDiskFile_synchronize, + THDiskFile_seek, + THDiskFile_seekEnd, + THDiskFile_position, + THDiskFile_close, + THPipeFile_free + }; + + int isReadable; + int isWritable; + FILE *handle; + THDiskFile *self; + + THArgCheck(THPipeFile_mode(mode, &isReadable, &isWritable), 2, "file mode should be 'r','w'"); + +#ifdef _WIN32 + handle = popen(name, (isReadable ? "rb" : "wb")); +#else + handle = popen(name, (isReadable ? "r" : "w")); +#endif + + if(!handle) + { + if(isQuiet) + return 0; + else + THError("cannot open <%s> in mode %c%c", name, (isReadable ? 'r' : ' '), (isWritable ? 'w' : ' ')); + } + + self = (THDiskFile*)THAlloc(sizeof(THDiskFile)); + + self->handle = handle; + self->name = (char*)THAlloc(strlen(name)+1); + strcpy(self->name, name); + self->isNativeEncoding = 1; + self->longSize = 0; + + self->file.vtable = &vtable; + self->file.isQuiet = isQuiet; + self->file.isReadable = isReadable; + self->file.isWritable = isWritable; + self->file.isBinary = 0; + self->file.isAutoSpacing = 1; + self->file.hasError = 0; + + return (THFile*)self; +} + +} +#endif diff --git a/modules/dnn/src/torch/THDiskFile.h b/modules/dnn/src/torch/THDiskFile.h new file mode 100644 index 0000000000..bc5c001c74 --- /dev/null +++ b/modules/dnn/src/torch/THDiskFile.h @@ -0,0 +1,19 @@ +#ifndef TH_DISK_FILE_INC +#define TH_DISK_FILE_INC + +#include "THFile.h" + +TH_API THFile *THDiskFile_new(const char *name, const char *mode, int isQuiet); +TH_API THFile *THPipeFile_new(const char *name, const char *mode, int isQuiet); + +TH_API const char *THDiskFile_name(THFile *self); + +TH_API int THDiskFile_isLittleEndianCPU(void); +TH_API int THDiskFile_isBigEndianCPU(void); +TH_API void THDiskFile_nativeEndianEncoding(THFile *self); +TH_API void THDiskFile_littleEndianEncoding(THFile *self); +TH_API void THDiskFile_bigEndianEncoding(THFile *self); +TH_API void THDiskFile_longSize(THFile *self, int size); +TH_API void THDiskFile_noBuffer(THFile *self); + +#endif diff --git a/modules/dnn/src/torch/THFile.cpp b/modules/dnn/src/torch/THFile.cpp new file mode 100644 index 0000000000..9e055105ce --- /dev/null +++ b/modules/dnn/src/torch/THFile.cpp @@ -0,0 +1,163 @@ +#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER +#include "THFile.h" +#include "THFilePrivate.h" +#include +extern "C" +{ + +#define IMPLEMENT_THFILE_RW(TYPEC, TYPE) \ + long THFile_read##TYPEC##Raw(THFile *self, TYPE *data, long n) \ + { \ + return (*self->vtable->read##TYPEC)(self, data, n); \ + } \ + \ + long THFile_write##TYPEC##Raw(THFile *self, TYPE *data, long n) \ + { \ + return (*self->vtable->write##TYPEC)(self, data, n); \ + } + +IMPLEMENT_THFILE_RW(Byte, unsigned char) +IMPLEMENT_THFILE_RW(Char, char) +IMPLEMENT_THFILE_RW(Short, short) +IMPLEMENT_THFILE_RW(Int, int) +IMPLEMENT_THFILE_RW(Long, int64) +IMPLEMENT_THFILE_RW(Float, float) +IMPLEMENT_THFILE_RW(Double, double) + +long THFile_readStringRaw(THFile *self, const char *format, char **str_) +{ + return self->vtable->readString(self, format, str_); +} + +long THFile_writeStringRaw(THFile *self, const char *str, long size) +{ + return self->vtable->writeString(self, str, size); +} + +void THFile_synchronize(THFile *self) +{ + self->vtable->synchronize(self); +} + +void THFile_seek(THFile *self, long position) +{ + self->vtable->seek(self, position); +} + +void THFile_seekEnd(THFile *self) +{ + self->vtable->seekEnd(self); +} + +long THFile_position(THFile *self) +{ + return self->vtable->position(self); +} + +void THFile_close(THFile *self) +{ + self->vtable->close(self); +} + +void THFile_free(THFile *self) +{ + self->vtable->free(self); +} + +int THFile_isOpened(THFile *self) +{ + return self->vtable->isOpened(self); +} + +#define IMPLEMENT_THFILE_FLAGS(FLAG) \ + int THFile_##FLAG(THFile *self) \ + { \ + return self->FLAG; \ + } + +IMPLEMENT_THFILE_FLAGS(isQuiet) +IMPLEMENT_THFILE_FLAGS(isReadable) +IMPLEMENT_THFILE_FLAGS(isWritable) +IMPLEMENT_THFILE_FLAGS(isBinary) +IMPLEMENT_THFILE_FLAGS(isAutoSpacing) +IMPLEMENT_THFILE_FLAGS(hasError) + +void THFile_binary(THFile *self) +{ + self->isBinary = 1; +} + +void THFile_ascii(THFile *self) +{ + self->isBinary = 0; +} + +void THFile_autoSpacing(THFile *self) +{ + self->isAutoSpacing = 1; +} + +void THFile_noAutoSpacing(THFile *self) +{ + self->isAutoSpacing = 0; +} + +void THFile_quiet(THFile *self) +{ + self->isQuiet = 1; +} + +void THFile_pedantic(THFile *self) +{ + self->isQuiet = 0; +} + +void THFile_clearError(THFile *self) +{ + self->hasError = 0; +} + +#define IMPLEMENT_THFILE_SCALAR(TYPEC, TYPE) \ + TYPE THFile_read##TYPEC##Scalar(THFile *self) \ + { \ + TYPE scalar; \ + THFile_read##TYPEC##Raw(self, &scalar, 1); \ + return scalar; \ + } \ + \ + void THFile_write##TYPEC##Scalar(THFile *self, TYPE scalar) \ + { \ + THFile_write##TYPEC##Raw(self, &scalar, 1); \ + } + +IMPLEMENT_THFILE_SCALAR(Byte, unsigned char) +IMPLEMENT_THFILE_SCALAR(Char, char) +IMPLEMENT_THFILE_SCALAR(Short, short) +IMPLEMENT_THFILE_SCALAR(Int, int) +IMPLEMENT_THFILE_SCALAR(Long, int64) +IMPLEMENT_THFILE_SCALAR(Float, float) +IMPLEMENT_THFILE_SCALAR(Double, double) + +/* +#define IMPLEMENT_THFILE_STORAGE(TYPEC, TYPE) \ + long THFile_read##TYPEC(THFile *self, TH##TYPEC##Storage *storage) \ + { \ + return THFile_read##TYPEC##Raw(self, storage->data, storage->size); \ + } \ + \ + long THFile_write##TYPEC(THFile *self, TH##TYPEC##Storage *storage) \ + { \ + return THFile_write##TYPEC##Raw(self, storage->data, storage->size); \ + } + +IMPLEMENT_THFILE_STORAGE(Byte, unsigned char) +IMPLEMENT_THFILE_STORAGE(Char, char) +IMPLEMENT_THFILE_STORAGE(Short, short) +IMPLEMENT_THFILE_STORAGE(Int, int) +IMPLEMENT_THFILE_STORAGE(Long, long) +IMPLEMENT_THFILE_STORAGE(Float, float) +IMPLEMENT_THFILE_STORAGE(Double, double) +*/ + +} +#endif diff --git a/modules/dnn/src/torch/THFile.h b/modules/dnn/src/torch/THFile.h new file mode 100644 index 0000000000..de362150fe --- /dev/null +++ b/modules/dnn/src/torch/THFile.h @@ -0,0 +1,90 @@ +#ifndef TH_FILE_INC +#define TH_FILE_INC + +//#include "THStorage.h" +#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER +#include "THGeneral.h" +#include "opencv2/core/hal/interface.h" + +typedef struct THFile__ THFile; + +TH_API int THFile_isOpened(THFile *self); +TH_API int THFile_isQuiet(THFile *self); +TH_API int THFile_isReadable(THFile *self); +TH_API int THFile_isWritable(THFile *self); +TH_API int THFile_isBinary(THFile *self); +TH_API int THFile_isAutoSpacing(THFile *self); +TH_API int THFile_hasError(THFile *self); + +TH_API void THFile_binary(THFile *self); +TH_API void THFile_ascii(THFile *self); +TH_API void THFile_autoSpacing(THFile *self); +TH_API void THFile_noAutoSpacing(THFile *self); +TH_API void THFile_quiet(THFile *self); +TH_API void THFile_pedantic(THFile *self); +TH_API void THFile_clearError(THFile *self); + +/* scalar */ +TH_API unsigned char THFile_readByteScalar(THFile *self); +TH_API char THFile_readCharScalar(THFile *self); +TH_API short THFile_readShortScalar(THFile *self); +TH_API int THFile_readIntScalar(THFile *self); +TH_API int64 THFile_readLongScalar(THFile *self); +TH_API float THFile_readFloatScalar(THFile *self); +TH_API double THFile_readDoubleScalar(THFile *self); + +TH_API void THFile_writeByteScalar(THFile *self, unsigned char scalar); +TH_API void THFile_writeCharScalar(THFile *self, char scalar); +TH_API void THFile_writeShortScalar(THFile *self, short scalar); +TH_API void THFile_writeIntScalar(THFile *self, int scalar); +TH_API void THFile_writeLongScalar(THFile *self, int64 scalar); +TH_API void THFile_writeFloatScalar(THFile *self, float scalar); +TH_API void THFile_writeDoubleScalar(THFile *self, double scalar); + +/* storage */ +/* +TH_API long THFile_readByte(THFile *self, THByteStorage *storage); +TH_API long THFile_readChar(THFile *self, THCharStorage *storage); +TH_API long THFile_readShort(THFile *self, THShortStorage *storage); +TH_API long THFile_readInt(THFile *self, THIntStorage *storage); +TH_API long THFile_readLong(THFile *self, THLongStorage *storage); +TH_API long THFile_readFloat(THFile *self, THFloatStorage *storage); +TH_API long THFile_readDouble(THFile *self, THDoubleStorage *storage); + +TH_API long THFile_writeByte(THFile *self, THByteStorage *storage); +TH_API long THFile_writeChar(THFile *self, THCharStorage *storage); +TH_API long THFile_writeShort(THFile *self, THShortStorage *storage); +TH_API long THFile_writeInt(THFile *self, THIntStorage *storage); +TH_API long THFile_writeLong(THFile *self, THLongStorage *storage); +TH_API long THFile_writeFloat(THFile *self, THFloatStorage *storage); +TH_API long THFile_writeDouble(THFile *self, THDoubleStorage *storage); +*/ + +/* raw */ +TH_API long THFile_readByteRaw(THFile *self, unsigned char *data, long n); +TH_API long THFile_readCharRaw(THFile *self, char *data, long n); +TH_API long THFile_readShortRaw(THFile *self, short *data, long n); +TH_API long THFile_readIntRaw(THFile *self, int *data, long n); +TH_API long THFile_readLongRaw(THFile *self, int64 *data, long n); +TH_API long THFile_readFloatRaw(THFile *self, float *data, long n); +TH_API long THFile_readDoubleRaw(THFile *self, double *data, long n); +TH_API long THFile_readStringRaw(THFile *self, const char *format, char **str_); /* you must deallocate str_ */ + +TH_API long THFile_writeByteRaw(THFile *self, unsigned char *data, long n); +TH_API long THFile_writeCharRaw(THFile *self, char *data, long n); +TH_API long THFile_writeShortRaw(THFile *self, short *data, long n); +TH_API long THFile_writeIntRaw(THFile *self, int *data, long n); +TH_API long THFile_writeLongRaw(THFile *self, int64 *data, long n); +TH_API long THFile_writeFloatRaw(THFile *self, float *data, long n); +TH_API long THFile_writeDoubleRaw(THFile *self, double *data, long n); +TH_API long THFile_writeStringRaw(THFile *self, const char *str, long size); + +TH_API void THFile_synchronize(THFile *self); +TH_API void THFile_seek(THFile *self, long position); +TH_API void THFile_seekEnd(THFile *self); +TH_API long THFile_position(THFile *self); +TH_API void THFile_close(THFile *self); +TH_API void THFile_free(THFile *self); + +#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER +#endif //TH_FILE_INC diff --git a/modules/dnn/src/torch/THFilePrivate.h b/modules/dnn/src/torch/THFilePrivate.h new file mode 100644 index 0000000000..dbef9f7459 --- /dev/null +++ b/modules/dnn/src/torch/THFilePrivate.h @@ -0,0 +1,43 @@ +struct THFile__ +{ + struct THFileVTable *vtable; + + int isQuiet; + int isReadable; + int isWritable; + int isBinary; + int isAutoSpacing; + int hasError; +}; + +/* virtual table definition */ + +struct THFileVTable +{ + int (*isOpened)(THFile *self); + + long (*readByte)(THFile *self, unsigned char *data, long n); + long (*readChar)(THFile *self, char *data, long n); + long (*readShort)(THFile *self, short *data, long n); + long (*readInt)(THFile *self, int *data, long n); + long (*readLong)(THFile *self, int64 *data, long n); + long (*readFloat)(THFile *self, float *data, long n); + long (*readDouble)(THFile *self, double *data, long n); + long (*readString)(THFile *self, const char *format, char **str_); + + long (*writeByte)(THFile *self, unsigned char *data, long n); + long (*writeChar)(THFile *self, char *data, long n); + long (*writeShort)(THFile *self, short *data, long n); + long (*writeInt)(THFile *self, int *data, long n); + long (*writeLong)(THFile *self, int64 *data, long n); + long (*writeFloat)(THFile *self, float *data, long n); + long (*writeDouble)(THFile *self, double *data, long n); + long (*writeString)(THFile *self, const char *str, long size); + + void (*synchronize)(THFile *self); + void (*seek)(THFile *self, long position); + void (*seekEnd)(THFile *self); + long (*position)(THFile *self); + void (*close)(THFile *self); + void (*free)(THFile *self); +}; diff --git a/modules/dnn/src/torch/THGeneral.cpp b/modules/dnn/src/torch/THGeneral.cpp new file mode 100644 index 0000000000..1bf0b4f897 --- /dev/null +++ b/modules/dnn/src/torch/THGeneral.cpp @@ -0,0 +1,256 @@ +#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER +#include + +#if defined(TH_DISABLE_HEAP_TRACKING) +#elif (defined(__unix) || defined(_WIN32)) +#include +#elif defined(__APPLE__) +#include +#endif + +#include "THGeneral.h" + +extern "C" +{ + +#ifndef TH_HAVE_THREAD +#define __thread +#endif + +/* Torch Error Handling */ +static void defaultTorchErrorHandlerFunction(const char *msg, void*) +{ + CV_Error(cv::Error::StsError, cv::String("Torch Error: ") + msg); +} + +static __thread void (*torchErrorHandlerFunction)(const char *msg, void *data) = defaultTorchErrorHandlerFunction; +static __thread void *torchErrorHandlerData; + +void _THError(const char *file, const int line, const char *fmt, ...) +{ + char msg[2048]; + va_list args; + + /* vasprintf not standard */ + /* vsnprintf: how to handle if does not exists? */ + va_start(args, fmt); + int n = vsnprintf(msg, 2048, fmt, args); + va_end(args); + + if(n < 2048) { + snprintf(msg + n, 2048 - n, " at %s:%d", file, line); + } + + (*torchErrorHandlerFunction)(msg, torchErrorHandlerData); +} + +void _THAssertionFailed(const char *file, const int line, const char *exp, const char *fmt, ...) { + char msg[1024]; + va_list args; + va_start(args, fmt); + vsnprintf(msg, 1024, fmt, args); + va_end(args); + _THError(file, line, "Assertion `%s' failed. %s", exp, msg); +} + +void THSetErrorHandler( void (*torchErrorHandlerFunction_)(const char *msg, void *data), void *data ) +{ + if(torchErrorHandlerFunction_) + torchErrorHandlerFunction = torchErrorHandlerFunction_; + else + torchErrorHandlerFunction = defaultTorchErrorHandlerFunction; + torchErrorHandlerData = data; +} + +/* Torch Arg Checking Handling */ +static void defaultTorchArgErrorHandlerFunction(int argNumber, const char *msg, void*) +{ + if(msg) + CV_Error(cv::Error::StsError, cv::format("Torch invalid argument %d: %s", argNumber, msg)); + else + CV_Error(cv::Error::StsError, cv::format("Invalid argument %d", argNumber)); +} + +static __thread void (*torchArgErrorHandlerFunction)(int argNumber, const char *msg, void *data) = defaultTorchArgErrorHandlerFunction; +static __thread void *torchArgErrorHandlerData; + +void _THArgCheck(const char *file, int line, int condition, int argNumber, const char *fmt, ...) +{ + if(!condition) { + char msg[2048]; + va_list args; + + /* vasprintf not standard */ + /* vsnprintf: how to handle if does not exists? */ + va_start(args, fmt); + int n = vsnprintf(msg, 2048, fmt, args); + va_end(args); + + if(n < 2048) { + snprintf(msg + n, 2048 - n, " at %s:%d", file, line); + } + + (*torchArgErrorHandlerFunction)(argNumber, msg, torchArgErrorHandlerData); + } +} + +void THSetArgErrorHandler( void (*torchArgErrorHandlerFunction_)(int argNumber, const char *msg, void *data), void *data ) +{ + if(torchArgErrorHandlerFunction_) + torchArgErrorHandlerFunction = torchArgErrorHandlerFunction_; + else + torchArgErrorHandlerFunction = defaultTorchArgErrorHandlerFunction; + torchArgErrorHandlerData = data; +} + +static __thread void (*torchGCFunction)(void *data) = NULL; +static __thread void *torchGCData; +static __thread long torchHeapSize = 0; +static __thread long torchHeapSizeSoftMax = 300000000; // 300MB, adjusted upward dynamically + +/* Optional hook for integrating with a garbage-collected frontend. + * + * If torch is running with a garbage-collected frontend (e.g. Lua), + * the GC isn't aware of TH-allocated memory so may not know when it + * needs to run. These hooks trigger the GC to run in two cases: + * + * (1) When a memory allocation (malloc, realloc, ...) fails + * (2) When the total TH-allocated memory hits a dynamically-adjusted + * soft maximum. + */ +void THSetGCHandler( void (*torchGCFunction_)(void *data), void *data ) +{ + torchGCFunction = torchGCFunction_; + torchGCData = data; +} + +static long getAllocSize(void *ptr) { +#if defined(TH_DISABLE_HEAP_TRACKING) + return 0; +#elif defined(__unix) + return malloc_usable_size(ptr); +#elif defined(__APPLE__) + return malloc_size(ptr); +#elif defined(_WIN32) + return _msize(ptr); +#else + return 0; +#endif +} + +/* (1) if the torch-allocated heap size exceeds the soft max, run GC + * (2) if post-GC heap size exceeds 80% of the soft max, increase the + * soft max by 40% + */ +static void maybeTriggerGC() { + if(torchGCFunction && torchHeapSize > torchHeapSizeSoftMax) { + torchGCFunction(torchGCData); + if(torchHeapSize > torchHeapSizeSoftMax * 0.8) { + torchHeapSizeSoftMax = torchHeapSizeSoftMax * 1.4; + } + } +} + +// hooks into the TH heap tracking +void THHeapUpdate(long size) { + torchHeapSize += size; + if (size > 0) + maybeTriggerGC(); +} + +static void* THAllocInternal(long size) +{ + void *ptr; + + if (size > 5120) + { +#if (defined(__unix) || defined(__APPLE__)) && (!defined(DISABLE_POSIX_MEMALIGN)) + if (posix_memalign(&ptr, 64, size) != 0) + ptr = NULL; +/* +#elif defined(_WIN32) + ptr = _aligned_malloc(size, 64); +*/ +#else + ptr = malloc(size); +#endif + } + else + { + ptr = malloc(size); + } + + THHeapUpdate(getAllocSize(ptr)); + return ptr; +} + +void* THAlloc(long size) +{ + void *ptr; + + if(size < 0) + THError("$ Torch: invalid memory size -- maybe an overflow?"); + + if(size == 0) + return NULL; + + ptr = THAllocInternal(size); + + if(!ptr && torchGCFunction) { + torchGCFunction(torchGCData); + ptr = THAllocInternal(size); + } + + if(!ptr) + THError("$ Torch: not enough memory: you tried to allocate %dGB. Buy new RAM!", size/1073741824); + + return ptr; +} + +void* THRealloc(void *ptr, long size) +{ + if(!ptr) + return(THAlloc(size)); + + if(size == 0) + { + THFree(ptr); + return NULL; + } + + if(size < 0) + THError("$ Torch: invalid memory size -- maybe an overflow?"); + + THHeapUpdate(-getAllocSize(ptr)); + void *newptr = realloc(ptr, size); + + if(!newptr && torchGCFunction) { + torchGCFunction(torchGCData); + newptr = realloc(ptr, size); + } + THHeapUpdate(getAllocSize(newptr ? newptr : ptr)); + + if(!newptr) + THError("$ Torch: not enough memory: you tried to reallocate %dGB. Buy new RAM!", size/1073741824); + + return newptr; +} + +void THFree(void *ptr) +{ + THHeapUpdate(-getAllocSize(ptr)); + free(ptr); +} + +double THLog1p(const double x) +{ +#if (defined(_MSC_VER) || defined(__MINGW32__)) + volatile double y = 1 + x; + return log(y) - ((y-1)-x)/y ; /* cancels errors with IEEE arithmetic */ +#else + return log1p(x); +#endif +} + +} +#endif diff --git a/modules/dnn/src/torch/THGeneral.h b/modules/dnn/src/torch/THGeneral.h new file mode 100644 index 0000000000..8d33ede382 --- /dev/null +++ b/modules/dnn/src/torch/THGeneral.h @@ -0,0 +1,89 @@ +#ifndef TH_GENERAL_INC +#define TH_GENERAL_INC + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +# define TH_EXTERNC extern "C" +#else +# define TH_EXTERNC extern +#endif + +#define TH_API TH_EXTERNC + +#define THInf DBL_MAX + +//#define TH_INLINE @TH_INLINE@ + +#ifndef __cplusplus +//#define inline @TH_INLINE@ +#endif + +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + +TH_API double THLog1p(const double x); +TH_API void _THError(const char *file, const int line, const char *fmt, ...); +TH_API void _THAssertionFailed(const char *file, const int line, const char *exp, const char *fmt, ...); +TH_API void THSetErrorHandler( void (*torchErrorHandlerFunction)(const char *msg, void *data), void *data ); +TH_API void _THArgCheck(const char *file, int line, int condition, int argNumber, const char *fmt, ...); +TH_API void THSetArgErrorHandler( void (*torchArgErrorHandlerFunction)(int argNumber, const char *msg, void *data), void *data ); +TH_API void* THAlloc(long size); +TH_API void* THRealloc(void *ptr, long size); +TH_API void THFree(void *ptr); +TH_API void THSetGCHandler( void (*torchGCHandlerFunction)(void *data), void *data ); +// this hook should only be called by custom allocator functions +TH_API void THHeapUpdate(long size); + +#define THError(...) _THError(__FILE__, __LINE__, __VA_ARGS__) +#define THArgCheck(...) _THArgCheck(__FILE__, __LINE__, __VA_ARGS__) +#define THAssert(exp) \ +do { \ + if (!(exp)) { \ + _THAssertionFailed(__FILE__, __LINE__, #exp, ""); \ + } \ +} while(0) +#define THAssertMsg(exp, ...) \ +do { \ + if (!(exp)) { \ + _THAssertionFailed(__FILE__, __LINE__, #exp, __VA_ARGS__); \ + } \ +} while(0) + +#define TH_CONCAT_STRING_2(x,y) TH_CONCAT_STRING_2_EXPAND(x,y) +#define TH_CONCAT_STRING_2_EXPAND(x,y) #x #y + +#define TH_CONCAT_STRING_3(x,y,z) TH_CONCAT_STRING_3_EXPAND(x,y,z) +#define TH_CONCAT_STRING_3_EXPAND(x,y,z) #x #y #z + +#define TH_CONCAT_STRING_4(x,y,z,w) TH_CONCAT_STRING_4_EXPAND(x,y,z,w) +#define TH_CONCAT_STRING_4_EXPAND(x,y,z,w) #x #y #z #w + +#define TH_CONCAT_2(x,y) TH_CONCAT_2_EXPAND(x,y) +#define TH_CONCAT_2_EXPAND(x,y) x ## y + +#define TH_CONCAT_3(x,y,z) TH_CONCAT_3_EXPAND(x,y,z) +#define TH_CONCAT_3_EXPAND(x,y,z) x ## y ## z + +#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w +#define TH_CONCAT_4(x,y,z,w) TH_CONCAT_4_EXPAND(x,y,z,w) + +#define THMin(X, Y) ((X) < (Y) ? (X) : (Y)) +#define THMax(X, Y) ((X) > (Y) ? (X) : (Y)) + +#if (defined(_MSC_VER) || defined(__MINGW32__)) +# define log1p(x) THLog1p(x) +#define snprintf _snprintf +#define popen _popen +#define pclose _pclose +#endif + +#endif diff --git a/modules/dnn/src/torch/torch_importer.cpp b/modules/dnn/src/torch/torch_importer.cpp new file mode 100644 index 0000000000..02e936d314 --- /dev/null +++ b/modules/dnn/src/torch/torch_importer.cpp @@ -0,0 +1,1025 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "../precomp.hpp" +#include +#include +#include +#include +#include +#include + +namespace cv { +namespace dnn { +#if defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER +#include "THDiskFile.h" + +//#ifdef NDEBUG +static bool dbgPrint = false; +//#else +//static bool dbgPrint = true; +//#endif + +enum LuaType +{ + TYPE_NIL = 0, + TYPE_NUMBER = 1, + TYPE_STRING = 2, + TYPE_TABLE = 3, + TYPE_TORCH = 4, + TYPE_BOOLEAN = 5, + TYPE_FUNCTION = 6, + TYPE_RECUR_FUNCTION = 8, + LEGACY_TYPE_RECUR_FUNCTION = 7 +}; + +template +static String toString(const T &v) +{ + std::ostringstream ss; + ss << v; + return ss.str(); +} + +static inline bool startsWith(const String &str, const char *substr) +{ + return str.find(substr) == 0; +} + +static inline bool endsWith(const String &str, const char *substr) +{ + return str.rfind(substr) == str.length() - strlen(substr); +} + +struct TorchImporter : public ::cv::dnn::Importer +{ + typedef std::map > TensorsMap; + Net net; + + THFile *file; + std::set readedIndexes; + std::map storages; + std::map tensors; + + struct Module + { + String thName, apiType; + dnn::LayerParams params; + std::vector > modules; + + Module(const String &_thName, const String &_apiType = String()) + : thName(_thName), apiType(_apiType) {} + }; + + Module *rootModule; + Module *curModule; + int moduleCounter; + + TorchImporter(String filename, bool isBinary) + { + rootModule = curModule = NULL; + moduleCounter = 0; + + file = THDiskFile_new(filename.c_str(), "r", 0); + CV_Assert(file && THFile_isOpened(file)); + + if (isBinary) + THFile_binary(file); + else + THFile_ascii(file); + } + + /* Simple readers */ + + inline int readInt() + { + return THFile_readIntScalar(file); + } + + inline long readLong() + { + return THFile_readLongScalar(file); + } + + inline bool readBool() + { + return readInt() != 0; + } + + inline double readDouble() + { + return THFile_readDoubleScalar(file); + } + + inline String readString() + { + int size = THFile_readIntScalar(file); + String str(size, '\0'); + THFile_readCharRaw(file, const_cast(str.c_str()), size); + return str; + } + + inline String readTorchClassName() + { + String version = readString(); + return startsWith(version, "V ") ? readString() : version; + } + + inline void readFunction() + { + readString(); + readObject(); + } + + void readTable(int index = -1) + { + index = (index < 0) ? readInt() : index; + + if (readedIndexes.count(index)) + return; + + readedIndexes.insert(index); + + int size = readInt(); + + for (int i = 0; i < size; i++) + { + readObject(); //key + readObject(); //value + } + } + + /* Special readers */ + + static inline int parseTorchType(const String &str, const char *suffix, const char *prefix = "torch.") + { + if (startsWith(str, prefix) && endsWith(str, suffix)) + { + String typeStr = str.substr(strlen(prefix), str.length() - strlen(prefix) - strlen(suffix)); + + if (typeStr == "Double") + return CV_64F; + else if (typeStr == "Float" || typeStr == "Cuda") + return CV_32F; + else if (typeStr == "Byte") + return CV_8U; + else if (typeStr == "Char") + return CV_8S; + else if (typeStr == "Short") + return CV_16S; + else if (typeStr == "Int") + return CV_32S; + else if (typeStr == "Long") //Carefully! CV_64S type coded as CV_USRTYPE1 + return CV_USRTYPE1; + else + CV_Error(Error::StsNotImplemented, "Unknown type \"" + typeStr + "\" of torch class \"" + str + "\""); + } + + return -1; + } + + static int parseTensorType(const String &className) + { + return parseTorchType(className, "Tensor"); + } + + static int parseStorageType(const String &className) + { + return parseTorchType(className, "Storage"); + } + + void readTorchStorage(int index, int type = -1) + { + long size = readLong(); + Mat storageMat(1, size, (type != CV_USRTYPE1) ? type : CV_64F); //handle LongStorage as CV_64F Mat + + switch (type) + { + case CV_32F: + THFile_readFloatRaw(file, (float*)storageMat.data, size); + break; + case CV_64F: + THFile_readDoubleRaw(file, (double*)storageMat.data, size); + break; + case CV_8S: + case CV_8U: + THFile_readByteRaw(file, (uchar*)storageMat.data, size); + break; + case CV_16S: + case CV_16U: + THFile_readShortRaw(file, (short*)storageMat.data, size); + break; + case CV_32S: + THFile_readIntRaw(file, (int*)storageMat.data, size); + break; + case CV_USRTYPE1: + { + double *buf = storageMat.ptr(); + THFile_readLongRaw(file, (int64*)buf, size); + + for (size_t i = (size_t)size; i-- > 0; ) + buf[i] = ((int64*)buf)[i]; + } + break; + default: + CV_Error(Error::StsInternal, ""); + break; + } + + storages.insert(std::make_pair(index, storageMat)); + } + + void readTorchTable(Dict &scalarParams, TensorsMap &tensorParams) + { + int luaType = readInt(); + int index = readInt(); + + CV_Assert(luaType == TYPE_TABLE && readedIndexes.count(index) == 0); + readedIndexes.insert(index); + + long fpos; + int numPairs = readInt(); + + for (int i = 0; i < numPairs; i++) + { + fpos = THFile_position(file); + int ktype = readInt(); + + if (ktype != TYPE_STRING) //skip non-string fileds + { + THFile_seek(file, fpos); + readObject(); //key + readObject(); //value + continue; + } + + String key = readString(); + if (dbgPrint) + std::cout << i << "th key: " << key << "\n"; + + fpos = THFile_position(file); + int vtype = readInt(); + + if (vtype == TYPE_TORCH) + { + int index = readInt(); + readTorchObject(index); + + if (tensors.count(index)) //tensor was readed + { + tensorParams.insert(std::make_pair(key, std::make_pair(index, tensors[index]))); + } + else if (storages.count(index)) //storage was readed + { + Mat &matStorage = storages[index]; + Mat matCasted; + matStorage.convertTo(matCasted, CV_64F); + + DictValue scalar = DictValue::arrayReal(matCasted.ptr(), matCasted.total()); + scalarParams.set(key, scalar); + } + } + else if (vtype == TYPE_NUMBER) + { + scalarParams.set(key, readDouble()); + } + else if (vtype == TYPE_STRING) + { + scalarParams.set(key, readString()); + } + else if (vtype == TYPE_BOOLEAN) + { + scalarParams.set(key, readBool()); + } + else + { + THFile_seek(file, fpos); + readObject(); + } + } + + //Debug output + if (dbgPrint) + { + std::cout << "scalarParams:\n"; + std::cout << scalarParams; + + std::cout << "#" << tensorParams.size() << " tensorParams:\n"; + std::map >::const_iterator it; + for (it = tensorParams.begin(); it != tensorParams.end(); it++) + std::cout << it->first << ": Tensor " << it->second.second.size << "\n"; + } + } + + void readTorchTensor(int indexTensor, int typeTensor) + { + int ndims = readInt(); + AutoBuffer sizes(ndims); + AutoBuffer steps(ndims); + THFile_readLongRaw(file, sizes, ndims); + THFile_readLongRaw(file, steps, ndims); + long offset = readLong() - 1; + + //read Storage + int typeidx = readInt(); + CV_Assert(typeidx == TYPE_TORCH || (typeidx == TYPE_NIL && ndims == 0)); + + if (typeidx == TYPE_NIL) + { + tensors.insert(std::make_pair(indexTensor, Mat())); + return; + } + + int indexStorage = readInt(); + if (readedIndexes.count(indexStorage) == 0) + { + String className = readTorchClassName(); + int typeStorage = parseStorageType(className); + CV_Assert(typeStorage >= 0 && typeTensor == typeStorage); + readTorchStorage(indexStorage, typeStorage); + typeTensor = storages[indexStorage].type(); + readedIndexes.insert(indexStorage); + } + + //small check + size_t requireElems = (size_t)offset + (size_t)steps[0] * (size_t)sizes[0]; + size_t storageElems = storages[indexStorage].total(); + if (requireElems > storageElems) + CV_Error(Error::StsBadSize, "Storage has insufficent number of elemements for requested Tensor"); + + //convert sizes + AutoBuffer isizes(ndims); + AutoBuffer ssteps(ndims); + for (int i = ndims - 1; i >= 0; i--) + { + isizes[i] = (int)sizes[i]; + ssteps[i] = (size_t)steps[i] * CV_ELEM_SIZE(typeTensor); + } + + //allocate Blob + Mat srcMat(ndims, (int*)isizes, typeTensor , storages[indexStorage].ptr() + offset*CV_ELEM_SIZE(typeTensor), (size_t*)ssteps); + int dstType = CV_32F; + + Mat blob; + srcMat.convertTo(blob, dstType); + + tensors.insert(std::make_pair(indexTensor, blob)); + } + + static bool isNNClass(const String &className, String &nnName) + { + const char *prefixes[] = {"nn.", "cunn.", "cudnn.", "fbcunn.", NULL}; + + for (int i = 0; prefixes[i]; i++) + { + if (startsWith(className, prefixes[i])) + { + nnName = className.substr(strlen(prefixes[i])); + return true; + } + } + + return false; + } + + static void convertTorchKernelsParams(const Dict &torchParams, cv::dnn::LayerParams &layerParams) + { + layerParams.set("kernel_h", torchParams.get("kH")); + layerParams.set("kernel_w", torchParams.get("kW")); + layerParams.set("stride_h", torchParams.get("dH")); + layerParams.set("stride_w", torchParams.get("dW")); + layerParams.set("pad_h", torchParams.get("padH", 0)); + layerParams.set("pad_w", torchParams.get("padW", 0)); + } + + void readTorchObject(int index) + { + if(readedIndexes.count(index)) + return; + + String className = readTorchClassName(); + String nnName; + + if (dbgPrint) + std::cout << "Class: " << className << std::endl; + + int type; + if ( (type = parseTensorType(className)) >= 0 ) //is Tensor + { + readTorchTensor(index, type); + } + else if ( (type = parseStorageType(className)) >= 0 ) //is Storage + { + readTorchStorage(index, type); + } + else if (isNNClass(className, nnName)) + { + Dict scalarParams; + TensorsMap tensorParams; + + cv::Ptr newModule(new Module(nnName)); + cv::dnn::LayerParams &layerParams = newModule->params; + + layerParams.set("torch_index", index); + + if (nnName == "Sequential" || nnName == "Parallel" || + nnName == "Concat" || nnName == "ConcatTable" || nnName == "JoinTable") + { + Module *parentModule = curModule; + curModule->modules.push_back(newModule); + curModule = newModule; + readTorchTable(scalarParams, tensorParams); + curModule = parentModule; + + if (nnName == "Parallel") + { + layerParams.set("inputDimension", scalarParams.get("inputDimension")); + layerParams.set("outputDimension", scalarParams.get("outputDimension")); + } + if (nnName == "Concat") + { + layerParams.set("dimension", scalarParams.get("dimension")); + } + if (nnName == "JoinTable") + { + layerParams.set("dimension", scalarParams.get("dimension")); + } + } + else if (nnName == "SpatialConvolution") + { + newModule->apiType = "Convolution"; + readTorchTable(scalarParams, tensorParams); + + CV_Assert(tensorParams.count("weight")); + layerParams.blobs.push_back(tensorParams["weight"].second); + + bool bias = tensorParams.count("bias") != 0; + layerParams.set("bias_term", bias); + if (bias) + layerParams.blobs.push_back(tensorParams["bias"].second); + + layerParams.set("num_output", scalarParams.get("nOutputPlane")); + convertTorchKernelsParams(scalarParams, layerParams); + + curModule->modules.push_back(newModule); + } + else if (nnName == "SpatialMaxPooling" || nnName == "SpatialAveragePooling") + { + newModule->apiType = "Pooling"; + readTorchTable(scalarParams, tensorParams); + + if (nnName == "SpatialMaxPooling") { + layerParams.set("pool", "MAX"); + layerParams.set("indices_blob_id", tensorParams["indices"].first); + } + if (nnName == "SpatialAveragePooling") + layerParams.set("pool", "AVE"); + convertTorchKernelsParams(scalarParams, layerParams); + + curModule->modules.push_back(newModule); + } + else if (nnName == "Linear") + { + newModule->apiType = "InnerProduct"; + readTorchTable(scalarParams, tensorParams); + + CV_Assert(tensorParams.count("weight")); + Mat weightBlob = tensorParams["weight"].second; + layerParams.blobs.push_back(weightBlob); + + bool bias = tensorParams.count("bias") != 0; + if (bias) + layerParams.blobs.push_back(tensorParams["bias"].second); + layerParams.set("bias_term", bias); + + layerParams.set("num_output", weightBlob.size[0]); + curModule->modules.push_back(newModule); + } + else if (nnName == "Reshape") + { + newModule->apiType = "Reshape"; + + readTorchTable(scalarParams, tensorParams); + CV_Assert(scalarParams.has("size")); + + DictValue dimParam = scalarParams.get("size"); + layerParams.set("dim", dimParam); + + if (scalarParams.has("batchMode") && scalarParams.get("batchMode")) + layerParams.set("axis", 1); + + curModule->modules.push_back(newModule); + } + else if (nnName == "ReLU") + { + curModule->modules.push_back(cv::Ptr(new Module(nnName, "ReLU"))); + readObject(); + } + else if (nnName == "Tanh") + { + curModule->modules.push_back(cv::Ptr(new Module(nnName, "TanH"))); + readObject(); + } + else if (nnName == "Sigmoid") + { + curModule->modules.push_back(cv::Ptr(new Module(nnName, "Sigmoid"))); + readObject(); + } + else if (nnName == "SpatialBatchNormalization") + { + newModule->apiType = "BatchNorm"; + readTorchTable(scalarParams, tensorParams); + + CV_Assert(tensorParams.count("running_var") && + tensorParams.count("running_mean")); + layerParams.blobs.push_back(tensorParams["running_mean"].second); + layerParams.blobs.push_back(tensorParams["running_var"].second); + + CV_Assert(scalarParams.has("eps")); + float eps = float(scalarParams.get("eps")); + layerParams.set("eps", eps); + + if (tensorParams.count("weight")) + { + layerParams.set("has_weight", true); + layerParams.blobs.push_back(tensorParams["weight"].second); + } + + if (tensorParams.count("bias")) + { + layerParams.set("has_bias", true); + layerParams.blobs.push_back(tensorParams["bias"].second); + } + + curModule->modules.push_back(newModule); + } + else if (nnName == "PReLU") + { + readTorchTable(scalarParams, tensorParams); + + CV_Assert(tensorParams.count("weight")); + + size_t outputChannels = static_cast(scalarParams.get("nOutputPlane")); + if (outputChannels) { + + CV_Assert(tensorParams["weight"].second.total() == outputChannels); + layerParams.blobs.push_back(tensorParams["weight"].second); + + newModule->apiType = "ChannelsPReLU"; + } + else { + CV_Assert(tensorParams["weight"].second.total() == 1); + float negative_slope = *tensorParams["weight"].second.ptr(); + layerParams.set("negative_slope", negative_slope); + + newModule->apiType = "ReLU"; + } + + curModule->modules.push_back(newModule); + } + else if (nnName == "SpatialDropout") + { + readTorchTable(scalarParams, tensorParams); + CV_Assert(scalarParams.has("p")); + + float scale = 1 - scalarParams.get("p"); + + CV_Assert(scale > 0); + + newModule->apiType = "Power"; + layerParams.set("scale", scale); + curModule->modules.push_back(newModule); + } + else if (nnName == "Identity") + { + readTorchTable(scalarParams, tensorParams); + newModule->apiType = "Identity"; + curModule->modules.push_back(newModule); + } + else if (nnName == "Padding") + { + readTorchTable(scalarParams, tensorParams); + newModule->apiType = "Padding"; + + CV_Assert(scalarParams.has("pad") && + scalarParams.has("dim")); + + layerParams.set("padding_dim", + static_cast(scalarParams.get("dim") - 1)); + layerParams.set("padding", static_cast(scalarParams.get("pad"))); + + if (scalarParams.has("nInputDim")) + layerParams.set("input_dims", + static_cast(scalarParams.get("nInputDim"))); + + if (scalarParams.has("value")) + layerParams.set("value", scalarParams.get("value")); + + if (scalarParams.has("index")) + layerParams.set("index", + static_cast(scalarParams.get("index") - 1)); + + curModule->modules.push_back(newModule); + } + else if (nnName == "CAddTable") + { + curModule->modules.push_back(newModule); + readObject(); + } + else if (nnName == "SpatialDilatedConvolution") + { + readTorchTable(scalarParams, tensorParams); + newModule->apiType = "Convolution"; + CV_Assert(scalarParams.has("padW") && + scalarParams.has("padH")&& + scalarParams.has("dW")&& + scalarParams.has("dH")&& + scalarParams.has("dilationW")&& + scalarParams.has("dilationH")&& + scalarParams.has("kW")&& + scalarParams.has("kH")&& + scalarParams.has("nOutputPlane")); + + layerParams.set("kernel_w", static_cast(scalarParams.get("kW"))); + layerParams.set("kernel_h", static_cast(scalarParams.get("kH"))); + layerParams.set("pad_w", static_cast(scalarParams.get("padW"))); + layerParams.set("pad_h", static_cast(scalarParams.get("padH"))); + layerParams.set("stride_w", static_cast(scalarParams.get("dW"))); + layerParams.set("stride_h", static_cast(scalarParams.get("dH"))); + layerParams.set("dilation_w", static_cast(scalarParams.get("dilationW"))); + layerParams.set("dilation_h", static_cast(scalarParams.get("dilationH"))); + layerParams.set("num_output", static_cast(scalarParams.get("nOutputPlane"))); + + layerParams.blobs.push_back(tensorParams["weight"].second); + + bool bias = tensorParams.count("bias"); + layerParams.set("bias_term", bias); + if (bias) + layerParams.blobs.push_back(tensorParams["bias"].second); + + curModule->modules.push_back(newModule); + } + else if (nnName == "SpatialFullConvolution") + { + readTorchTable(scalarParams, tensorParams); + newModule->apiType = "Deconvolution"; + CV_Assert(scalarParams.has("padW") && + scalarParams.has("padH")&& + scalarParams.has("dW")&& + scalarParams.has("dH")&& + scalarParams.has("adjW")&& + scalarParams.has("adjH")&& + scalarParams.has("kW")&& + scalarParams.has("kH")&& + scalarParams.has("nOutputPlane")); + + layerParams.set("kernel_w", static_cast(scalarParams.get("kW"))); + layerParams.set("kernel_h", static_cast(scalarParams.get("kH"))); + layerParams.set("pad_w", static_cast(scalarParams.get("padW"))); + layerParams.set("pad_h", static_cast(scalarParams.get("padH"))); + layerParams.set("stride_w", static_cast(scalarParams.get("dW"))); + layerParams.set("stride_h", static_cast(scalarParams.get("dH"))); + layerParams.set("adj_w", static_cast(scalarParams.get("adjW"))); + layerParams.set("adj_h", static_cast(scalarParams.get("adjH"))); + layerParams.set("num_output", static_cast(scalarParams.get("nOutputPlane"))); + + Mat weights = tensorParams["weight"].second; + CV_Assert(weights.dims == 4); + int reorderedShape[] = { weights.size[1], weights.size[0], weights.size[2], weights.size[3] }; + layerParams.blobs.push_back(weights.reshape(1, 4, reorderedShape)); + + bool bias = tensorParams.count("bias"); + layerParams.set("bias_term", bias); + if (bias) + layerParams.blobs.push_back(tensorParams["bias"].second); + + curModule->modules.push_back(newModule); + } + else if (nnName == "SpatialMaxUnpooling") + { + readTorchTable(scalarParams, tensorParams); + CV_Assert(tensorParams.count("indices")); + + layerParams.set("indices_blob_id", tensorParams["indices"].first); + curModule->modules.push_back(newModule); + } + else if (nnName == "SoftMax") + { + newModule->apiType = "SoftMax"; + curModule->modules.push_back(newModule); + } + else if (nnName == "LogSoftMax") + { + newModule->apiType = "SoftMax"; + layerParams.set("log_softmax", true); + curModule->modules.push_back(newModule); + } + else + { + CV_Error(Error::StsNotImplemented, "Unknown nn class \"" + className + "\""); + } + } + else + { + CV_Error(Error::StsNotImplemented, "Unsupported Torch class \"" + className + "\""); + } + + readedIndexes.insert(index); + } + + void readObject() + { + int typeidx = readInt(); + + if (typeidx == TYPE_TORCH) + { + int index = readInt(); + readTorchObject(index); + readedIndexes.insert(index); + } + else if (typeidx == TYPE_NIL) + return; + else if (typeidx == TYPE_NUMBER) + readDouble(); + else if (typeidx == TYPE_BOOLEAN) + readBool(); + else if (typeidx == TYPE_STRING) + readString(); + else if (typeidx == TYPE_TABLE) + readTable(); + else + CV_Error(Error::StsNotImplemented, "Unsupported Lua type"); + } + + inline String generateLayerName(const String &label = String()) + { + return "l" + toString(++this->moduleCounter) + "_" + label; + } + + int fill(Module *module, std::vector >& addedModules, int prevLayerId = 0, int prevOutNum = 0) + { + if (module == NULL) + return prevLayerId; + + if (module->apiType.length()) + { + int newLayerId = net.addLayer(generateLayerName(module->apiType), module->apiType, module->params); + net.connect(prevLayerId, prevOutNum, newLayerId, 0); + addedModules.push_back(std::make_pair(newLayerId, module)); + return newLayerId; + } + else + { + if (module->thName == "Sequential") + { + for (size_t i = 0; i < module->modules.size(); i++) + { + prevLayerId = fill(module->modules[i], addedModules, prevLayerId, prevOutNum); + prevOutNum = 0; + } + return prevLayerId; + } + else if (module->thName == "Concat") + { + int newId, splitId, mergeId; + LayerParams mergeParams, splitParams; + mergeParams.set("axis", module->params.get("dimension") - 1); + + splitId = net.addLayer(generateLayerName("torchSplit"), "Split", splitParams); + net.connect(prevLayerId, prevOutNum, splitId, 0); + + std::vector branchIds; + for (int i = 0; i < (int)module->modules.size(); i++) + { + newId = fill(module->modules[i], addedModules, splitId, i); + branchIds.push_back(newId); + } + + mergeId = net.addLayer(generateLayerName("torchMerge"), "Concat", mergeParams); + + for (int i = 0; i < branchIds.size(); i++) + { + net.connect(branchIds[i], 0, mergeId, i); + } + + addedModules.push_back(std::make_pair(mergeId, module)); + return mergeId; + } + else if (module->thName == "Parallel") + { + int newId, splitId, mergeId, reshapeId; + + LayerParams splitParams, mergeParams, reshapeParams; + splitParams.set("axis", module->params.get("inputDimension") - 1); + mergeParams.set("axis", module->params.get("outputDimension") - 1); + reshapeParams.set("axis", splitParams.get("axis")); + reshapeParams.set("num_axes", 1); + + splitId = net.addLayer(generateLayerName("torchSplit"), "Slice", splitParams); + reshapeId = net.addLayer(generateLayerName("torchReshape"), "Reshape", reshapeParams); + net.connect(prevLayerId, prevOutNum, splitId, 0); + + std::vector branchIds; + for (int i = 0; i < (int)module->modules.size(); i++) + { + net.connect(splitId, i, reshapeId, i); + newId = fill(module->modules[i], addedModules, reshapeId, i); + branchIds.push_back(newId); + } + + mergeId = net.addLayer(generateLayerName("torchMerge"), "Concat", mergeParams); + + for (int i = 0; i < branchIds.size(); i++) + { + net.connect(branchIds[i], 0, mergeId, i); + } + + addedModules.push_back(std::make_pair(mergeId, module)); + return mergeId; + } + else if (module->thName == "ConcatTable") { + int newId, splitId; + LayerParams splitParams; + + splitId = net.addLayer(generateLayerName("torchSplit"), "Split", splitParams); + net.connect(prevLayerId, prevOutNum, splitId, 0); + + addedModules.push_back(std::make_pair(splitId, module)); + + for (int i = 0; i < (int)module->modules.size(); i++) + { + newId = fill(module->modules[i], addedModules, splitId, i); + } + + return newId; + } + else if (module->thName == "JoinTable") { + std::vector ids = net.getUnconnectedOutLayers(); + + int mergeId; + LayerParams mergeParams; + mergeParams.set("axis", module->params.get("dimension") - 1); + + mergeId = net.addLayer(generateLayerName("torchMerge"), "Concat", mergeParams); + addedModules.push_back(std::make_pair(mergeId, module)); + + for (int i = 0; i < ids.size(); i++) + { + net.connect(ids[i], 0, mergeId, i); + } + + return mergeId; + } + else if (module->thName == "CAddTable") { + String name = generateLayerName("torchCAddTable"); + std::vector ids = net.getUnconnectedOutLayers(); + LayerParams params; + params.set("operation", "sum"); + + + int id = net.addLayer(name, "Eltwise", params); + + for (int i = 0; i < ids.size(); i++) + { + net.connect(ids[i], 0, id, i); + } + + addedModules.push_back(std::make_pair(id, module)); + return id; + } + else if (module->thName == "SpatialMaxUnpooling") { + CV_Assert(module->params.has("indices_blob_id")); + int indicesBlobId = module->params.get("indices_blob_id"); + std::pair poolingLayer; + poolingLayer.first = -1; + + for(int i = 0; i < addedModules.size(); i++) + { + if (addedModules[i].second->apiType == "Pooling" && + addedModules[i].second->params.has("indices_blob_id") && + addedModules[i].second->params.get("indices_blob_id") == indicesBlobId) + { + poolingLayer = addedModules[i]; + break; + } + } + + module->params.set("pool_k_h", poolingLayer.second->params.get("kernel_h")); + module->params.set("pool_k_w", poolingLayer.second->params.get("kernel_w")); + module->params.set("pool_stride_h", poolingLayer.second->params.get("stride_h")); + module->params.set("pool_stride_w", poolingLayer.second->params.get("stride_w")); + module->params.set("pool_pad_h", poolingLayer.second->params.get("pad_h")); + module->params.set("pool_pad_w", poolingLayer.second->params.get("pad_w")); + + String name = generateLayerName("torchMaxUnpooling"); + int id = net.addLayer(name, "MaxUnpool", module->params); + net.connect(prevLayerId, 0, id, 0); + + CV_Assert(poolingLayer.first != -1); + net.connect(poolingLayer.first, 1, id, 1); + + return id; + } + } + + CV_Error(Error::StsInternal, "Unexpected torch container: " + module->thName); + return -1; + } + + void populateNet(Net net_) + { + if (rootModule == NULL) + { + rootModule = new Module("Sequential"); + curModule = rootModule; + + THFile_seek(file, 0); + readObject(); + } + + net = net_; + std::vector > addedModules; + fill(rootModule, addedModules); + } +}; + +Ptr createTorchImporter(const String &filename, bool isBinary) +{ + return Ptr(new TorchImporter(filename, isBinary)); +} + + +Mat readTorchBlob(const String &filename, bool isBinary) +{ + Ptr importer(new TorchImporter(filename, isBinary)); + importer->readObject(); + CV_Assert(importer->tensors.size() == 1); + + return importer->tensors.begin()->second; +} + +#else + +Ptr createTorchImporter(const String&, bool) +{ + CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build"); + return Ptr(); +} + +Mat readTorchBlob(const String&, bool) +{ + CV_Error(Error::StsNotImplemented, "Torch importer is disabled in current build"); + return Mat(); +} + +#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER + +Net readNetFromTorch(const String &model, bool isBinary) +{ + Ptr importer = createTorchImporter(model, isBinary); + Net net; + if (importer) + importer->populateNet(net); + return net; +} + +} +} diff --git a/modules/dnn/test/cityscapes_semsegm_test_enet.py b/modules/dnn/test/cityscapes_semsegm_test_enet.py new file mode 100644 index 0000000000..e7e09d4ca4 --- /dev/null +++ b/modules/dnn/test/cityscapes_semsegm_test_enet.py @@ -0,0 +1,142 @@ +import numpy as np +import sys +import os +import fnmatch +import argparse + +# sys.path.append('') +sys.path.append('/home/arrybn/build/opencv_w_contrib/lib') +try: + import cv2 as cv +except ImportError: + raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to opencv_build_dir/lib dir') +try: + import torch +except ImportError: + raise ImportError('Can\'t find pytorch. Please intall it by following instructions on the official site') + +from torch.utils.serialization import load_lua +from pascal_semsegm_test_fcn import eval_segm_result, get_conf_mat, get_metrics, DatasetImageFetch, SemSegmEvaluation +from imagenet_cls_test_alexnet import Framework, DnnCaffeModel + + +class NormalizePreproc: + def __init__(self): + pass + + @staticmethod + def process(img): + image_data = np.array(img).transpose(2, 0, 1).astype(np.float32) + image_data = np.expand_dims(image_data, 0) + image_data /= 255.0 + return image_data + + +class CityscapesDataFetch(DatasetImageFetch): + img_dir = '' + segm_dir = '' + segm_files = [] + colors = [] + i = 0 + + def __init__(self, img_dir, segm_dir, preproc): + self.img_dir = img_dir + self.segm_dir = segm_dir + self.segm_files = sorted([img for img in self.locate('*_color.png', segm_dir)]) + self.colors = self.get_colors() + self.data_prepoc = preproc + self.i = 0 + + @staticmethod + def get_colors(): + result = [] + colors_list = ( + (0, 0, 0), (128, 64, 128), (244, 35, 232), (70, 70, 70), (102, 102, 156), (190, 153, 153), (153, 153, 153), + (250, 170, 30), (220, 220, 0), (107, 142, 35), (152, 251, 152), (70, 130, 180), (220, 20, 60), (255, 0, 0), + (0, 0, 142), (0, 0, 70), (0, 60, 100), (0, 80, 100), (0, 0, 230), (119, 11, 32)) + + for c in colors_list: + result.append(DatasetImageFetch.pix_to_c(c)) + return result + + def __iter__(self): + return self + + def next(self): + if self.i < len(self.segm_files): + segm_file = self.segm_files[self.i] + segm = cv.imread(segm_file, cv.IMREAD_COLOR)[:, :, ::-1] + segm = cv.resize(segm, (1024, 512), interpolation=cv.INTER_NEAREST) + + img_file = self.rreplace(self.img_dir + segm_file[len(self.segm_dir):], 'gtFine_color', 'leftImg8bit') + assert os.path.exists(img_file) + img = cv.imread(img_file, cv.IMREAD_COLOR)[:, :, ::-1] + img = cv.resize(img, (1024, 512)) + + self.i += 1 + gt = self.color_to_gt(segm, self.colors) + img = self.data_prepoc.process(img) + return img, gt + else: + self.i = 0 + raise StopIteration + + def get_num_classes(self): + return len(self.colors) + + @staticmethod + def locate(pattern, root_path): + for path, dirs, files in os.walk(os.path.abspath(root_path)): + for filename in fnmatch.filter(files, pattern): + yield os.path.join(path, filename) + + @staticmethod + def rreplace(s, old, new, occurrence=1): + li = s.rsplit(old, occurrence) + return new.join(li) + + +class TorchModel(Framework): + net = object + + def __init__(self, model_file): + self.net = load_lua(model_file) + + def get_name(self): + return 'Torch' + + def get_output(self, input_blob): + tensor = torch.FloatTensor(input_blob) + out = self.net.forward(tensor).numpy() + return out + + +class DnnTorchModel(DnnCaffeModel): + net = cv.dnn.Net() + + def __init__(self, model_file): + self.net = cv.dnn.readNetFromTorch(model_file) + + def get_output(self, input_blob): + self.net.setBlob("", input_blob) + self.net.forward() + return self.net.getBlob(self.net.getLayerNames()[-1]) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--imgs_dir", help="path to Cityscapes validation images dir, imgsfine/leftImg8bit/val") + parser.add_argument("--segm_dir", help="path to Cityscapes dir with segmentation, gtfine/gtFine/val") + parser.add_argument("--model", help="path to torch model, download it here: " + "https://www.dropbox.com/sh/dywzk3gyb12hpe5/AAD5YkUa8XgMpHs2gCRgmCVCa") + parser.add_argument("--log", help="path to logging file") + args = parser.parse_args() + + prep = NormalizePreproc() + df = CityscapesDataFetch(args.imgs_dir, args.segm_dir, prep) + + fw = [TorchModel(args.model), + DnnTorchModel(args.model)] + + segm_eval = SemSegmEvaluation(args.log) + segm_eval.process(fw, df) diff --git a/modules/dnn/test/cnpy.cpp b/modules/dnn/test/cnpy.cpp new file mode 100644 index 0000000000..ee49519f56 --- /dev/null +++ b/modules/dnn/test/cnpy.cpp @@ -0,0 +1,291 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +//Copyright (C) 2011 Carl Rogers +//Released under MIT License +//license available in LICENSE file, or at http://www.opensource.org/licenses/mit-license.php + +#include"cnpy.h" +#include +#include +#include +#include +#include + +char cnpy::BigEndianTest() { + union + { + unsigned char x[2]; + short y; + }; + x[0] = 1; + x[1] = 0; + + return y == 1 ? '<' : '>'; +} + +char cnpy::map_type(const std::type_info& t) +{ + if(t == typeid(float) ) return 'f'; + if(t == typeid(double) ) return 'f'; + if(t == typeid(long double) ) return 'f'; + + if(t == typeid(int) ) return 'i'; + if(t == typeid(char) ) return 'i'; + if(t == typeid(short) ) return 'i'; + if(t == typeid(long) ) return 'i'; + if(t == typeid(long long) ) return 'i'; + + if(t == typeid(unsigned char) ) return 'u'; + if(t == typeid(unsigned short) ) return 'u'; + if(t == typeid(unsigned long) ) return 'u'; + if(t == typeid(unsigned long long) ) return 'u'; + if(t == typeid(unsigned int) ) return 'u'; + + if(t == typeid(bool) ) return 'b'; + + if(t == typeid(std::complex) ) return 'c'; + if(t == typeid(std::complex) ) return 'c'; + if(t == typeid(std::complex) ) return 'c'; + + else return '?'; +} + +template<> std::vector& cnpy::operator+=(std::vector& lhs, const std::string rhs) { + lhs.insert(lhs.end(),rhs.begin(),rhs.end()); + return lhs; +} + +template<> std::vector& cnpy::operator+=(std::vector& lhs, const char* rhs) { + //write in little endian + size_t len = strlen(rhs); + lhs.reserve(len); + for(size_t byte = 0; byte < len; byte++) { + lhs.push_back(rhs[byte]); + } + return lhs; +} + +void cnpy::parse_npy_header(FILE* fp, unsigned int& word_size, unsigned int*& shape, unsigned int& ndims, bool& fortran_order) { + char buffer[256]; + size_t res = fread(buffer,sizeof(char),11,fp); + if(res != 11) + throw std::runtime_error("parse_npy_header: failed fread"); + std::string header = fgets(buffer,256,fp); + cnpy_assert(header[header.size()-1] == '\n'); + + size_t loc1, loc2; + + //fortran order + loc1 = header.find("fortran_order")+16; + fortran_order = (header.substr(loc1,5) == "True" ? true : false); + + //shape + loc1 = header.find("("); + loc2 = header.find(")"); + std::string str_shape = header.substr(loc1+1,loc2-loc1-1); + if(str_shape[str_shape.size()-1] == ',') ndims = 1; + else ndims = (unsigned)std::count(str_shape.begin(),str_shape.end(),',')+1; + shape = new unsigned int[ndims]; + for(unsigned int i = 0;i < ndims;i++) { + loc1 = str_shape.find(","); + shape[i] = atoi(str_shape.substr(0,loc1).c_str()); + str_shape = str_shape.substr(loc1+1); + } + + //endian, word size, data type + //byte order code | stands for not applicable. + //not sure when this applies except for byte array + loc1 = header.find("descr")+9; + bool littleEndian = (header[loc1] == '<' || header[loc1] == '|' ? true : false); + cnpy_assert(littleEndian); + + //char type = header[loc1+1]; + //assert(type == map_type(T)); + + std::string str_ws = header.substr(loc1+2); + loc2 = str_ws.find("'"); + word_size = atoi(str_ws.substr(0,loc2).c_str()); +} + +void cnpy::parse_zip_footer(FILE* fp, unsigned short& nrecs, unsigned int& global_header_size, unsigned int& global_header_offset) +{ + std::vector footer(22); + fseek(fp,-22,SEEK_END); + size_t res = fread(&footer[0],sizeof(char),22,fp); + if(res != 22) + throw std::runtime_error("parse_zip_footer: failed fread"); + + unsigned short disk_no, disk_start, nrecs_on_disk, comment_len; + disk_no = *(unsigned short*) &footer[4]; + disk_start = *(unsigned short*) &footer[6]; + nrecs_on_disk = *(unsigned short*) &footer[8]; + nrecs = *(unsigned short*) &footer[10]; + global_header_size = *(unsigned int*) &footer[12]; + global_header_offset = *(unsigned int*) &footer[16]; + comment_len = *(unsigned short*) &footer[20]; + + cnpy_assert(disk_no == 0); + cnpy_assert(disk_start == 0); + cnpy_assert(nrecs_on_disk == nrecs); + cnpy_assert(comment_len == 0); +} + +cnpy::NpyArray load_the_npy_file(FILE* fp) { + unsigned int* shape; + unsigned int ndims, word_size; + bool fortran_order; + cnpy::parse_npy_header(fp,word_size,shape,ndims,fortran_order); + unsigned long long size = 1; //long long so no overflow when multiplying by word_size + for(unsigned int i = 0;i < ndims;i++) size *= shape[i]; + + cnpy::NpyArray arr; + arr.word_size = word_size; + arr.shape = std::vector(shape,shape+ndims); + delete[] shape; + arr.data = new char[size*word_size]; + arr.fortran_order = fortran_order; + size_t nread = fread(arr.data,word_size,size,fp); + if(nread != size) + throw std::runtime_error("load_the_npy_file: failed fread"); + return arr; +} + +cnpy::npz_t cnpy::npz_load(std::string fname) { + FILE* fp = fopen(fname.c_str(),"rb"); + + if(!fp) printf("npz_load: Error! Unable to open file %s!\n",fname.c_str()); + cnpy_assert(fp); + + cnpy::npz_t arrays; + + while(1) { + std::vector local_header(30); + size_t headerres = fread(&local_header[0],sizeof(char),30,fp); + if(headerres != 30) + throw std::runtime_error("npz_load: failed fread"); + + //if we've reached the global header, stop reading + if(local_header[2] != 0x03 || local_header[3] != 0x04) break; + + //read in the variable name + unsigned short name_len = *(unsigned short*) &local_header[26]; + std::string varname(name_len,' '); + size_t vname_res = fread(&varname[0],sizeof(char),name_len,fp); + if(vname_res != name_len) + throw std::runtime_error("npz_load: failed fread"); + + //erase the lagging .npy + varname.erase(varname.end()-4,varname.end()); + + //read in the extra field + unsigned short extra_field_len = *(unsigned short*) &local_header[28]; + if(extra_field_len > 0) { + std::vector buff(extra_field_len); + size_t efield_res = fread(&buff[0],sizeof(char),extra_field_len,fp); + if(efield_res != extra_field_len) + throw std::runtime_error("npz_load: failed fread"); + } + + arrays[varname] = load_the_npy_file(fp); + } + + fclose(fp); + return arrays; +} + +cnpy::NpyArray cnpy::npz_load(std::string fname, std::string varname) { + FILE* fp = fopen(fname.c_str(),"rb"); + + if(!fp) { + throw std::runtime_error("npz_load: Error! Unable to open file " + fname + "!\n"); + } + + while(1) { + std::vector local_header(30); + size_t header_res = fread(&local_header[0],sizeof(char),30,fp); + if(header_res != 30) + throw std::runtime_error("npz_load: failed fread"); + + //if we've reached the global header, stop reading + if(local_header[2] != 0x03 || local_header[3] != 0x04) break; + + //read in the variable name + unsigned short name_len = *(unsigned short*) &local_header[26]; + std::string vname(name_len,' '); + size_t vname_res = fread(&vname[0],sizeof(char),name_len,fp); + if(vname_res != name_len) + throw std::runtime_error("npz_load: failed fread"); + vname.erase(vname.end()-4,vname.end()); //erase the lagging .npy + + //read in the extra field + unsigned short extra_field_len = *(unsigned short*) &local_header[28]; + fseek(fp,extra_field_len,SEEK_CUR); //skip past the extra field + + if(vname == varname) { + NpyArray array = load_the_npy_file(fp); + fclose(fp); + return array; + } + else { + //skip past the data + unsigned int size = *(unsigned int*) &local_header[22]; + fseek(fp,size,SEEK_CUR); + } + } + + fclose(fp); + throw std::runtime_error("npz_load: Error! Variable name " + varname + " not found in " + fname + "!\n"); +} + +cnpy::NpyArray cnpy::npy_load(std::string fname) { + + FILE* fp = fopen(fname.c_str(), "rb"); + + if(!fp) { + throw std::runtime_error("npy_load: Error! Unable to open file " + fname + "!\n"); + } + + NpyArray arr = load_the_npy_file(fp); + + fclose(fp); + return arr; +} diff --git a/modules/dnn/test/cnpy.h b/modules/dnn/test/cnpy.h new file mode 100644 index 0000000000..37732b04f9 --- /dev/null +++ b/modules/dnn/test/cnpy.h @@ -0,0 +1,294 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +//Copyright (C) 2011 Carl Rogers +//Released under MIT License +//license available in LICENSE file, or at http://www.opensource.org/licenses/mit-license.php + +#ifndef LIBCNPY_H_ +#define LIBCNPY_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(HAVE_ZLIB) && HAVE_ZLIB +#include +#endif + +#ifndef NDEBUG +#define cnpy_assert(expression) assert(expression) +#else +#define cnpy_assert(expression) ((void)(expression)) +#endif + +namespace cnpy { + + struct NpyArray { + char* data; + std::vector shape; + unsigned int word_size; + bool fortran_order; + void destruct() {delete[] data;} + }; + + struct npz_t : public std::map + { + void destruct() + { + npz_t::iterator it = this->begin(); + for(; it != this->end(); ++it) (*it).second.destruct(); + } + }; + + char BigEndianTest(); + char map_type(const std::type_info& t); + template std::vector create_npy_header(const T* data, const unsigned int* shape, const unsigned int ndims); + void parse_npy_header(FILE* fp,unsigned int& word_size, unsigned int*& shape, unsigned int& ndims, bool& fortran_order); + void parse_zip_footer(FILE* fp, unsigned short& nrecs, unsigned int& global_header_size, unsigned int& global_header_offset); + npz_t npz_load(std::string fname); + NpyArray npz_load(std::string fname, std::string varname); + NpyArray npy_load(std::string fname); + + template std::vector& operator+=(std::vector& lhs, const T rhs) { + //write in little endian + for(char byte = 0; (size_t)byte < sizeof(T); byte++) { + char val = *((char*)&rhs+byte); + lhs.push_back(val); + } + return lhs; + } + + template<> std::vector& operator+=(std::vector& lhs, const std::string rhs); + template<> std::vector& operator+=(std::vector& lhs, const char* rhs); + + + template std::string tostring(T i, int = 0, char = ' ') { + std::stringstream s; + s << i; + return s.str(); + } + + template void npy_save(std::string fname, const T* data, const unsigned int* shape, const unsigned int ndims, std::string mode = "w") { + FILE* fp = NULL; + + if(mode == "a") fp = fopen(fname.c_str(),"r+b"); + + if(fp) { + //file exists. we need to append to it. read the header, modify the array size + unsigned int word_size, tmp_dims; + unsigned int* tmp_shape = 0; + bool fortran_order; + parse_npy_header(fp,word_size,tmp_shape,tmp_dims,fortran_order); + cnpy_assert(!fortran_order); + + if(word_size != sizeof(T)) { + std::cout<<"libnpy error: "< header = create_npy_header(data,tmp_shape,ndims); + fwrite(&header[0],sizeof(char),header.size(),fp); + fseek(fp,0,SEEK_END); + + delete[] tmp_shape; + } + else { + fp = fopen(fname.c_str(),"wb"); + std::vector header = create_npy_header(data,shape,ndims); + fwrite(&header[0],sizeof(char),header.size(),fp); + } + + unsigned int nels = 1; + for(unsigned i = 0;i < ndims;i++) nels *= shape[i]; + + fwrite(data,sizeof(T),nels,fp); + fclose(fp); + } + + template void npz_save(std::string zipname, std::string fname, const T* data, const unsigned int* shape, const unsigned int ndims, std::string mode = "w") + { + //first, append a .npy to the fname + fname += ".npy"; + + //now, on with the show + FILE* fp = NULL; + unsigned short nrecs = 0; + unsigned int global_header_offset = 0; + std::vector global_header; + + if(mode == "a") fp = fopen(zipname.c_str(),"r+b"); + + if(fp) { + //zip file exists. we need to add a new npy file to it. + //first read the footer. this gives us the offset and size of the global header + //then read and store the global header. + //below, we will write the the new data at the start of the global header then append the global header and footer below it + unsigned int global_header_size; + parse_zip_footer(fp,nrecs,global_header_size,global_header_offset); + fseek(fp,global_header_offset,SEEK_SET); + global_header.resize(global_header_size); + size_t res = fread(&global_header[0],sizeof(char),global_header_size,fp); + if(res != global_header_size){ + throw std::runtime_error("npz_save: header read error while adding to existing zip"); + } + fseek(fp,global_header_offset,SEEK_SET); + } + else { + fp = fopen(zipname.c_str(),"wb"); + } + + std::vector npy_header = create_npy_header(data,shape,ndims); + + unsigned long nels = 1; + for (unsigned m=0; m local_header; + local_header += "PK"; //first part of sig + local_header += (unsigned short) 0x0403; //second part of sig + local_header += (unsigned short) 20; //min version to extract + local_header += (unsigned short) 0; //general purpose bit flag + local_header += (unsigned short) 0; //compression method + local_header += (unsigned short) 0; //file last mod time + local_header += (unsigned short) 0; //file last mod date + local_header += (unsigned int) crc; //crc + local_header += (unsigned int) nbytes; //compressed size + local_header += (unsigned int) nbytes; //uncompressed size + local_header += (unsigned short) fname.size(); //fname length + local_header += (unsigned short) 0; //extra field length + local_header += fname; + + //build global header + global_header += "PK"; //first part of sig + global_header += (unsigned short) 0x0201; //second part of sig + global_header += (unsigned short) 20; //version made by + global_header.insert(global_header.end(),local_header.begin()+4,local_header.begin()+30); + global_header += (unsigned short) 0; //file comment length + global_header += (unsigned short) 0; //disk number where file starts + global_header += (unsigned short) 0; //internal file attributes + global_header += (unsigned int) 0; //external file attributes + global_header += (unsigned int) global_header_offset; //relative offset of local file header, since it begins where the global header used to begin + global_header += fname; + + //build footer + std::vector footer; + footer += "PK"; //first part of sig + footer += (unsigned short) 0x0605; //second part of sig + footer += (unsigned short) 0; //number of this disk + footer += (unsigned short) 0; //disk where footer starts + footer += (unsigned short) (nrecs+1); //number of records on this disk + footer += (unsigned short) (nrecs+1); //total number of records + footer += (unsigned int) global_header.size(); //nbytes of global headers + footer += (unsigned int) (global_header_offset + nbytes + local_header.size()); //offset of start of global headers, since global header now starts after newly written array + footer += (unsigned short) 0; //zip file comment length + + //write everything + fwrite(&local_header[0],sizeof(char),local_header.size(),fp); + fwrite(&npy_header[0],sizeof(char),npy_header.size(),fp); + fwrite(data,sizeof(T),nels,fp); + fwrite(&global_header[0],sizeof(char),global_header.size(),fp); + fwrite(&footer[0],sizeof(char),footer.size(),fp); + fclose(fp); + } + + template std::vector create_npy_header(const T*, const unsigned int* shape, const unsigned int ndims) { + + std::vector dict; + dict += "{'descr': '"; + dict += BigEndianTest(); + dict += map_type(typeid(T)); + dict += tostring(sizeof(T)); + dict += "', 'fortran_order': False, 'shape': ("; + dict += tostring(shape[0]); + for(unsigned i = 1;i < ndims;i++) { + dict += ", "; + dict += tostring(shape[i]); + } + if(ndims == 1) dict += ","; + dict += "), }"; + //pad with spaces so that preamble+dict is modulo 16 bytes. preamble is 10 bytes. dict needs to end with \n + int remainder = 16 - (10 + dict.size()) % 16; + dict.insert(dict.end(),remainder,' '); + dict.back() = '\n'; + + std::vector header; + header += (unsigned char) 0x93; + header += "NUMPY"; + header += (char) 0x01; //major version of numpy format + header += (char) 0x00; //minor version of numpy format + header += (unsigned short) dict.size(); + header.insert(header.end(),dict.begin(),dict.end()); + + return header; + } + + +} + +#endif diff --git a/modules/dnn/test/imagenet_cls_test_alexnet.py b/modules/dnn/test/imagenet_cls_test_alexnet.py new file mode 100644 index 0000000000..de652040af --- /dev/null +++ b/modules/dnn/test/imagenet_cls_test_alexnet.py @@ -0,0 +1,246 @@ +from abc import ABCMeta, abstractmethod +import numpy as np +import sys +import os +import argparse +import time + +# sys.path.append('') +sys.path.append('/home/arrybn/git/caffe/python') +try: + import caffe +except ImportError: + raise ImportError('Can\'t find caffe. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to git/caffe/python dir') +# sys.path.append('') +sys.path.append('/home/arrybn/build/opencv_w_contrib/lib') +try: + import cv2 as cv +except ImportError: + raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to opencv_build_dir/lib dir') + + +class DataFetch(object): + imgs_dir = '' + frame_size = 0 + bgr_to_rgb = False + __metaclass__ = ABCMeta + + @abstractmethod + def preprocess(self, img): + pass + + def get_batch(self, imgs_names): + assert type(imgs_names) is list + batch = np.zeros((len(imgs_names), 3, self.frame_size, self.frame_size)).astype(np.float32) + for i in range(len(imgs_names)): + img_name = imgs_names[i] + img_file = self.imgs_dir + img_name + assert os.path.exists(img_file) + img = cv.imread(img_file, cv.IMREAD_COLOR) + min_dim = min(img.shape[-3], img.shape[-2]) + resize_ratio = self.frame_size / float(min_dim) + img = cv.resize(img, (0, 0), fx=resize_ratio, fy=resize_ratio) + cols = img.shape[1] + rows = img.shape[0] + y1 = (rows - self.frame_size) / 2 + y2 = y1 + self.frame_size + x1 = (cols - self.frame_size) / 2 + x2 = x1 + self.frame_size + img = img[y1:y2, x1:x2] + if self.bgr_to_rgb: + img = img[..., ::-1] + image_data = img[:, :, 0:3].transpose(2, 0, 1) + batch[i] = self.preprocess(image_data) + return batch + + +class MeanBlobFetch(DataFetch): + mean_blob = np.ndarray(()) + + def __init__(self, frame_size, mean_blob_path, imgs_dir): + self.imgs_dir = imgs_dir + self.frame_size = frame_size + blob = caffe.proto.caffe_pb2.BlobProto() + data = open(mean_blob_path, 'rb').read() + blob.ParseFromString(data) + self.mean_blob = np.array(caffe.io.blobproto_to_array(blob)) + start = (self.mean_blob.shape[2] - self.frame_size) / 2 + stop = start + self.frame_size + self.mean_blob = self.mean_blob[:, :, start:stop, start:stop][0] + + def preprocess(self, img): + return img - self.mean_blob + + +class MeanChannelsFetch(MeanBlobFetch): + def __init__(self, frame_size, imgs_dir): + self.imgs_dir = imgs_dir + self.frame_size = frame_size + self.mean_blob = np.ones((3, self.frame_size, self.frame_size)).astype(np.float32) + self.mean_blob[0] *= 104 + self.mean_blob[1] *= 117 + self.mean_blob[2] *= 123 + + +class MeanValueFetch(MeanBlobFetch): + def __init__(self, frame_size, imgs_dir, bgr_to_rgb): + self.imgs_dir = imgs_dir + self.frame_size = frame_size + self.mean_blob = np.ones((3, self.frame_size, self.frame_size)).astype(np.float32) + self.mean_blob *= 117 + self.bgr_to_rgb = bgr_to_rgb + + +def get_correct_answers(img_list, img_classes, net_output_blob): + correct_answers = 0 + for i in range(len(img_list)): + indexes = np.argsort(net_output_blob[i])[-5:] + correct_index = img_classes[img_list[i]] + if correct_index in indexes: + correct_answers += 1 + return correct_answers + + +class Framework(object): + in_blob_name = '' + out_blob_name = '' + + __metaclass__ = ABCMeta + + @abstractmethod + def get_name(self): + pass + + @abstractmethod + def get_output(self, input_blob): + pass + + +class CaffeModel(Framework): + net = caffe.Net + need_reshape = False + + def __init__(self, prototxt, caffemodel, in_blob_name, out_blob_name, need_reshape=False): + caffe.set_mode_cpu() + self.net = caffe.Net(prototxt, caffemodel, caffe.TEST) + self.in_blob_name = in_blob_name + self.out_blob_name = out_blob_name + self.need_reshape = need_reshape + + def get_name(self): + return 'Caffe' + + def get_output(self, input_blob): + if self.need_reshape: + self.net.blobs[self.in_blob_name].reshape(*input_blob.shape) + return self.net.forward_all(**{self.in_blob_name: input_blob})[self.out_blob_name] + + +class DnnCaffeModel(Framework): + net = object + + def __init__(self, prototxt, caffemodel, in_blob_name, out_blob_name): + self.net = cv.dnn.readNetFromCaffe(prototxt, caffemodel) + self.in_blob_name = in_blob_name + self.out_blob_name = out_blob_name + + def get_name(self): + return 'DNN' + + def get_output(self, input_blob): + self.net.setBlob(self.in_blob_name, input_blob) + self.net.forward() + return self.net.getBlob(self.out_blob_name) + + +class ClsAccEvaluation: + log = file + img_classes = {} + batch_size = 0 + + def __init__(self, log_path, img_classes_file, batch_size): + self.log = open(log_path, 'w') + self.img_classes = self.read_classes(img_classes_file) + self.batch_size = batch_size + + @staticmethod + def read_classes(img_classes_file): + result = {} + with open(img_classes_file) as file: + for l in file.readlines(): + result[l.split()[0]] = int(l.split()[1]) + return result + + def process(self, frameworks, data_fetcher): + sorted_imgs_names = sorted(self.img_classes.keys()) + correct_answers = [0] * len(frameworks) + samples_handled = 0 + blobs_l1_diff = [0] * len(frameworks) + blobs_l1_diff_count = [0] * len(frameworks) + blobs_l_inf_diff = [sys.float_info.min] * len(frameworks) + inference_time = [0.0] * len(frameworks) + + for x in xrange(0, len(sorted_imgs_names), self.batch_size): + sublist = sorted_imgs_names[x:x + self.batch_size] + batch = data_fetcher.get_batch(sublist) + + samples_handled += len(sublist) + + frameworks_out = [] + fw_accuracy = [] + for i in range(len(frameworks)): + start = time.time() + out = frameworks[i].get_output(batch) + end = time.time() + correct_answers[i] += get_correct_answers(sublist, self.img_classes, out) + fw_accuracy.append(100 * correct_answers[i] / float(samples_handled)) + frameworks_out.append(out) + inference_time[i] += end - start + print >> self.log, samples_handled, 'Accuracy for', frameworks[i].get_name() + ':', fw_accuracy[i] + print >> self.log, "Inference time, ms ", \ + frameworks[i].get_name(), inference_time[i] / samples_handled * 1000 + + for i in range(1, len(frameworks)): + log_str = frameworks[0].get_name() + " vs " + frameworks[i].get_name() + ':' + diff = np.abs(frameworks_out[0] - frameworks_out[i]) + l1_diff = np.sum(diff) / diff.size + print >> self.log, samples_handled, "L1 difference", log_str, l1_diff + blobs_l1_diff[i] += l1_diff + blobs_l1_diff_count[i] += 1 + if np.max(diff) > blobs_l_inf_diff[i]: + blobs_l_inf_diff[i] = np.max(diff) + print >> self.log, samples_handled, "L_INF difference", log_str, blobs_l_inf_diff[i] + + self.log.flush() + + for i in range(1, len(blobs_l1_diff)): + log_str = frameworks[0].get_name() + " vs " + frameworks[i].get_name() + ':' + print >> self.log, 'Final l1 diff', log_str, blobs_l1_diff[i] / blobs_l1_diff_count[i] + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--imgs_dir", help="path to ImageNet validation subset images dir, ILSVRC2012_img_val dir") + parser.add_argument("--img_cls_file", help="path to file with classes ids for images, val.txt file from this " + "archive: http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz") + parser.add_argument("--prototxt", help="path to caffe prototxt, download it here: " + "https://github.com/BVLC/caffe/blob/master/models/bvlc_alexnet/deploy.prototxt") + parser.add_argument("--caffemodel", help="path to caffemodel file, download it here: " + "http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel") + parser.add_argument("--log", help="path to logging file") + parser.add_argument("--mean", help="path to ImageNet mean blob caffe file, imagenet_mean.binaryproto file from" + "this archive: http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz") + parser.add_argument("--batch_size", help="size of images in batch", default=1000) + parser.add_argument("--frame_size", help="size of input image", default=227) + parser.add_argument("--in_blob", help="name for input blob", default='data') + parser.add_argument("--out_blob", help="name for output blob", default='prob') + args = parser.parse_args() + + data_fetcher = MeanBlobFetch(args.frame_size, args.mean, args.imgs_dir) + + frameworks = [CaffeModel(args.prototxt, args.caffemodel, args.in_blob, args.out_blob), + DnnCaffeModel(args.prototxt, args.caffemodel, '', args.out_blob)] + + acc_eval = ClsAccEvaluation(args.log, args.img_cls_file, args.batch_size) + acc_eval.process(frameworks, data_fetcher) diff --git a/modules/dnn/test/imagenet_cls_test_googlenet.py b/modules/dnn/test/imagenet_cls_test_googlenet.py new file mode 100644 index 0000000000..210b740ff9 --- /dev/null +++ b/modules/dnn/test/imagenet_cls_test_googlenet.py @@ -0,0 +1,43 @@ +import numpy as np +import sys +import os +import argparse +from imagenet_cls_test_alexnet import MeanChannelsFetch, CaffeModel, DnnCaffeModel, ClsAccEvaluation +# sys.path.append('') +sys.path.append('/home/arrybn/git/caffe/python') +try: + import caffe +except ImportError: + raise ImportError('Can\'t find caffe. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to git/caffe/python dir') +# sys.path.append('') +sys.path.append('/home/arrybn/build/opencv_w_contrib/lib') +try: + import cv2 as cv +except ImportError: + raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to opencv_build_dir/lib dir') + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--imgs_dir", help="path to ImageNet validation subset images dir, ILSVRC2012_img_val dir") + parser.add_argument("--img_cls_file", help="path to file with classes ids for images, val.txt file from this " + "archive: http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz") + parser.add_argument("--prototxt", help="path to caffe prototxt, download it here: " + "https://github.com/BVLC/caffe/blob/master/models/bvlc_alexnet/deploy.prototxt") + parser.add_argument("--caffemodel", help="path to caffemodel file, download it here: " + "http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel") + parser.add_argument("--log", help="path to logging file") + parser.add_argument("--batch_size", help="size of images in batch", default=500, type=int) + parser.add_argument("--frame_size", help="size of input image", default=224, type=int) + parser.add_argument("--in_blob", help="name for input blob", default='data') + parser.add_argument("--out_blob", help="name for output blob", default='prob') + args = parser.parse_args() + + data_fetcher = MeanChannelsFetch(args.frame_size, args.imgs_dir) + + frameworks = [CaffeModel(args.prototxt, args.caffemodel, args.in_blob, args.out_blob), + DnnCaffeModel(args.prototxt, args.caffemodel, '', args.out_blob)] + + acc_eval = ClsAccEvaluation(args.log, args.img_cls_file, args.batch_size) + acc_eval.process(frameworks, data_fetcher) diff --git a/modules/dnn/test/imagenet_cls_test_inception.py b/modules/dnn/test/imagenet_cls_test_inception.py new file mode 100644 index 0000000000..dc4b1ac846 --- /dev/null +++ b/modules/dnn/test/imagenet_cls_test_inception.py @@ -0,0 +1,79 @@ +import numpy as np +import sys +import os +import argparse +import tensorflow as tf +from tensorflow.python.platform import gfile +from imagenet_cls_test_alexnet import MeanValueFetch, DnnCaffeModel, Framework, ClsAccEvaluation +# sys.path.append('') +sys.path.append('/home/arrybn/build/opencv_w_contrib/lib') +try: + import cv2 as cv +except ImportError: + raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to opencv_build_dir/lib dir') + +# If you've got an exception "Cannot load libmkl_avx.so or libmkl_def.so" or similar, try to export next variable +# before runnigng the script: +# LD_PRELOAD=/opt/intel/mkl/lib/intel64/libmkl_core.so:/opt/intel/mkl/lib/intel64/libmkl_sequential.so + + +class TensorflowModel(Framework): + sess = tf.Session + output = tf.Graph + + def __init__(self, model_file, in_blob_name, out_blob_name): + self.in_blob_name = in_blob_name + self.sess = tf.Session() + with gfile.FastGFile(model_file, 'rb') as f: + graph_def = tf.GraphDef() + graph_def.ParseFromString(f.read()) + self.sess.graph.as_default() + tf.import_graph_def(graph_def, name='') + self.output = self.sess.graph.get_tensor_by_name(out_blob_name + ":0") + + def get_name(self): + return 'Tensorflow' + + def get_output(self, input_blob): + assert len(input_blob.shape) == 4 + batch_tf = input_blob.transpose(0, 2, 3, 1) + out = self.sess.run(self.output, + {self.in_blob_name+':0': batch_tf}) + out = out[..., 1:1001] + return out + + +class DnnTfInceptionModel(DnnCaffeModel): + net = cv.dnn.Net() + + def __init__(self, model_file, in_blob_name, out_blob_name): + self.net = cv.dnn.readNetFromTensorflow(model_file) + self.in_blob_name = in_blob_name + self.out_blob_name = out_blob_name + + def get_output(self, input_blob): + return super(DnnTfInceptionModel, self).get_output(input_blob)[..., 1:1001] + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--imgs_dir", help="path to ImageNet validation subset images dir, ILSVRC2012_img_val dir") + parser.add_argument("--img_cls_file", help="path to file with classes ids for images, download it here:" + "https://github.com/opencv/opencv_extra/tree/master/testdata/dnn/img_classes_inception.txt") + parser.add_argument("--model", help="path to tensorflow model, download it here:" + "https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip") + parser.add_argument("--log", help="path to logging file") + parser.add_argument("--batch_size", help="size of images in batch", default=1) + parser.add_argument("--frame_size", help="size of input image", default=224) + parser.add_argument("--in_blob", help="name for input blob", default='input') + parser.add_argument("--out_blob", help="name for output blob", default='softmax2') + args = parser.parse_args() + + data_fetcher = MeanValueFetch(args.frame_size, args.imgs_dir, True) + + frameworks = [TensorflowModel(args.model, args.in_blob, args.out_blob), + DnnTfInceptionModel(args.model, '', args.out_blob)] + + acc_eval = ClsAccEvaluation(args.log, args.img_cls_file, args.batch_size) + acc_eval.process(frameworks, data_fetcher) diff --git a/modules/dnn/test/npy_blob.hpp b/modules/dnn/test/npy_blob.hpp new file mode 100644 index 0000000000..89bd24073b --- /dev/null +++ b/modules/dnn/test/npy_blob.hpp @@ -0,0 +1,65 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_DNN_TEST_NPY_BLOB_HPP__ +#define __OPENCV_DNN_TEST_NPY_BLOB_HPP__ +#include "test_precomp.hpp" +#include "cnpy.h" + +namespace cv +{ + +inline Mat blobFromNPY(const String &path) +{ + cnpy::NpyArray npyBlob = cnpy::npy_load(path.c_str()); + Mat blob = Mat((int)npyBlob.shape.size(), (int*)&npyBlob.shape[0], CV_32F, npyBlob.data).clone(); + npyBlob.destruct(); + return blob; +} + +inline void saveBlobToNPY(const Mat &blob, const String &path) +{ + cnpy::npy_save(path.c_str(), blob.ptr(), (unsigned*)&blob.size.p[0], blob.dims); +} + +} + +#endif diff --git a/modules/dnn/test/pascal_semsegm_test_fcn.py b/modules/dnn/test/pascal_semsegm_test_fcn.py new file mode 100644 index 0000000000..2a16c72e53 --- /dev/null +++ b/modules/dnn/test/pascal_semsegm_test_fcn.py @@ -0,0 +1,225 @@ +from abc import ABCMeta, abstractmethod +import numpy as np +import sys +import argparse +import time + +from imagenet_cls_test_alexnet import CaffeModel, DnnCaffeModel +sys.path.append('/home/arrybn/build/opencv_w_contrib/lib') +try: + import cv2 as cv +except ImportError: + raise ImportError('Can\'t find opencv. If you\'ve built it from sources without installation, ' + 'uncomment the line before and insert there path to opencv_build_dir/lib dir') + + +def get_metrics(conf_mat): + pix_accuracy = np.trace(conf_mat) / np.sum(conf_mat) + t = np.sum(conf_mat, 1) + num_cl = np.count_nonzero(t) + assert num_cl + mean_accuracy = np.sum(np.nan_to_num(np.divide(np.diagonal(conf_mat), t))) / num_cl + col_sum = np.sum(conf_mat, 0) + mean_iou = np.sum( + np.nan_to_num(np.divide(np.diagonal(conf_mat), (t + col_sum - np.diagonal(conf_mat))))) / num_cl + return pix_accuracy, mean_accuracy, mean_iou + + +def eval_segm_result(net_out): + assert type(net_out) is np.ndarray + assert len(net_out.shape) == 4 + + channels_dim = 1 + y_dim = channels_dim + 1 + x_dim = y_dim + 1 + res = np.zeros(net_out.shape).astype(np.int) + for i in range(net_out.shape[y_dim]): + for j in range(net_out.shape[x_dim]): + max_ch = np.argmax(net_out[..., i, j]) + res[0, max_ch, i, j] = 1 + return res + + +def get_conf_mat(gt, prob): + assert type(gt) is np.ndarray + assert type(prob) is np.ndarray + + conf_mat = np.zeros((gt.shape[0], gt.shape[0])) + for ch_gt in range(conf_mat.shape[0]): + gt_channel = gt[ch_gt, ...] + for ch_pr in range(conf_mat.shape[1]): + prob_channel = prob[ch_pr, ...] + conf_mat[ch_gt][ch_pr] = np.count_nonzero(np.multiply(gt_channel, prob_channel)) + return conf_mat + + +class MeanChannelsPreproc: + def __init__(self): + pass + + @staticmethod + def process(img): + image_data = np.array(img).transpose(2, 0, 1).astype(np.float32) + mean = np.ones(image_data.shape) + mean[0] *= 104 + mean[1] *= 117 + mean[2] *= 123 + image_data -= mean + image_data = np.expand_dims(image_data, 0) + return image_data + + +class DatasetImageFetch(object): + __metaclass__ = ABCMeta + data_prepoc = object + + @abstractmethod + def __iter__(self): + pass + + @abstractmethod + def next(self): + pass + + @staticmethod + def pix_to_c(pix): + return pix[0] * 256 * 256 + pix[1] * 256 + pix[2] + + @staticmethod + def color_to_gt(color_img, colors): + num_classes = len(colors) + gt = np.zeros((num_classes, color_img.shape[0], color_img.shape[1])).astype(np.int) + for img_y in range(color_img.shape[0]): + for img_x in range(color_img.shape[1]): + c = DatasetImageFetch.pix_to_c(color_img[img_y][img_x]) + if c in colors: + cls = colors.index(c) + gt[cls][img_y][img_x] = 1 + return gt + + +class PASCALDataFetch(DatasetImageFetch): + img_dir = '' + segm_dir = '' + names = [] + colors = [] + i = 0 + + def __init__(self, img_dir, segm_dir, names_file, segm_cls_colors_file, preproc): + self.img_dir = img_dir + self.segm_dir = segm_dir + self.colors = self.read_colors(segm_cls_colors_file) + self.data_prepoc = preproc + self.i = 0 + + with open(names_file) as f: + for l in f.readlines(): + self.names.append(l.rstrip()) + + @staticmethod + def read_colors(img_classes_file): + result = [] + with open(img_classes_file) as f: + for l in f.readlines(): + color = np.array(map(int, l.split()[1:])) + result.append(DatasetImageFetch.pix_to_c(color)) + return result + + def __iter__(self): + return self + + def next(self): + if self.i < len(self.names): + name = self.names[self.i] + self.i += 1 + segm_file = self.segm_dir + name + ".png" + img_file = self.img_dir + name + ".jpg" + gt = self.color_to_gt(cv.imread(segm_file, cv.IMREAD_COLOR)[:, :, ::-1], self.colors) + img = self.data_prepoc.process(cv.imread(img_file, cv.IMREAD_COLOR)[:, :, ::-1]) + return img, gt + else: + self.i = 0 + raise StopIteration + + def get_num_classes(self): + return len(self.colors) + + +class SemSegmEvaluation: + log = file + + def __init__(self, log_path,): + self.log = open(log_path, 'w') + + def process(self, frameworks, data_fetcher): + samples_handled = 0 + + conf_mats = [np.zeros((data_fetcher.get_num_classes(), data_fetcher.get_num_classes())) for i in range(len(frameworks))] + blobs_l1_diff = [0] * len(frameworks) + blobs_l1_diff_count = [0] * len(frameworks) + blobs_l_inf_diff = [sys.float_info.min] * len(frameworks) + inference_time = [0.0] * len(frameworks) + + for in_blob, gt in data_fetcher: + frameworks_out = [] + samples_handled += 1 + for i in range(len(frameworks)): + start = time.time() + out = frameworks[i].get_output(in_blob) + end = time.time() + segm = eval_segm_result(out) + conf_mats[i] += get_conf_mat(gt, segm[0]) + frameworks_out.append(out) + inference_time[i] += end - start + + pix_acc, mean_acc, miou = get_metrics(conf_mats[i]) + + name = frameworks[i].get_name() + print >> self.log, samples_handled, 'Pixel accuracy, %s:' % name, 100 * pix_acc + print >> self.log, samples_handled, 'Mean accuracy, %s:' % name, 100 * mean_acc + print >> self.log, samples_handled, 'Mean IOU, %s:' % name, 100 * miou + print >> self.log, "Inference time, ms ", \ + frameworks[i].get_name(), inference_time[i] / samples_handled * 1000 + + for i in range(1, len(frameworks)): + log_str = frameworks[0].get_name() + " vs " + frameworks[i].get_name() + ':' + diff = np.abs(frameworks_out[0] - frameworks_out[i]) + l1_diff = np.sum(diff) / diff.size + print >> self.log, samples_handled, "L1 difference", log_str, l1_diff + blobs_l1_diff[i] += l1_diff + blobs_l1_diff_count[i] += 1 + if np.max(diff) > blobs_l_inf_diff[i]: + blobs_l_inf_diff[i] = np.max(diff) + print >> self.log, samples_handled, "L_INF difference", log_str, blobs_l_inf_diff[i] + + self.log.flush() + + for i in range(1, len(blobs_l1_diff)): + log_str = frameworks[0].get_name() + " vs " + frameworks[i].get_name() + ':' + print >> self.log, 'Final l1 diff', log_str, blobs_l1_diff[i] / blobs_l1_diff_count[i] + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--imgs_dir", help="path to PASCAL VOC 2012 images dir, data/VOC2012/JPEGImages") + parser.add_argument("--segm_dir", help="path to PASCAL VOC 2012 segmentation dir, data/VOC2012/SegmentationClass/") + parser.add_argument("--val_names", help="path to file with validation set image names, download it here: " + "https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/data/pascal/seg11valid.txt") + parser.add_argument("--cls_file", help="path to file with colors for classes, download it here: " + "https://github.com/opencv/opencv_contrib/blob/master/modules/dnn/samples/pascal-classes.txt") + parser.add_argument("--prototxt", help="path to caffe prototxt, download it here: " + "https://github.com/opencv/opencv_contrib/blob/master/modules/dnn/samples/fcn8s-heavy-pascal.prototxt") + parser.add_argument("--caffemodel", help="path to caffemodel file, download it here: " + "http://dl.caffe.berkeleyvision.org/fcn8s-heavy-pascal.caffemodel") + parser.add_argument("--log", help="path to logging file") + parser.add_argument("--in_blob", help="name for input blob", default='data') + parser.add_argument("--out_blob", help="name for output blob", default='score') + args = parser.parse_args() + + prep = MeanChannelsPreproc() + df = PASCALDataFetch(args.imgs_dir, args.segm_dir, args.val_names, args.cls_file, prep) + + fw = [CaffeModel(args.prototxt, args.caffemodel, args.in_blob, args.out_blob, True), + DnnCaffeModel(args.prototxt, args.caffemodel, '', args.out_blob)] + + segm_eval = SemSegmEvaluation(args.log) + segm_eval.process(fw, df) diff --git a/modules/dnn/test/test_caffe_importer.cpp b/modules/dnn/test/test_caffe_importer.cpp new file mode 100644 index 0000000000..75c6bb137b --- /dev/null +++ b/modules/dnn/test/test_caffe_importer.cpp @@ -0,0 +1,160 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "test_precomp.hpp" +#include "npy_blob.hpp" +#include + +namespace cvtest +{ + +using namespace cv; +using namespace cv::dnn; + +template +static std::string _tf(TString filename) +{ + return (getOpenCVExtraDir() + "/dnn/") + filename; +} + +TEST(Test_Caffe, read_gtsrb) +{ + Net net; + { + Ptr importer = createCaffeImporter(_tf("gtsrb.prototxt"), ""); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } +} + +TEST(Test_Caffe, read_googlenet) +{ + Net net; + { + Ptr importer = createCaffeImporter(_tf("bvlc_googlenet.prototxt"), ""); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } +} + +TEST(Reproducibility_AlexNet, Accuracy) +{ + Net net; + { + const string proto = findDataFile("dnn/bvlc_alexnet.prototxt", false); + const string model = findDataFile("dnn/bvlc_alexnet.caffemodel", false); + Ptr importer = createCaffeImporter(proto, model); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat sample = imread(_tf("grace_hopper_227.png")); + ASSERT_TRUE(!sample.empty()); + + Size inputSize(227, 227); + + if (sample.size() != inputSize) + resize(sample, sample, inputSize); + + net.setInput(blobFromImage(sample), "data"); + Mat out = net.forward("prob"); + Mat ref = blobFromNPY(_tf("caffe_alexnet_prob.npy")); + normAssert(ref, out); +} + +#if !defined(_WIN32) || defined(_WIN64) +TEST(Reproducibility_FCN, Accuracy) +{ + Net net; + { + const string proto = findDataFile("dnn/fcn8s-heavy-pascal.prototxt", false); + const string model = findDataFile("dnn/fcn8s-heavy-pascal.caffemodel", false); + Ptr importer = createCaffeImporter(proto, model); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat sample = imread(_tf("street.png")); + ASSERT_TRUE(!sample.empty()); + + Size inputSize(500, 500); + if (sample.size() != inputSize) + resize(sample, sample, inputSize); + + std::vector layerIds; + std::vector weights, blobs; + net.getMemoryConsumption(shape(1,3,227,227), layerIds, weights, blobs); + + net.setInput(blobFromImage(sample), "data"); + Mat out = net.forward("score"); + Mat ref = blobFromNPY(_tf("caffe_fcn8s_prob.npy")); + normAssert(ref, out); +} +#endif + +TEST(Reproducibility_SSD, Accuracy) +{ + Net net; + { + const string proto = findDataFile("dnn/ssd_vgg16.prototxt", false); + const string model = findDataFile("dnn/VGG_ILSVRC2016_SSD_300x300_iter_440000.caffemodel", false); + Ptr importer = createCaffeImporter(proto, model); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat sample = imread(_tf("street.png")); + ASSERT_TRUE(!sample.empty()); + + if (sample.channels() == 4) + cvtColor(sample, sample, COLOR_BGRA2BGR); + + sample.convertTo(sample, CV_32F); + resize(sample, sample, Size(300, 300)); + + Mat in_blob = blobFromImage(sample); + net.setInput(in_blob, "data"); + Mat out = net.forward("detection_out"); + + Mat ref = blobFromNPY(_tf("ssd_out.npy")); + normAssert(ref, out); +} +} diff --git a/modules/dnn/test/test_common.hpp b/modules/dnn/test/test_common.hpp new file mode 100644 index 0000000000..a436daece1 --- /dev/null +++ b/modules/dnn/test/test_common.hpp @@ -0,0 +1,60 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef __OPENCV_TEST_COMMON_HPP__ +#define __OPENCV_TEST_COMMON_HPP__ + +inline const std::string &getOpenCVExtraDir() +{ + return cvtest::TS::ptr()->get_data_path(); +} + +inline void normAssert(cv::InputArray ref, cv::InputArray test, const char *comment = "", + double l1 = 0.00001, double lInf = 0.0001) +{ + double normL1 = cvtest::norm(ref, test, cv::NORM_L1) / ref.getMat().total(); + EXPECT_LE(normL1, l1) << comment; + + double normInf = cvtest::norm(ref, test, cv::NORM_INF); + EXPECT_LE(normInf, lInf) << comment; +} + +#endif diff --git a/modules/dnn/test/test_googlenet.cpp b/modules/dnn/test/test_googlenet.cpp new file mode 100644 index 0000000000..e97281b3d1 --- /dev/null +++ b/modules/dnn/test/test_googlenet.cpp @@ -0,0 +1,107 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "test_precomp.hpp" +#include "npy_blob.hpp" +#include +#include + +namespace cvtest +{ + +using namespace cv; +using namespace cv::dnn; + +template +static std::string _tf(TString filename) +{ + return (getOpenCVExtraDir() + "/dnn/") + filename; +} + +static void launchGoogleNetTest() +{ + Net net; + { + const string proto = findDataFile("dnn/bvlc_googlenet.prototxt", false); + const string model = findDataFile("dnn/bvlc_googlenet.caffemodel", false); + Ptr importer = createCaffeImporter(proto, model); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + std::vector inpMats; + inpMats.push_back( imread(_tf("googlenet_0.png")) ); + inpMats.push_back( imread(_tf("googlenet_1.png")) ); + ASSERT_TRUE(!inpMats[0].empty() && !inpMats[1].empty()); + + net.setInput(blobFromImages(inpMats), "data"); + Mat out = net.forward("prob"); + + Mat ref = blobFromNPY(_tf("googlenet_prob.npy")); + normAssert(out, ref); + + std::vector blobsNames; + blobsNames.push_back("conv1/7x7_s2"); + blobsNames.push_back("conv1/relu_7x7"); + blobsNames.push_back("inception_4c/1x1"); + blobsNames.push_back("inception_4c/relu_1x1"); + std::vector outs; + Mat in = blobFromImage(inpMats[0]); + net.setInput(in, "data"); + net.forward(outs, blobsNames); + CV_Assert(outs.size() == blobsNames.size()); + + for (int i = 0; i < blobsNames.size(); i++) + { + std::string filename = blobsNames[i]; + std::replace( filename.begin(), filename.end(), '/', '#'); + Mat ref = blobFromNPY(_tf("googlenet_" + filename + ".npy")); + + normAssert(outs[i], ref, "", 1E-4, 1E-2); + } +} + +TEST(Reproducibility_GoogLeNet, Accuracy) +{ + launchGoogleNetTest(); +} + +} diff --git a/modules/dnn/test/test_halide_layers.cpp b/modules/dnn/test/test_halide_layers.cpp new file mode 100644 index 0000000000..c572a84714 --- /dev/null +++ b/modules/dnn/test/test_halide_layers.cpp @@ -0,0 +1,626 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +// This tests doesn't require any external data. They just compare outputs of +// layers using different computation backends. Input and parameters are random. + +namespace cvtest +{ + +#ifdef HAVE_HALIDE +using namespace cv; +using namespace cv::dnn; +using namespace testing; + +static void test(LayerParams& params, Mat& input) +{ + randu(input, -1.0f, 1.0f); + + Net net; + int lid = net.addLayer(params.name, params.type, params); + net.connect(0, 0, lid, 0); + + net.setInput(input); + Mat outputDefault = net.forward(params.name).clone(); + + net.setPreferableBackend(DNN_BACKEND_HALIDE); + Mat outputHalide = net.forward(params.name).clone(); + normAssert(outputDefault, outputHalide); +} + +//////////////////////////////////////////////////////////////////////////////// +// Convolution +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > Convolution; +TEST_P(Convolution, Accuracy) +{ + int inChannels = get<0>(GetParam())[0]; + int outChannels = get<0>(GetParam())[1]; + int group = get<0>(GetParam())[2]; + Size inSize = get<1>(GetParam()); + Size kernel = get<2>(GetParam()); + Size stride = get<3>(GetParam()); + Size pad = get<4>(GetParam()); + Size dilation = get<5>(GetParam()); + bool hasBias = get<6>(GetParam()); + + Mat weights({outChannels, inChannels / group, kernel.height, kernel.width}, CV_32F); + randu(weights, -1.0f, 1.0f); + + LayerParams lp; + lp.set("kernel_w", kernel.width); + lp.set("kernel_h", kernel.height); + lp.set("pad_w", pad.width); + lp.set("pad_h", pad.height); + lp.set("stride_w", stride.width); + lp.set("stride_h", stride.height); + lp.set("dilation_w", dilation.width); + lp.set("dilation_h", dilation.height); + lp.set("num_output", outChannels); + lp.set("group", group); + lp.set("bias_term", hasBias); + lp.type = "Convolution"; + lp.name = "testLayer"; + lp.blobs.push_back(weights); + if (hasBias) + { + Mat bias({outChannels}, CV_32F); + randu(bias, -1.0f, 1.0f); + lp.blobs.push_back(bias); + } + Mat input({1, inChannels, inSize.height, inSize.width}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, Convolution, Combine( +/*in channels, out channels, group*/ + Values(Vec3i(6, 4, 1), Vec3i(6, 9, 1), + Vec3i(6, 4, 2), Vec3i(6, 9, 3)), +/*in size*/ Values(Size(5, 6)), +/*kernel*/ Values(Size(3, 1), Size(1, 3)), +/*stride*/ Values(Size(1, 1), Size(2, 2)), +/*pad*/ Values(Size(1, 0), Size(0, 1)), +/*dilation*/ Values(Size(1, 1), Size(2, 2)), +/*has bias*/ Bool() +)); + +//////////////////////////////////////////////////////////////////////////////// +// Deconvolution +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > Deconvolution; +TEST_P(Deconvolution, Accuracy) +{ + int inChannels = get<0>(GetParam())[0]; + int outChannels = get<0>(GetParam())[1]; + int group = get<0>(GetParam())[2]; + Size inSize = get<1>(GetParam()); + Size kernel = get<2>(GetParam()); + Size pad = get<3>(GetParam()); + Size dilation = get<4>(GetParam()); + Size stride = Size(get<5>(GetParam())[0], get<5>(GetParam())[1]); + Size adjPad = Size(get<5>(GetParam())[2], get<5>(GetParam())[3]); + bool hasBias = get<6>(GetParam()); + + Mat weights({outChannels, inChannels / group, kernel.height, kernel.width}, CV_32F); + randu(weights, -1.0f, 1.0f); + + LayerParams lp; + lp.set("kernel_w", kernel.width); + lp.set("kernel_h", kernel.height); + lp.set("pad_w", pad.width); + lp.set("pad_h", pad.height); + lp.set("stride_w", stride.width); + lp.set("stride_h", stride.height); + lp.set("dilation_w", dilation.width); + lp.set("dilation_h", dilation.height); + lp.set("adj_w", adjPad.width); + lp.set("adj_h", adjPad.height); + lp.set("num_output", outChannels); + lp.set("group", group); + lp.set("bias_term", hasBias); + lp.type = "Deconvolution"; + lp.name = "testLayer"; + lp.blobs.push_back(weights); + if (hasBias) + { + Mat bias({outChannels}, CV_32F); + randu(bias, -1.0f, 1.0f); + lp.blobs.push_back(bias); + } + Mat input({1, inChannels, inSize.height, inSize.width}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, Deconvolution, Combine( +/*in channels, out channels, group*/ + Values(Vec3i(6, 4, 1), Vec3i(6, 9, 1)), +/*in size*/ Values(Size(5, 6)), +/*kernel*/ Values(Size(3, 1), Size(1, 3)), +/*pad*/ Values(Size(1, 0), Size(0, 1)), +/*dilation*/ Values(Size(1, 1), Size(2, 2)), +/*stride, adj. pad*/ Values(Vec4i(1,1, 0,0), Vec4i(2,2, 1,0), Vec4i(1,2, 0,1)), +/*has bias*/ Bool() +)); + +//////////////////////////////////////////////////////////////////////////////// +// LRN +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > LRN; +TEST_P(LRN, Accuracy) +{ + int inChannels = get<0>(GetParam())[0]; + Size inSize = Size(get<0>(GetParam())[1], get<0>(GetParam())[2]); + int localSize = get<1>(GetParam()); + float alpha = get<2>(GetParam())[0]; + float beta = get<2>(GetParam())[1]; + float bias = get<2>(GetParam())[2]; + bool normBySize = get<3>(GetParam()); + std::string nrmType = get<4>(GetParam()); + + LayerParams lp; + lp.set("norm_region", nrmType); + lp.set("local_size", localSize); + lp.set("alpha", alpha); + lp.set("beta", beta); + lp.set("bias", bias); + lp.set("norm_by_size", normBySize); + lp.type = "LRN"; + lp.name = "testLayer"; + + Mat input({1, inChannels, inSize.height, inSize.width}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, LRN, Combine( +/*input ch,w,h*/ Values(Vec3i(6, 5, 8), Vec3i(7, 11, 6)), +/*local size*/ Values(3, 5), + Values(Vec3f(0.9f, 1.0f, 1.1f), Vec3f(0.9f, 1.1f, 1.0f), +/*alpha, beta,*/ Vec3f(1.0f, 0.9f, 1.1f), Vec3f(1.0f, 1.1f, 0.9f), +/*bias */ Vec3f(1.1f, 0.9f, 1.0f), Vec3f(1.1f, 1.0f, 0.9f)), +/*norm_by_size*/ Bool(), +/*norm_type*/ Values("ACROSS_CHANNELS", "WITHIN_CHANNEL") +)); + +//////////////////////////////////////////////////////////////////////////////// +// Average pooling +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > AvePooling; +TEST_P(AvePooling, Accuracy) +{ + int inChannels = get<0>(GetParam()); + Size outSize = get<1>(GetParam());; // Input size will be computed from parameters. + Size kernel = get<2>(GetParam()); + Size stride = get<3>(GetParam()); + + const int inWidth = (outSize.width - 1) * stride.width + kernel.width; + const int inHeight = (outSize.height - 1) * stride.height + kernel.height; + + LayerParams lp; + lp.set("pool", "ave"); + lp.set("kernel_w", kernel.width); + lp.set("kernel_h", kernel.height); + lp.set("stride_w", stride.width); + lp.set("stride_h", stride.height); + lp.type = "Pooling"; + lp.name = "testLayer"; + + Mat input({1, inChannels, inHeight, inWidth}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, AvePooling, Combine( +/*in channels*/ Values(3, 4), +/*out size*/ Values(Size(1, 1), Size(2, 2), Size(3, 2), Size(4, 7)), +/*kernel*/ Values(Size(1, 1), Size(2, 2), Size(3, 3), Size(3, 2)), +/*stride*/ Values(Size(1, 1), Size(2, 2), Size(3, 2)) +)); + +//////////////////////////////////////////////////////////////////////////////// +// Maximum pooling +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > MaxPooling; +TEST_P(MaxPooling, Accuracy) +{ + int inChannels = get<0>(GetParam()); + Size inSize = get<1>(GetParam()); + Size kernel = get<2>(GetParam()); + Size stride = get<3>(GetParam()); + Size pad = get<4>(GetParam()); + + LayerParams lp; + lp.set("pool", "max"); + lp.set("kernel_w", kernel.width); + lp.set("kernel_h", kernel.height); + lp.set("stride_w", stride.width); + lp.set("stride_h", stride.height); + lp.set("pad_w", pad.width); + lp.set("pad_h", pad.height); + lp.type = "Pooling"; + lp.name = "testLayer"; + + Mat input({1, inChannels, inSize.height, inSize.width}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, MaxPooling, Combine( +/*in channels*/ Values(3, 4), +/*in size*/ Values(Size(5, 5), Size(7, 6)), +/*kernel*/ Values(Size(2, 2), Size(3, 3), Size(3, 2)), +/*stride*/ Values(Size(1, 1), Size(2, 2), Size(3, 2)), +/*pad*/ Values(Size(0, 0), Size(1, 1), Size(0, 1)) +)); + +//////////////////////////////////////////////////////////////////////////////// +// Fully-connected +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > FullyConnected; +TEST_P(FullyConnected, Accuracy) +{ + int inChannels = get<0>(GetParam()); + Size inSize = get<1>(GetParam()); + int outChannels = get<2>(GetParam()); + bool hasBias = get<3>(GetParam()); + + Mat weights(outChannels, inChannels * inSize.height * inSize.width, CV_32F); + randu(weights, -1.0f, 1.0f); + + Mat bias(1, outChannels, CV_32F); + randu(bias, -1.0f, 1.0f); + + LayerParams lp; + lp.set("num_output", outChannels); + lp.set("bias_term", hasBias); + lp.blobs.push_back(weights); + lp.blobs.push_back(bias); + lp.type = "InnerProduct"; + lp.name = "testLayer"; + + Mat input({1, inChannels, inSize.height, inSize.width}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, FullyConnected, Combine( +/*in channels*/ Values(3, 4), +/*in size*/ Values(Size(5, 4), Size(4, 5), Size(1, 1)), +/*out channels*/ Values(3, 4), +/*has bias*/ Bool() +)); + +//////////////////////////////////////////////////////////////////////////////// +// SoftMax +//////////////////////////////////////////////////////////////////////////////// +typedef TestWithParam > SoftMax; +TEST_P(SoftMax, Accuracy) +{ + int inChannels = get<0>(GetParam()); + LayerParams lp; + lp.type = "SoftMax"; + lp.name = "testLayer"; + + Mat input({1, inChannels, 1, 1}, CV_32F); + test(lp, input); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, SoftMax, Values(3, 4, 5, 1024)); + +////////////////////////////////////////////////////////////////////////////// +// Max pooling - unpooling +////////////////////////////////////////////////////////////////////////////// +TEST(MaxPoolUnpool_Halide, Accuracy) +{ + LayerParams pool; + pool.set("pool", "max"); + pool.set("kernel_w", 2); + pool.set("kernel_h", 2); + pool.set("stride_w", 2); + pool.set("stride_h", 2); + pool.set("pad_w", 0); + pool.set("pad_h", 0); + pool.type = "Pooling"; + pool.name = "testPool"; + + LayerParams unpool; + unpool.set("pool_k_w", 2); + unpool.set("pool_k_h", 2); + unpool.set("pool_stride_w", 2); + unpool.set("pool_stride_h", 2); + unpool.set("pool_pad_w", 0); + unpool.set("pool_pad_h", 0); + unpool.type = "MaxUnpool"; + unpool.name = "testUnpool"; + + Net net; + int poolId = net.addLayer(pool.name, pool.type, pool); + net.connect(0, 0, poolId, 0); + + int unpoolId = net.addLayer(unpool.name, unpool.type, unpool); + net.connect(poolId, 0, unpoolId, 0); + net.connect(poolId, 1, unpoolId, 1); + + Mat input({1, 1, 4, 4}, CV_32F); + randu(input, -1.0f, 1.0f); + net.setInput(input); + Mat outputDefault = net.forward("testUnpool").clone(); + + net.setPreferableBackend(DNN_BACKEND_HALIDE); + net.setInput(input); + Mat outputHalide = net.forward("testUnpool").clone(); + normAssert(outputDefault, outputHalide); +} + +//////////////////////////////////////////////////////////////////////////////// +// AvePooling + in-place layers +//////////////////////////////////////////////////////////////////////////////// +static const int kNumChannels = 3; + +void testInPlaceActivation(LayerParams& lp) +{ + EXPECT_FALSE(lp.name.empty()); + + LayerParams pool; + pool.set("pool", "ave"); + pool.set("kernel_w", 2); + pool.set("kernel_h", 2); + pool.set("stride_w", 2); + pool.set("stride_h", 2); + pool.type = "Pooling"; + + Net net; + int poolId = net.addLayer(pool.name, pool.type, pool); + net.connect(0, 0, poolId, 0); + net.addLayerToPrev(lp.name, lp.type, lp); + + Mat input({1, kNumChannels, 10, 10}, CV_32F); + randu(input, -1.0f, 1.0f); + net.setInput(input); + Mat outputDefault = net.forward(lp.name).clone(); + + net.setInput(input); + net.setPreferableBackend(DNN_BACKEND_HALIDE); + Mat outputHalide = net.forward(lp.name).clone(); + normAssert(outputDefault, outputHalide); +} + +typedef TestWithParam > BatchNorm; +TEST_P(BatchNorm, Accuracy) +{ + bool hasWeights = get<0>(GetParam()); + bool hasBias = get<1>(GetParam()); + float epsilon = get<2>(GetParam()); + + LayerParams lp; + lp.set("has_weight", hasWeights); + lp.set("has_bias", hasBias); + lp.set("eps", epsilon); + lp.type = "BatchNorm"; + lp.name = "testLayer"; + + lp.blobs.reserve(4); + for (int i = 0; i < 3; ++i) + lp.blobs.push_back(Mat({kNumChannels}, CV_32F)); + if (hasBias || hasWeights) + lp.blobs.push_back(Mat({kNumChannels}, CV_32F)); + + for (Mat& m : lp.blobs) + randu(m, 0.0f, 1.0f); + + testInPlaceActivation(lp); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, BatchNorm, Combine( +/*has weights*/ Bool(), +/*has bias*/ Bool(), +/*epsilon*/ Values(1e-3f, 1e-5f) +)); + +typedef TestWithParam > ReLU; +TEST_P(ReLU, Accuracy) +{ + float negativeSlope = get<0>(GetParam()); + + LayerParams lp; + lp.set("negative_slope", negativeSlope); + lp.type = "ReLU"; + lp.name = "testLayer"; + testInPlaceActivation(lp); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, ReLU, Values( +/*negative slope*/ 2.0f, 0.3f, -0.1f +)); + +typedef TestWithParam > NoParamActivation; +TEST_P(NoParamActivation, Accuracy) +{ + LayerParams lp; + lp.type = get<0>(GetParam()); + lp.name = "testLayer"; + testInPlaceActivation(lp); +} +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, NoParamActivation, Values( +/*type*/ "TanH", "Sigmoid", "AbsVal", "BNLL" +)); + +typedef TestWithParam > Power; +TEST_P(Power, Accuracy) +{ + float power = get<0>(GetParam())[0]; + float scale = get<0>(GetParam())[1]; + float shift = get<0>(GetParam())[2]; + + LayerParams lp; + lp.set("power", power); + lp.set("scale", scale); + lp.set("shift", shift); + lp.type = "Power"; + lp.name = "testLayer"; + testInPlaceActivation(lp); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, Power, +/*power, scale, shift*/ Values(Vec3f(0.9f, 1.0f, 1.1f), Vec3f(0.9f, 1.1f, 1.0f), + Vec3f(1.0f, 0.9f, 1.1f), Vec3f(1.0f, 1.1f, 0.9f), + Vec3f(1.1f, 0.9f, 1.0f), Vec3f(1.1f, 1.0f, 0.9f)) +); + +TEST(ChannelsPReLU, Accuracy) +{ + LayerParams lp; + lp.type = "ChannelsPReLU"; + lp.name = "testLayer"; + lp.blobs.push_back(Mat({kNumChannels}, CV_32F)); + randu(lp.blobs[0], -1.0f, 1.0f); + + testInPlaceActivation(lp); +} + +typedef TestWithParam > Scale; +TEST_P(Scale, Accuracy) +{ + bool hasBias = get<0>(GetParam()); + + LayerParams lp; + lp.set("bias_term", hasBias); + lp.type = "Scale"; + lp.name = "testLayer"; + lp.blobs.push_back(Mat({kNumChannels}, CV_32F)); + randu(lp.blobs[0], -1.0f, 1.0f); + if (hasBias) + { + lp.blobs.push_back(Mat({kNumChannels}, CV_32F)); + randu(lp.blobs[1], -1.0f, 1.0f); + } + testInPlaceActivation(lp); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, Scale, Values(true, false)); + +//////////////////////////////////////////////////////////////////////////////// +// Concat layer +//////////////////////////////////////////////////////////////////////////////// +// +// input --- conv --- concat --- output +// `--- conv ----^ ^ ^ +// `---- ... ------' ' +// `-----------------' +typedef TestWithParam > Concat; +TEST_P(Concat, Accuracy) +{ + Vec3i inSize = get<0>(GetParam()); + Vec3i numChannels = get<1>(GetParam()); + + Net net; + + LayerParams concatParam; + concatParam.type = "Concat"; + concatParam.name = "testLayer"; + int concatId = net.addLayer(concatParam.name, concatParam.type, concatParam); + net.connect(0, 0, concatId, 0); + + for (int i = 0, n = numChannels.channels; i < n; ++i) + { + if (!numChannels[i]) + break; + + Mat weights({numChannels[i], inSize[0], 1, 1}, CV_32F); + randu(weights, -1.0f, 1.0f); + + LayerParams convParam; + convParam.set("kernel_w", 1); + convParam.set("kernel_h", 1); + convParam.set("num_output", numChannels[i]); + convParam.set("bias_term", false); + convParam.type = "Convolution"; + std::ostringstream ss; + ss << "convLayer" << i; + convParam.name = ss.str(); + convParam.blobs.push_back(weights); + + int convId = net.addLayer(convParam.name, convParam.type, convParam); + net.connect(0, 0, convId, 0); + net.connect(convId, 0, concatId, i + 1); + } + + Mat input({1, inSize[0], inSize[1], inSize[2]}, CV_32F); + randu(input, -1.0f, 1.0f); + + net.setInput(input); + Mat outputDefault = net.forward(concatParam.name).clone(); + + net.setPreferableBackend(DNN_BACKEND_HALIDE); + Mat outputHalide = net.forward(concatParam.name).clone(); + normAssert(outputDefault, outputHalide); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, Concat, Combine( +/*input size*/ Values(Vec3i(1, 4, 5), Vec3i(2, 8, 6)), +/*channels*/ Values(Vec3i(2, 0, 0), Vec3i(3, 4, 0), Vec3i(1, 6, 2)) +)); + +//////////////////////////////////////////////////////////////////////////////// +// Element-wise layers +//////////////////////////////////////////////////////////////////////////////// +// +// input --- conv --- eltwise --- output +// `--- conv ----^ ^ ^ +// `---- ... ------' ' +// `-----------------' +typedef TestWithParam > Eltwise; +TEST_P(Eltwise, Accuracy) +{ + Vec3i inSize = get<0>(GetParam()); + std::string op = get<1>(GetParam()); + int numConv = get<2>(GetParam()); + + Net net; + + LayerParams eltwiseParam; + eltwiseParam.type = "Eltwise"; + eltwiseParam.name = "testLayer"; + int eltwiseId = net.addLayer(eltwiseParam.name, eltwiseParam.type, eltwiseParam); + net.connect(0, 0, eltwiseId, 0); + + for (int i = 0; i < numConv; ++i) + { + Mat weights({inSize[0], inSize[0], 1, 1}, CV_32F); + randu(weights, -1.0f, 1.0f); + + LayerParams convParam; + convParam.set("kernel_w", 1); + convParam.set("kernel_h", 1); + convParam.set("num_output", inSize[0]); + convParam.set("bias_term", false); + convParam.type = "Convolution"; + std::ostringstream ss; + ss << "convLayer" << i; + convParam.name = ss.str(); + convParam.blobs.push_back(weights); + + int convId = net.addLayer(convParam.name, convParam.type, convParam); + net.connect(0, 0, convId, 0); + net.connect(convId, 0, eltwiseId, i + 1); + } + + Mat input({1, inSize[0], inSize[1], inSize[2]}, CV_32F); + randu(input, -1.0f, 1.0f); + + net.setInput(input); + Mat outputDefault = net.forward(eltwiseParam.name).clone(); + + net.setPreferableBackend(DNN_BACKEND_HALIDE); + Mat outputHalide = net.forward(eltwiseParam.name).clone(); + normAssert(outputDefault, outputHalide); +} + +INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, Eltwise, Combine( +/*input size*/ Values(Vec3i(1, 4, 5), Vec3i(2, 8, 6)), +/*operation*/ Values("prod", "sum", "max"), +/*num convs*/ Values(1, 2, 3) +)); +#endif // HAVE_HALIDE + +} // namespace cvtest diff --git a/modules/dnn/test/test_halide_nets.cpp b/modules/dnn/test/test_halide_nets.cpp new file mode 100644 index 0000000000..206a71c95a --- /dev/null +++ b/modules/dnn/test/test_halide_nets.cpp @@ -0,0 +1,173 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2017, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +namespace cvtest +{ + +#ifdef HAVE_HALIDE +using namespace cv; +using namespace dnn; + +static void loadNet(const std::string& weights, const std::string& proto, + const std::string& framework, Net* net) +{ + if (framework == "caffe") + { + *net = cv::dnn::readNetFromCaffe(proto, weights); + } + else if (framework == "torch") + { + *net = cv::dnn::readNetFromTorch(weights); + } + else if (framework == "tensorflow") + { + *net = cv::dnn::readNetFromTensorflow(weights); + } + else + CV_Error(Error::StsNotImplemented, "Unknown framework " + framework); +} + +static void test(const std::string& weights, const std::string& proto, + const std::string& scheduler, int inWidth, int inHeight, + const std::string& outputLayer, const std::string& framework, + int targetId, double l1 = 1e-5, double lInf = 1e-4) +{ + Mat input(inHeight, inWidth, CV_32FC3), outputDefault, outputHalide; + randu(input, 0.0f, 1.0f); + + Net netDefault, netHalide; + loadNet(weights, proto, framework, &netDefault); + loadNet(weights, proto, framework, &netHalide); + + netDefault.setInput(blobFromImage(input.clone(), 1.0f, Size(), Scalar(), false)); + outputDefault = netDefault.forward(outputLayer).clone(); + + netHalide.setInput(blobFromImage(input.clone(), 1.0f, Size(), Scalar(), false)); + netHalide.setPreferableBackend(DNN_BACKEND_HALIDE); + netHalide.setPreferableTarget(targetId); + netHalide.setHalideScheduler(scheduler); + outputHalide = netHalide.forward(outputLayer).clone(); + + normAssert(outputDefault, outputHalide, "First run", l1, lInf); + + // An extra test: change input. + input *= 0.1f; + netDefault.setInput(blobFromImage(input.clone(), 1.0, Size(), Scalar(), false)); + netHalide.setInput(blobFromImage(input.clone(), 1.0, Size(), Scalar(), false)); + + normAssert(outputDefault, outputHalide, "Second run", l1, lInf); + + // Swap backends. + netHalide.setPreferableBackend(DNN_BACKEND_DEFAULT); + netHalide.setPreferableTarget(DNN_TARGET_CPU); + outputDefault = netHalide.forward(outputLayer).clone(); + + netDefault.setPreferableBackend(DNN_BACKEND_HALIDE); + netDefault.setPreferableTarget(targetId); + netDefault.setHalideScheduler(scheduler); + outputHalide = netDefault.forward(outputLayer).clone(); + + normAssert(outputDefault, outputHalide, "Swap backends", l1, lInf); +} + +//////////////////////////////////////////////////////////////////////////////// +// CPU target +//////////////////////////////////////////////////////////////////////////////// +TEST(Reproducibility_GoogLeNet_Halide, Accuracy) +{ + test(findDataFile("dnn/bvlc_googlenet.caffemodel", false), + findDataFile("dnn/bvlc_googlenet.prototxt", false), + "", 227, 227, "prob", "caffe", DNN_TARGET_CPU); +}; + +TEST(Reproducibility_AlexNet_Halide, Accuracy) +{ + test(findDataFile("dnn/bvlc_alexnet.caffemodel", false), + findDataFile("dnn/bvlc_alexnet.prototxt", false), + findDataFile("dnn/halide_scheduler_alexnet.yml", false), + 227, 227, "prob", "caffe", DNN_TARGET_CPU); +}; + +TEST(Reproducibility_ResNet_50_Halide, Accuracy) +{ + test(findDataFile("dnn/ResNet-50-model.caffemodel", false), + findDataFile("dnn/ResNet-50-deploy.prototxt", false), + findDataFile("dnn/halide_scheduler_resnet_50.yml", false), + 224, 224, "prob", "caffe", DNN_TARGET_CPU); +}; + +TEST(Reproducibility_SqueezeNet_v1_1_Halide, Accuracy) +{ + test(findDataFile("dnn/squeezenet_v1_1.caffemodel", false), + findDataFile("dnn/squeezenet_v1_1.prototxt", false), + findDataFile("dnn/halide_scheduler_squeezenet_v1_1.yml", false), + 227, 227, "prob", "caffe", DNN_TARGET_CPU); +}; + +TEST(Reproducibility_Inception_5h_Halide, Accuracy) +{ + test(findDataFile("dnn/tensorflow_inception_graph.pb", false), "", + findDataFile("dnn/halide_scheduler_inception_5h.yml", false), + 224, 224, "softmax2", "tensorflow", DNN_TARGET_CPU); +}; + +TEST(Reproducibility_ENet_Halide, Accuracy) +{ + test(findDataFile("dnn/Enet-model-best.net", false), "", + findDataFile("dnn/halide_scheduler_enet.yml", false), + 512, 512, "l367_Deconvolution", "torch", DNN_TARGET_CPU, 2e-5, 0.15); +}; +//////////////////////////////////////////////////////////////////////////////// +// OpenCL target +//////////////////////////////////////////////////////////////////////////////// +TEST(Reproducibility_GoogLeNet_Halide_opencl, Accuracy) +{ + test(findDataFile("dnn/bvlc_googlenet.caffemodel", false), + findDataFile("dnn/bvlc_googlenet.prototxt", false), + "", 227, 227, "prob", "caffe", DNN_TARGET_OPENCL); +}; + +TEST(Reproducibility_AlexNet_Halide_opencl, Accuracy) +{ + test(findDataFile("dnn/bvlc_alexnet.caffemodel", false), + findDataFile("dnn/bvlc_alexnet.prototxt", false), + findDataFile("dnn/halide_scheduler_opencl_alexnet.yml", false), + 227, 227, "prob", "caffe", DNN_TARGET_OPENCL); +}; + +TEST(Reproducibility_ResNet_50_Halide_opencl, Accuracy) +{ + test(findDataFile("dnn/ResNet-50-model.caffemodel", false), + findDataFile("dnn/ResNet-50-deploy.prototxt", false), + findDataFile("dnn/halide_scheduler_opencl_resnet_50.yml", false), + 224, 224, "prob", "caffe", DNN_TARGET_OPENCL); +}; + +TEST(Reproducibility_SqueezeNet_v1_1_Halide_opencl, Accuracy) +{ + test(findDataFile("dnn/squeezenet_v1_1.caffemodel", false), + findDataFile("dnn/squeezenet_v1_1.prototxt", false), + findDataFile("dnn/halide_scheduler_opencl_squeezenet_v1_1.yml", false), + 227, 227, "prob", "caffe", DNN_TARGET_OPENCL); +}; + +TEST(Reproducibility_Inception_5h_Halide_opencl, Accuracy) +{ + test(findDataFile("dnn/tensorflow_inception_graph.pb", false), "", + findDataFile("dnn/halide_scheduler_opencl_inception_5h.yml", false), + 224, 224, "softmax2", "tensorflow", DNN_TARGET_OPENCL); +}; + +TEST(Reproducibility_ENet_Halide_opencl, Accuracy) +{ + test(findDataFile("dnn/Enet-model-best.net", false), "", + findDataFile("dnn/halide_scheduler_opencl_enet.yml", false), + 512, 512, "l367_Deconvolution", "torch", DNN_TARGET_OPENCL, 2e-5, 0.14); +}; +#endif // HAVE_HALIDE + +} // namespace cvtest diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp new file mode 100644 index 0000000000..14c984f189 --- /dev/null +++ b/modules/dnn/test/test_layers.cpp @@ -0,0 +1,417 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#include "test_precomp.hpp" +#include +#include +#include "npy_blob.hpp" +#include +#include +#include + +namespace cvtest +{ + +using namespace cv; +using namespace cv::dnn; + +template +static String _tf(TString filename) +{ + String basetestdir = getOpenCVExtraDir(); + size_t len = basetestdir.size(); + if(len > 0 && basetestdir[len-1] != '/' && basetestdir[len-1] != '\\') + return (basetestdir + "/dnn/layers") + filename; + return (basetestdir + "dnn/layers/") + filename; +} + +void runLayer(Ptr layer, std::vector &inpBlobs, std::vector &outBlobs) +{ + size_t i, ninputs = inpBlobs.size(); + std::vector inp_(ninputs); + std::vector inp(ninputs); + std::vector outp, intp; + std::vector inputs, outputs, internals; + + for( i = 0; i < ninputs; i++ ) + { + inp_[i] = inpBlobs[i].clone(); + inp[i] = &inp_[i]; + inputs.push_back(shape(inp_[i])); + } + + layer->getMemoryShapes(inputs, 0, outputs, internals); + for(int i = 0; i < outputs.size(); i++) + { + outp.push_back(Mat(outputs[i], CV_32F)); + } + for(int i = 0; i < internals.size(); i++) + { + intp.push_back(Mat(internals[i], CV_32F)); + } + + layer->finalize(inp, outp); + layer->forward(inp, outp, intp); + + size_t noutputs = outp.size(); + outBlobs.resize(noutputs); + for( i = 0; i < noutputs; i++ ) + outBlobs[i] = outp[i]; +} + + +void testLayerUsingCaffeModels(String basename, bool useCaffeModel = false, bool useCommonInputBlob = true) +{ + String prototxt = _tf(basename + ".prototxt"); + String caffemodel = _tf(basename + ".caffemodel"); + + String inpfile = (useCommonInputBlob) ? _tf("blob.npy") : _tf(basename + ".input.npy"); + String outfile = _tf(basename + ".npy"); + + cv::setNumThreads(cv::getNumberOfCPUs()); + + Net net; + { + Ptr importer = createCaffeImporter(prototxt, (useCaffeModel) ? caffemodel : String()); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat inp = blobFromNPY(inpfile); + Mat ref = blobFromNPY(outfile); + + net.setInput(inp, "input"); + Mat out = net.forward("output"); + + normAssert(ref, out); +} + +TEST(Layer_Test_Softmax, Accuracy) +{ + testLayerUsingCaffeModels("layer_softmax"); +} + +TEST(Layer_Test_LRN_spatial, Accuracy) +{ + testLayerUsingCaffeModels("layer_lrn_spatial"); +} + +TEST(Layer_Test_LRN_channels, Accuracy) +{ + testLayerUsingCaffeModels("layer_lrn_channels"); +} + +TEST(Layer_Test_Convolution, Accuracy) +{ + testLayerUsingCaffeModels("layer_convolution", true); +} + +TEST(Layer_Test_DeConvolution, Accuracy) +{ + testLayerUsingCaffeModels("layer_deconvolution", true, false); +} + +TEST(Layer_Test_InnerProduct, Accuracy) +{ + testLayerUsingCaffeModels("layer_inner_product", true); +} + +TEST(Layer_Test_Pooling_max, Accuracy) +{ + testLayerUsingCaffeModels("layer_pooling_max"); +} + +TEST(Layer_Test_Pooling_ave, Accuracy) +{ + testLayerUsingCaffeModels("layer_pooling_ave"); +} + +TEST(Layer_Test_MVN, Accuracy) +{ + testLayerUsingCaffeModels("layer_mvn"); +} + +void testReshape(const MatShape& inputShape, const MatShape& targetShape, + int axis = 0, int num_axes = -1, bool reorder_dims = false, + MatShape mask = MatShape()) +{ + LayerParams params; + params.set("axis", axis); + params.set("num_axes", num_axes); + params.set("reorder_dims", reorder_dims); + if (!mask.empty()) + { + params.set("dim", DictValue::arrayInt(&mask[0], mask.size())); + } + + Mat inp(inputShape.size(), &inputShape[0], CV_32F); + std::vector inpVec(1, inp); + std::vector outVec, intVec; + + Ptr rl = LayerFactory::createLayerInstance("Reshape", params); + runLayer(rl, inpVec, outVec); + + Mat& out = outVec[0]; + MatShape shape(out.size.p, out.size.p + out.dims); + EXPECT_EQ(shape, targetShape); +} + +TEST(Layer_Test_Reshape, Accuracy) +{ + { + int inp[] = {4, 3, 1, 2}; + int out[] = {4, 3, 2}; + testReshape(MatShape(inp, inp + 4), MatShape(out, out + 3), 2, 1); + } + { + int inp[] = {1, 128, 4, 4}; + int out[] = {1, 2048}; + int mask[] = {-1, 2048}; + testReshape(MatShape(inp, inp + 4), MatShape(out, out + 2), 0, -1, true, + MatShape(mask, mask + 2)); + } +} + +TEST(Layer_Test_BatchNorm, Accuracy) +{ + testLayerUsingCaffeModels("layer_batch_norm", true); +} + +TEST(Layer_Test_ReLU, Accuracy) +{ + testLayerUsingCaffeModels("layer_relu"); +} + +TEST(Layer_Test_Dropout, Accuracy) +{ + testLayerUsingCaffeModels("layer_dropout"); +} + +TEST(Layer_Test_Concat, Accuracy) +{ + testLayerUsingCaffeModels("layer_concat"); +} + +//template +//static void test_Layer_Concat() +//{ +// Matx21f a(1.f, 1.f), b(2.f, 2.f), c(3.f, 3.f); +// std::vector res(1), src = { Blob(XMat(a)), Blob(XMat(b)), Blob(XMat(c)) }; +// Blob ref(XMat(Matx23f(1.f, 2.f, 3.f, 1.f, 2.f, 3.f))); +// +// runLayer(ConcatLayer::create(1), src, res); +// normAssert(ref, res[0]); +//} +//TEST(Layer_Concat, Accuracy) +//{ +// test_Layer_Concat()); +//} +//OCL_TEST(Layer_Concat, Accuracy) +//{ +// OCL_ON(test_Layer_Concat()); +// ); +//} + +static void test_Reshape_Split_Slice_layers() +{ + Net net; + { + Ptr importer = createCaffeImporter(_tf("reshape_and_slice_routines.prototxt")); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat input(6, 12, CV_32F); + RNG rng(0); + rng.fill(input, RNG::UNIFORM, -1, 1); + + net.setInput(input, "input"); + Mat output = net.forward("output"); + + normAssert(input, output); +} +TEST(Layer_Test_Reshape_Split_Slice, Accuracy) +{ + test_Reshape_Split_Slice_layers(); +} + +class Layer_LSTM_Test : public ::testing::Test +{ +public: + int numInp, numOut; + Mat Wh, Wx, b; + Ptr layer; + std::vector inputs, outputs; + + Layer_LSTM_Test() {} + + void init(const MatShape &inpShape_, const MatShape &outShape_) + { + numInp = total(inpShape_); + numOut = total(outShape_); + + Wh = Mat::ones(4 * numOut, numOut, CV_32F); + Wx = Mat::ones(4 * numOut, numInp, CV_32F); + b = Mat::ones(4 * numOut, 1, CV_32F); + + layer = LSTMLayer::create(LayerParams()); + layer->setWeights(Wh, Wx, b); + layer->setOutShape(outShape_); + } +}; + +TEST_F(Layer_LSTM_Test, get_set_test) +{ + const int TN = 4; + MatShape inpShape = shape(5, 3, 2); + MatShape outShape = shape(3, 1, 2); + MatShape inpResShape = concat(shape(TN), inpShape); + MatShape outResShape = concat(shape(TN), outShape); + + init(inpShape, outShape); + layer->setProduceCellOutput(true); + layer->setUseTimstampsDim(false); + layer->setOutShape(outShape); + + Mat C((int)outResShape.size(), &outResShape[0], CV_32F); + randu(C, -1., 1.); + Mat H = C.clone(); + randu(H, -1., 1.); + + Mat inp((int)inpResShape.size(), &inpResShape[0], CV_32F); + randu(inp, -1., 1.); + + inputs.push_back(inp); + runLayer(layer, inputs, outputs); + + EXPECT_EQ(2u, outputs.size()); + + print(outResShape, "outResShape"); + print(shape(outputs[0]), "out0"); + print(shape(outputs[0]), "out1"); + + EXPECT_EQ(outResShape, shape(outputs[0])); + EXPECT_EQ(outResShape, shape(outputs[1])); + + EXPECT_EQ(0, layer->inputNameToIndex("x")); + EXPECT_EQ(0, layer->outputNameToIndex("h")); + EXPECT_EQ(1, layer->outputNameToIndex("c")); +} + +TEST(Layer_LSTM_Test_Accuracy_with_, CaffeRecurrent) +{ + Ptr layer = LSTMLayer::create(LayerParams()); + + Mat Wx = blobFromNPY(_tf("lstm.prototxt.w_0.npy")); + Mat Wh = blobFromNPY(_tf("lstm.prototxt.w_2.npy")); + Mat b = blobFromNPY(_tf("lstm.prototxt.w_1.npy")); + layer->setWeights(Wh, Wx, b); + + Mat inp = blobFromNPY(_tf("recurrent.input.npy")); + std::vector inputs(1, inp), outputs; + runLayer(layer, inputs, outputs); + + Mat h_t_reference = blobFromNPY(_tf("lstm.prototxt.h_1.npy")); + normAssert(h_t_reference, outputs[0]); +} + +TEST(Layer_RNN_Test_Accuracy_with_, CaffeRecurrent) +{ + Ptr layer = RNNLayer::create(LayerParams()); + + layer->setWeights( + blobFromNPY(_tf("rnn.prototxt.w_0.npy")), + blobFromNPY(_tf("rnn.prototxt.w_1.npy")), + blobFromNPY(_tf("rnn.prototxt.w_2.npy")), + blobFromNPY(_tf("rnn.prototxt.w_3.npy")), + blobFromNPY(_tf("rnn.prototxt.w_4.npy")) ); + + std::vector output, input(1, blobFromNPY(_tf("recurrent.input.npy"))); + runLayer(layer, input, output); + + Mat h_ref = blobFromNPY(_tf("rnn.prototxt.h_1.npy")); + normAssert(h_ref, output[0]); +} + + +class Layer_RNN_Test : public ::testing::Test +{ +public: + int nX, nH, nO, nT, nS; + Mat Whh, Wxh, bh, Who, bo; + Ptr layer; + + std::vector inputs, outputs; + + Layer_RNN_Test() + { + nT = 3; + nS = 5; + nX = 31; + nH = 64; + nO = 100; + + Whh = Mat::ones(nH, nH, CV_32F); + Wxh = Mat::ones(nH, nX, CV_32F); + bh = Mat::ones(nH, 1, CV_32F); + Who = Mat::ones(nO, nH, CV_32F); + bo = Mat::ones(nO, 1, CV_32F); + + layer = RNNLayer::create(LayerParams()); + layer->setProduceHiddenOutput(true); + layer->setWeights(Wxh, bh, Whh, Who, bo); + } +}; + +TEST_F(Layer_RNN_Test, get_set_test) +{ + int sz[] = { nT, nS, 1, nX }; + Mat inp(4, sz, CV_32F); + randu(inp, -1., 1.); + inputs.push_back(inp); + runLayer(layer, inputs, outputs); + + EXPECT_EQ(outputs.size(), 2u); + EXPECT_EQ(shape(outputs[0]), shape(nT, nS, nO)); + EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); +} + +} diff --git a/modules/dnn/test/test_main.cpp b/modules/dnn/test/test_main.cpp new file mode 100644 index 0000000000..ead7916a05 --- /dev/null +++ b/modules/dnn/test/test_main.cpp @@ -0,0 +1,20 @@ +#include "test_precomp.hpp" + +static const char* extraTestDataPath = +#ifdef WINRT + NULL; +#else + getenv("OPENCV_DNN_TEST_DATA_PATH"); +#endif + +CV_TEST_MAIN("", + extraTestDataPath ? (void)cvtest::addDataSearchPath(extraTestDataPath) : (void)0 +) + +namespace cvtest +{ + +using namespace cv; +using namespace cv::dnn; + +} diff --git a/modules/dnn/test/test_precomp.hpp b/modules/dnn/test/test_precomp.hpp new file mode 100644 index 0000000000..ee13ebe190 --- /dev/null +++ b/modules/dnn/test/test_precomp.hpp @@ -0,0 +1,62 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wmissing-declarations" +# if defined __clang__ || defined __APPLE__ +# pragma GCC diagnostic ignored "-Wmissing-prototypes" +# pragma GCC diagnostic ignored "-Wextra" +# endif +#endif + +#ifndef __OPENCV_TEST_PRECOMP_HPP__ +#define __OPENCV_TEST_PRECOMP_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/dnn.hpp" +#include "opencv2/highgui.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/ts.hpp" +#include +#include +#include "test_common.hpp" + +#endif diff --git a/modules/dnn/test/test_tf_importer.cpp b/modules/dnn/test/test_tf_importer.cpp new file mode 100644 index 0000000000..fbddc15f59 --- /dev/null +++ b/modules/dnn/test/test_tf_importer.cpp @@ -0,0 +1,74 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2016, Intel Corporation, all rights reserved. +// Third party copyrights are property of their respective owners. + +/* +Test for Tensorflow models loading +*/ + +#include "test_precomp.hpp" +#include "npy_blob.hpp" + +namespace cvtest +{ + +using namespace cv; +using namespace cv::dnn; + +template +static std::string _tf(TString filename) +{ + return (getOpenCVExtraDir() + "/dnn/") + filename; +} + +TEST(Test_TensorFlow, read_inception) +{ + Net net; + { + const string model = findDataFile("dnn/tensorflow_inception_graph.pb", false); + Ptr importer = createTensorflowImporter(model); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat sample = imread(_tf("grace_hopper_227.png")); + ASSERT_TRUE(!sample.empty()); + Mat input; + resize(sample, input, Size(224, 224)); + input -= 128; // mean sub + + Mat inputBlob = blobFromImage(input); + + net.setInput(inputBlob, "input"); + Mat out = net.forward("softmax2"); + + std::cout << out.dims << std::endl; +} + +TEST(Test_TensorFlow, inception_accuracy) +{ + Net net; + { + const string model = findDataFile("dnn/tensorflow_inception_graph.pb", false); + Ptr importer = createTensorflowImporter(model); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat sample = imread(_tf("grace_hopper_227.png")); + ASSERT_TRUE(!sample.empty()); + resize(sample, sample, Size(224, 224)); + Mat inputBlob = blobFromImage(sample); + + net.setInput(inputBlob, "input"); + Mat out = net.forward("softmax2"); + + Mat ref = blobFromNPY(_tf("tf_inception_prob.npy")); + + normAssert(ref, out); +} + +} diff --git a/modules/dnn/test/test_torch_importer.cpp b/modules/dnn/test/test_torch_importer.cpp new file mode 100644 index 0000000000..5fc3c076ba --- /dev/null +++ b/modules/dnn/test/test_torch_importer.cpp @@ -0,0 +1,207 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifdef ENABLE_TORCH_IMPORTER + +#include "test_precomp.hpp" +#include "npy_blob.hpp" +#include + +namespace cvtest +{ + +using namespace std; +using namespace testing; +using namespace cv; +using namespace cv::dnn; + +template +static std::string _tf(TStr filename, bool inTorchDir = true) +{ + String path = getOpenCVExtraDir() + "/dnn/"; + if (inTorchDir) + path += "torch/"; + path += filename; + return path; +} + +TEST(Torch_Importer, simple_read) +{ + Net net; + Ptr importer; + + ASSERT_NO_THROW( importer = createTorchImporter(_tf("net_simple_net.txt"), false) ); + ASSERT_TRUE( importer != NULL ); + importer->populateNet(net); +} + +static void runTorchNet(String prefix, String outLayerName = "", + bool check2ndBlob = false, bool isBinary = false) +{ + String suffix = (isBinary) ? ".dat" : ".txt"; + + Net net; + Ptr importer = createTorchImporter(_tf(prefix + "_net" + suffix), isBinary); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + + Mat inp, outRef; + ASSERT_NO_THROW( inp = readTorchBlob(_tf(prefix + "_input" + suffix), isBinary) ); + ASSERT_NO_THROW( outRef = readTorchBlob(_tf(prefix + "_output" + suffix), isBinary) ); + + if (outLayerName.empty()) + outLayerName = net.getLayerNames().back(); + + net.setInput(inp, "0"); + std::vector outBlobs; + net.forward(outBlobs, outLayerName); + normAssert(outRef, outBlobs[0]); + + if (check2ndBlob) + { + Mat out2 = outBlobs[1]; + Mat ref2 = readTorchBlob(_tf(prefix + "_output_2" + suffix), isBinary); + normAssert(out2, ref2); + } +} + +TEST(Torch_Importer, run_convolution) +{ + runTorchNet("net_conv"); +} + +TEST(Torch_Importer, run_pool_max) +{ + runTorchNet("net_pool_max", "", true); +} + +TEST(Torch_Importer, run_pool_ave) +{ + runTorchNet("net_pool_ave"); +} + +TEST(Torch_Importer, run_reshape) +{ + runTorchNet("net_reshape"); + runTorchNet("net_reshape_batch"); + runTorchNet("net_reshape_single_sample"); +} + +TEST(Torch_Importer, run_linear) +{ + runTorchNet("net_linear_2d"); +} + +TEST(Torch_Importer, run_paralel) +{ + runTorchNet("net_parallel", "l5_torchMerge"); +} + +TEST(Torch_Importer, run_concat) +{ + runTorchNet("net_concat", "l5_torchMerge"); +} + +TEST(Torch_Importer, run_deconv) +{ + runTorchNet("net_deconv"); +} + +TEST(Torch_Importer, run_batch_norm) +{ + runTorchNet("net_batch_norm"); +} + +TEST(Torch_Importer, net_prelu) +{ + runTorchNet("net_prelu"); +} + +TEST(Torch_Importer, net_cadd_table) +{ + runTorchNet("net_cadd_table"); +} + +TEST(Torch_Importer, net_softmax) +{ + runTorchNet("net_softmax"); + runTorchNet("net_softmax_spatial"); +} + +TEST(Torch_Importer, net_logsoftmax) +{ + runTorchNet("net_logsoftmax"); + runTorchNet("net_logsoftmax_spatial"); +} + +TEST(Torch_Importer, ENet_accuracy) +{ + Net net; + { + const string model = findDataFile("dnn/Enet-model-best.net", false); + Ptr importer = createTorchImporter(model, true); + ASSERT_TRUE(importer != NULL); + importer->populateNet(net); + } + + Mat sample = imread(_tf("street.png", false)); + Mat inputBlob = blobFromImage(sample, 1./255); + + net.setInput(inputBlob, ""); + Mat out = net.forward(); + Mat ref = blobFromNPY(_tf("torch_enet_prob.npy", false)); + // Due to numerical instability in Pooling-Unpooling layers (indexes jittering) + // thresholds for ENet must be changed. Accuracy of resuults was checked on + // Cityscapes dataset and difference in mIOU with Torch is 10E-4% + normAssert(ref, out, "", 0.00044, 0.44); + + const int N = 3; + for (int i = 0; i < N; i++) + { + net.setInput(inputBlob, ""); + Mat out = net.forward(); + normAssert(ref, out, "", 0.00044, 0.44); + } +} + +} + +#endif diff --git a/modules/dnn/tutorials/images/build_1.png b/modules/dnn/tutorials/images/build_1.png new file mode 100644 index 0000000000..855159e87d Binary files /dev/null and b/modules/dnn/tutorials/images/build_1.png differ diff --git a/modules/dnn/tutorials/images/build_2.png b/modules/dnn/tutorials/images/build_2.png new file mode 100644 index 0000000000..6741e8ab6d Binary files /dev/null and b/modules/dnn/tutorials/images/build_2.png differ diff --git a/modules/dnn/tutorials/images/build_3.png b/modules/dnn/tutorials/images/build_3.png new file mode 100644 index 0000000000..102d6e339e Binary files /dev/null and b/modules/dnn/tutorials/images/build_3.png differ diff --git a/modules/dnn/tutorials/images/build_4.png b/modules/dnn/tutorials/images/build_4.png new file mode 100644 index 0000000000..3ad4df8174 Binary files /dev/null and b/modules/dnn/tutorials/images/build_4.png differ diff --git a/modules/dnn/tutorials/images/build_5.png b/modules/dnn/tutorials/images/build_5.png new file mode 100644 index 0000000000..bd187c6fb6 Binary files /dev/null and b/modules/dnn/tutorials/images/build_5.png differ diff --git a/modules/dnn/tutorials/images/space_shuttle.jpg b/modules/dnn/tutorials/images/space_shuttle.jpg new file mode 100644 index 0000000000..412a919694 Binary files /dev/null and b/modules/dnn/tutorials/images/space_shuttle.jpg differ diff --git a/modules/dnn/tutorials/tutorial_dnn_build.markdown b/modules/dnn/tutorials/tutorial_dnn_build.markdown new file mode 100644 index 0000000000..36f0fecbf8 --- /dev/null +++ b/modules/dnn/tutorials/tutorial_dnn_build.markdown @@ -0,0 +1,68 @@ +Build opencv_contrib with dnn module {#tutorial_dnn_build} +==================================== + +Introduction +------------ +opencv_dnn module is placed in the secondary [opencv_contrib](https://github.com/opencv/opencv_contrib) repository, +which isn't distributed in binary form, therefore you need to build it manually. + +To do this you need to have installed: [CMake](http://www.cmake.org/download), git, and build system (*gcc* with *make* for Linux or *MS Visual Studio* for Windows) + +Steps +----- +-# Make any directory, for example **opencv_root** + +-# Clone [opencv](https://github.com/opencv/opencv) and [opencv_contrib](https://github.com/opencv/opencv_contrib) repos to the **opencv_root**. + You can do it in terminal like here: +@code +cd opencv_root +git clone https://github.com/opencv/opencv +git clone https://github.com/opencv/opencv_contrib +@endcode + +-# Run [CMake-gui] and set source and build directories: + + - Set source code directory to **opencv_root**/opencv; + + - Set binaries directory, for example, to **opencv_root**/build_opencv. + This directory will contain built libraries. + ![](images/build_1.png) + +-# Configure opencv: + - press *Configure*; + - choose the preferred project generator (Makefiles for Linux, MS Visual Studio for Windows); + - also you can set many opencv build options, for more details see @ref tutorial_linux_install. + ![](images/build_2.png) + +-# In the appeared list of build parameters find parameter `OPENCV_EXTRA_MODULES_PATH` and set it to the **opencv_root**/opencv_contrib. + ![](images/build_3.png) + +-# *Configure* the project again, and set build options of dnn module: + + - `BUILD_opencv_dnn` parameter must exist and be checked. + + - dnn module covers waste part of [Caffe](http://caffe.berkeleyvision.org) framework functionality. + However, to load Caffe networks libprotobuf is required. + You you can uncheck `BUILD_LIBPROTOBUF_FROM_SOURCES` flag to try use protobuf installed in your system. + Elsewise libpotobuf will be built from opencv sources. + + - You can additionally check `opencv_dnn_BUILD_TORCH_IMPORTER` parameter to build [Torch7](http://torch.ch/) importer. + It allows you to use networks, generated by [Torch7.nn](https://github.com/torch/nn/blob/master/README.md/) module. + ![](images/build_4.png) + +-# Press *Configure* and *Generate*. + ![](images/build_5.png) + +-# Build the generated project: + - If Makefiles generator on Unix was used, run the following in terminal: + @code + cd opencv_root/build_opencv + make all + @endcode + - If MS Visual Studio generator was used, then open OpenCV.sln from **opencv_root**/build_opencv folder in the Visual Studio, + and build it by choosing **Build** -> **Build Solution** menu or using **F7** short-cut. + +-# Now you can build own program by using libraries were built into **opencv_root**/build_opencv/lib. + See the following tutorials to learn how to create a program using OpenCV: + - @ref tutorial_windows_install + - @ref tutorial_linux_gcc_cmake \ No newline at end of file diff --git a/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown b/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown new file mode 100644 index 0000000000..01bfca1170 --- /dev/null +++ b/modules/dnn/tutorials/tutorial_dnn_googlenet.markdown @@ -0,0 +1,66 @@ +Load Caffe framework models {#tutorial_dnn_googlenet} +=========================== + +Introduction +------------ + +In this tutorial you will learn how to use opencv_dnn module for image classification by using +GoogLeNet trained network from [Caffe model zoo](http://caffe.berkeleyvision.org/model_zoo.html). + +We will demonstrate results of this example on the following picture. +![Buran space shuttle](images/space_shuttle.jpg) + +Source Code +----------- + +We will be using snippets from the example application, that can be downloaded [here](https://github.com/ludv1x/opencv_contrib/blob/master/modules/dnn/samples/caffe_googlenet.cpp). + +@include dnn/samples/caffe_googlenet.cpp + +Explanation +----------- + +-# Firstly, download GoogLeNet model files: + [bvlc_googlenet.prototxt ](https://raw.githubusercontent.com/ludv1x/opencv_contrib/master/modules/dnn/samples/bvlc_googlenet.prototxt) and + [bvlc_googlenet.caffemodel](http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel) + + Also you need file with names of [ILSVRC2012](http://image-net.org/challenges/LSVRC/2012/browse-synsets) classes: + [synset_words.txt](https://raw.githubusercontent.com/ludv1x/opencv_contrib/master/modules/dnn/samples/synset_words.txt). + + Put these files into working dir of this program example. + +-# Read and initialize network using path to .prototxt and .caffemodel files + @snippet dnn/samples/caffe_googlenet.cpp Read and initialize network + +-# Check that network was read successfully + @snippet dnn/samples/caffe_googlenet.cpp Check that network was read successfully + +-# Read input image and convert to the blob, acceptable by GoogleNet + @snippet dnn/samples/caffe_googlenet.cpp Prepare blob + Firstly, we resize the image and change its channel sequence order. + + Now image is actually a 3-dimensional array with 224x224x3 shape. + + Next, we convert the image to 4-dimensional blob (so-called batch) with 1x3x224x224 shape by using special cv::dnn::blobFromImages constructor. + +-# Pass the blob to the network + @snippet dnn/samples/caffe_googlenet.cpp Set input blob + In bvlc_googlenet.prototxt the network input blob named as "data", therefore this blob labeled as ".data" in opencv_dnn API. + + Other blobs labeled as "name_of_layer.name_of_layer_output". + +-# Make forward pass + @snippet dnn/samples/caffe_googlenet.cpp Make forward pass + During the forward pass output of each network layer is computed, but in this example we need output from "prob" layer only. + +-# Determine the best class + @snippet dnn/samples/caffe_googlenet.cpp Gather output + We put the output of "prob" layer, which contain probabilities for each of 1000 ILSVRC2012 image classes, to the `prob` blob. + And find the index of element with maximal value in this one. This index correspond to the class of the image. + +-# Print results + @snippet dnn/samples/caffe_googlenet.cpp Print results + For our image we get: +> Best class: #812 'space shuttle' +> +> Probability: 99.6378% \ No newline at end of file diff --git a/modules/dnn/tutorials/tutorial_dnn_halide.markdown b/modules/dnn/tutorials/tutorial_dnn_halide.markdown new file mode 100644 index 0000000000..b2a86c82f4 --- /dev/null +++ b/modules/dnn/tutorials/tutorial_dnn_halide.markdown @@ -0,0 +1,132 @@ +# How to enable Halide backend for improve efficiency {#tutorial_dnn_halide} + +## Introduction +This tutorial guidelines how to run your models in OpenCV deep learning module +using Halide language backend. Halide is an open-source project that let us +write image processing algorithms in well-readable format, schedule computations +according to specific device and evaluate it with a quite good efficiency. + +An official website of the Halide project: http://halide-lang.org/. + +## Efficiency comparison +Measured on Intel® Core™ i7-6700K CPU @ 4.00GHz x 8. + +Single image forward pass (in milliseconds): + +| Architecture | MKL backend | Halide backend | Speed Up ratio | +|-----------------:|------------:|---------------:|---------------:| +| AlexNet | 16.55 | 22.38 | x0.73 | +| ResNet-50 | 63.69 | 73.91 | x0.86 | +| SqueezeNet v1.1 | 10.11 | 8.21 | x1.23 | +| Inception-5h | 35.38 | 37.06 | x0.95 | +| ENet @ 3x512x256 | 82.26 | 41.21 | x1.99 | + +Scheduling directives might be found @ [opencv_extra/testdata/dnn](https://github.com/opencv/opencv_extra/tree/master/testdata/dnn). + +## Requirements +### LLVM compiler + +@note LLVM compilation might take a long time. + +- Download LLVM source code from http://releases.llvm.org/4.0.0/llvm-4.0.0.src.tar.xz. +Unpack it. Let **llvm_root** is a root directory of source code. + +- Create directory **llvm_root**/tools/clang + +- Download Clang with the same version as LLVM. In our case it will be from +http://releases.llvm.org/4.0.0/cfe-4.0.0.src.tar.xz. Unpack it into +**llvm_root**/tools/clang. Note that it should be a root for Clang source code. + +- Build LLVM on Linux +@code +cd llvm_root +mkdir build && cd build +cmake -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release .. +make -j4 +@endcode + +- Build LLVM on Windows (Developer Command Prompt) +@code +mkdir \\path-to-llvm-build\\ && cd \\path-to-llvm-build\\ +cmake.exe -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\\path-to-llvm-install\\ -G "Visual Studio 14 Win64" \\path-to-llvm-src\\ +MSBuild.exe /m:4 /t:Build /p:Configuration=Release .\\INSTALL.vcxproj +@endcode + +@note `\\path-to-llvm-build\\` and `\\path-to-llvm-install\\` are different directories. + +### Halide language. + +- Download source code from GitHub repository, https://github.com/halide/Halide +or using git. The root directory will be a **halide_root**. +@code +git clone https://github.com/halide/Halide.git +@endcode + +- Build Halide on Linux +@code +cd halide_root +mkdir build && cd build +cmake -DLLVM_DIR=llvm_root/build/lib/cmake/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_VERSION=40 -DWITH_TESTS=OFF -DWITH_APPS=OFF -DWITH_TUTORIALS=OFF .. +make -j4 +@endcode + +- Build Halide on Windows (Developer Command Prompt) +@code +cd halide_root +mkdir build && cd build +cmake.exe -DLLVM_DIR=\\path-to-llvm-install\\lib\\cmake\\llvm -DLLVM_VERSION=40 -DWITH_TESTS=OFF -DWITH_APPS=OFF -DWITH_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 14 Win64" .. +MSBuild.exe /m:4 /t:Build /p:Configuration=Release .\\ALL_BUILD.vcxproj +@endcode + +## Build OpenCV with Halide backend +When you build OpenCV add the following configuration flags: + +- `WITH_HALIDE` - enable Halide linkage + +- `HALIDE_ROOT_DIR` - path to Halide build directory + +How to build OpenCV with DNN module you may find in @ref tutorial_dnn_build. + +## Sample + +@include dnn/samples/squeezenet_halide.cpp + +## Explanation +Download Caffe model from SqueezeNet repository: [train_val.prototxt](https://github.com/DeepScale/SqueezeNet/blob/master/SqueezeNet_v1.1/train_val.prototxt) and [squeezenet_v1.1.caffemodel](https://github.com/DeepScale/SqueezeNet/blob/master/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel). + +Also you need file with names of [ILSVRC2012](http://image-net.org/challenges/LSVRC/2012/browse-synsets) classes: +[synset_words.txt](https://raw.githubusercontent.com/ludv1x/opencv_contrib/master/modules/dnn/samples/synset_words.txt). + +Put these files into working dir of this program example. + +-# Read and initialize network using path to .prototxt and .caffemodel files +@snippet dnn/samples/squeezenet_halide.cpp Read and initialize network + +-# Check that network was read successfully +@snippet dnn/samples/squeezenet_halide.cpp Check that network was read successfully + +-# Read input image and convert to the 4-dimensional blob, acceptable by SqueezeNet v1.1 +@snippet dnn/samples/squeezenet_halide.cpp Prepare blob + +-# Pass the blob to the network +@snippet dnn/samples/squeezenet_halide.cpp Set input blob + +-# Enable Halide backend for layers where it is implemented +@snippet dnn/samples/squeezenet_halide.cpp Enable Halide backend + +-# Make forward pass +@snippet dnn/samples/squeezenet_halide.cpp Make forward pass +Remember that the first forward pass after initialization require quite more +time that the next ones. It's because of runtime compilation of Halide pipelines +at the first invocation. + +-# Determine the best class +@snippet dnn/samples/squeezenet_halide.cpp Determine the best class + +-# Print results +@snippet dnn/samples/squeezenet_halide.cpp Print results +For our image we get: + +> Best class: #812 'space shuttle' +> +> Probability: 97.9812% diff --git a/modules/dnn/tutorials/tutorial_dnn_halide_scheduling.markdown b/modules/dnn/tutorials/tutorial_dnn_halide_scheduling.markdown new file mode 100644 index 0000000000..a43ab63e05 --- /dev/null +++ b/modules/dnn/tutorials/tutorial_dnn_halide_scheduling.markdown @@ -0,0 +1,82 @@ +# How to schedule your network for Halide backend {#tutorial_dnn_halide_scheduling} + +## Introduction +Halide code is the same for every device we use. But for achieving the satisfied +efficiency we should schedule computations properly. In this tutorial we describe +the ways to schedule your networks using Halide backend in OpenCV deep learning module. + +For better understanding of Halide scheduling you might want to read tutorials @ http://halide-lang.org/tutorials. + +If it's your first meeting with Halide in OpenCV, we recommend to start from @ref tutorial_dnn_halide. + +## Configuration files +You can schedule computations of Halide pipeline by writing textual configuration files. +It means that you can easily vectorize, parallelize and manage loops order of +layers computation. Pass path to file with scheduling directives for specific +device into ```cv::dnn::Net::setHalideScheduler``` before the first ```cv::dnn::Net::forward``` call. + +Scheduling configuration files represented as YAML files where each node is a +scheduled function or a scheduling directive. +@code +relu1: + reorder: [x, c, y] + split: { y: 2, c: 8 } + parallel: [yo, co] + unroll: yi + vectorize: { x: 4 } +conv1_constant_exterior: + compute_at: { relu1: yi } +@endcode + +Considered use variables `n` for batch dimension, `c` for channels, +`y` for rows and `x` for columns. For variables after split are used names +with the same prefix but `o` and `i` suffixes for outer and inner variables +correspondingly. In example, for variable `x` in range `[0, 10)` directive +`split: { x: 2 }` gives new ones `xo` in range `[0, 5)` and `xi` in range `[0, 2)`. +Variable name `x` is no longer available in the same scheduling node. + +You can find scheduling examples at [opencv_extra/testdata/dnn](https://github.com/opencv/opencv_extra/tree/master/testdata/dnn) +and use it for schedule your networks. + +## Layers fusing +Thanks to layers fusing we can schedule only the top layers of fused sets. +Because for every output value we use the fused formula. +In example, if you have three layers Convolution + Scale + ReLU one by one, +@code +conv(x, y, c, n) = sum(...) + bias(c); +scale(x, y, c, n) = conv(x, y, c, n) * weights(c); +relu(x, y, c, n) = max(scale(x, y, c, n), 0); +@endcode + +fused function is something like +@code +relu(x, y, c, n) = max((sum(...) + bias(c)) * weights(c), 0); +@endcode + +So only function called `relu` require scheduling. + +## Scheduling patterns +Sometimes networks built using blocked structure that means some layer are +identical or quite similar. If you want to apply the same scheduling for +different layers accurate to tiling or vectorization factors, define scheduling +patterns in section `patterns` at the beginning of scheduling file. +Also, your patters may use some parametric variables. +@code +# At the beginning of the file +patterns: + fully_connected: + split: { c: c_split } + fuse: { src: [x, y, co], dst: block } + parallel: block + vectorize: { ci: c_split } +# Somewhere below +fc8: + pattern: fully_connected + params: { c_split: 8 } +@endcode + +## Automatic scheduling +You can let DNN to schedule layers automatically. Just skip call of ```cv::dnn::Net::setHalideScheduler```. Sometimes it might be even more efficient than manual scheduling. +But if specific layers require be scheduled manually, you would be able to +mix both manual and automatic scheduling ways. Write scheduling file +and skip layers that you want to be scheduled automatically.